Add Temporal plugin to integrations#1331
Add Temporal plugin to integrations#1331drewhoskins-temporal wants to merge 1 commit intogoogle:mainfrom
Conversation
✅ Deploy Preview for adk-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
| client, | ||
| task_queue="adk-task-queue", | ||
| workflows=[WeatherAgentWorkflow], | ||
| plugins=[TemporalAdkPlugin()], |
There was a problem hiding this comment.
It's good practice to put the plugin on the client. In this case your code will fail because the pydantic data converter will not be used.
| from temporalio.client import Client | ||
|
|
||
| async def start(): | ||
| client = await Client.connect("localhost:7233") |
| print(result) | ||
| ``` | ||
|
|
||
| ### Using custom tools as Activities |
There was a problem hiding this comment.
Using activities as tools, not the reverse.
koverholt
left a comment
There was a problem hiding this comment.
Thanks for the PR and contribution! Exciting to see the ongoing plugin work in the linked PR.
I left some comments to address. And I'm going to apply the blocked label to this PR until the updated SDK/integration is released and ready for us to test (let us know!).
You'll also need to sign the CLA per the bot's failing CI test, you can find more details in https://github.com/google/adk-docs/pull/1331/checks?check_run_id=64235775129.
| --- | ||
| catalog_title: Temporal | ||
| catalog_description: Resilient, scalable agents, long-running agents and tools, human approvals, safe versioning, and more using the world's leading durable execution provider. | ||
| catalog_icon: /adk-docs/integrations/assets/temporal.svg |
There was a problem hiding this comment.
The icon reference here has .svg, but the uploaded icon is in .png format, so the card icon is currently broken.
There was a problem hiding this comment.
Logos and assets for integrations should be placed in docs/integrations/assets/.
| @@ -0,0 +1,248 @@ | |||
| --- | |||
| catalog_title: Temporal | |||
| catalog_description: Resilient, scalable agents, long-running agents and tools, human approvals, safe versioning, and more using the world's leading durable execution provider. | |||
There was a problem hiding this comment.
Please shorten this description to ~10 words and remove superlative language like "using the world's leading durable execution provider" to be consistent with the other integrations.
| | Human-in-the-loop | Your Agent Workflow can wait for [Signals](https://docs.temporal.io/signals) and [Updates](https://docs.temporal.io/messages#updates) to wait for human input, and clients can send those to resume the Agent | | ||
| | Deterministic runtime | `TemporalAdkPlugin` replaces non-deterministic calls with Temporal-safe equivalents | | ||
| | Debuggability | Every LLM call and tool execution is visible as an Activity in the Temporal UI, making it trivial to debug faults. | | ||
| | Observability | Work with your favorite Observability solution using OpenTelemetry, with cross-process spans that are resilient to crashes. |
There was a problem hiding this comment.
Add missing closing pipe delimiter:
| | Observability | Work with your favorite Observability solution using OpenTelemetry, with cross-process spans that are resilient to crashes. | |
| | Observability | Work with your favorite Observability solution using OpenTelemetry, with cross-process spans that are resilient to crashes. | |
| - **Durable execution**: Never lose progress. If your agent crashes or stalls, | ||
| Temporal automatically recovers from the last successful step - no manual | ||
| [session resumption](https://google.github.io/adk-docs/runtime/resume/#resume-a-stopped-workflow) | ||
| required. | ||
| - **Built-in retries and rate limiting**: Configurable | ||
| [retry policies](https://docs.temporal.io/encyclopedia/retry-policies) with | ||
| backoff, plus mechanisms for handling backpressure from LLM providers. | ||
| - **Long-running and ambient agents**: Support for agents that run for hours, | ||
| days, or indefinitely using blocking awaits and | ||
| [worker versioning](https://docs.temporal.io/production-deployment/worker-deployments/worker-versioning). | ||
| - **Human-in-the-loop**: Pause execution until a human approves, then resume | ||
| where you left off. Temporal's | ||
| [task routing](https://docs.temporal.io/task-routing) scalably routes incoming | ||
| signals (such as user chats or approvals) to the correct workflow. | ||
| - **Long-running tools**: Execute tools that take minutes or hours as | ||
| [Activities](https://docs.temporal.io/activities) with heartbeating, timeouts, | ||
| and retries - no separate microservices needed. | ||
| - **Observability and debugging**: Inspect every step of your agent's execution, | ||
| replay workflows deterministically, and pinpoint failures using the | ||
| [Temporal UI](https://docs.temporal.io/web-ui). | ||
| - **Safe versioning**: Deploy new agent versions without breaking in-flight | ||
| executions via | ||
| [worker versioning](https://docs.temporal.io/production-deployment/worker-deployments/worker-versioning). |
There was a problem hiding this comment.
Consider reducing these use cases to fewer bullets down to 4-5 total, it's a lot for readers to take in near the top of the doc. Combine bullets where possible, and focus on core benefits instead of listing all features.
|
|
||
| - **Durable execution**: Never lose progress. If your agent crashes or stalls, | ||
| Temporal automatically recovers from the last successful step - no manual | ||
| [session resumption](https://google.github.io/adk-docs/runtime/resume/#resume-a-stopped-workflow) |
There was a problem hiding this comment.
Change the absolute link to a site-relative path:
| [session resumption](https://google.github.io/adk-docs/runtime/resume/#resume-a-stopped-workflow) | |
| [session resumption](/adk-docs/runtime/resume/#resume-a-stopped-workflow) |
| - A [Gemini API key](https://aistudio.google.com/app/api-keys) (or any | ||
| [supported model](https://google.github.io/adk-docs/agents/models/)) |
There was a problem hiding this comment.
Change the absolute link to a site-relative path:
| - A [Gemini API key](https://aistudio.google.com/app/api-keys) (or any | |
| [supported model](https://google.github.io/adk-docs/agents/models/)) | |
| - A [Gemini API key](https://aistudio.google.com/app/api-keys) (or any | |
| [supported model](/adk-docs/agents/models/)) |
|
|
||
| ### Using MCP tools | ||
|
|
||
| Execute [MCP](https://google.github.io/adk-docs/mcp/) tools as Temporal |
There was a problem hiding this comment.
Change the absolute link to a site-relative path:
| Execute [MCP](https://google.github.io/adk-docs/mcp/) tools as Temporal | |
| Execute [MCP](/adk-docs/mcp/) tools as Temporal |
| from datetime import timedelta | ||
| from temporalio import activity | ||
| from temporalio.contrib.google_adk_agents.workflow import activity_tool | ||
| from temporalio.workflow import ActivityConfig |
There was a problem hiding this comment.
ActivityConfig is not used in this code sample.
| from temporalio.workflow import ActivityConfig | ||
|
|
||
| @activity.defn | ||
| async def get_weather(city: str) -> str: |
There was a problem hiding this comment.
There are a few other issues across code samples such as:
get_weatheris used in the first code sample but not defined until the fourth code sample.Agentis imported in the first code sample but not the others
You can consider either:
- Defining all necessary imports in each code sample so that each sample is standalone (likely works best for this integration).
- Defining all imports in one code block at the top, then each subsequent code sample is additive.
Document the upcoming Temporal integration. temporalio/sdk-python#1282