You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/google/adk/integrations/temporal/README.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,9 +4,9 @@ This package provides the integration layer between the Google ADK and Temporal.
4
4
5
5
## Core Concepts
6
6
7
-
### 1. Interception Flow (`TemporalPlugin`)
7
+
### 1. Interception Flow (`AgentPlugin`)
8
8
9
-
The `TemporalPlugin` acts as a middleware that intercepts model calls (e.g., `agent.generate_content`) *before* they execute.
9
+
The `AgentPlugin` acts as a middleware that intercepts model calls (e.g., `agent.generate_content`) *before* they execute.
10
10
11
11
**Workflow Interception:**
12
12
1.**Intercept**: The ADK invokes `before_model_callback` when an agent attempts to call a model.
@@ -32,12 +32,12 @@ When the workflow executes an activity with an unknown name (e.g., `MyAgent.gene
32
32
The integration requires setup on both the Agent (Workflow) side and the Worker side.
33
33
34
34
#### Agent Setup (Workflow Side)
35
-
Attach the `TemporalPlugin` to your ADK agent. This safely routes model calls through Temporal activities. You **must** provide activity options (e.g., timeouts) as there are no defaults.
35
+
Attach the `AgentPlugin` to your ADK agent. This safely routes model calls through Temporal activities. You **must** provide activity options (e.g., timeouts) as there are no defaults.
36
36
37
37
```python
38
38
from datetime import timedelta
39
39
from temporalio.common import RetryPolicy
40
-
from google.adk.integrations.temporal importTemporalPlugin
40
+
from google.adk.integrations.temporal importAgentPlugin
41
41
42
42
# 1. Define Temporal Activity Options
43
43
activity_options = {
@@ -50,7 +50,7 @@ agent = Agent(
50
50
model="gemini-2.5-pro",
51
51
plugins=[
52
52
# Routes model calls to Temporal Activities
53
-
TemporalPlugin(activity_options=activity_options)
53
+
AgentPlugin(activity_options=activity_options)
54
54
]
55
55
)
56
56
@@ -59,23 +59,23 @@ agent = Agent(
59
59
```
60
60
61
61
#### Worker Setup
62
-
Install the `AdkWorkerPlugin` on your Temporal Worker. This handles serialization and runtime determinism.
62
+
Install the `WorkerPlugin` on your Temporal Worker. This handles serialization and runtime determinism.
63
63
64
64
```python
65
65
from temporalio.worker import Worker
66
-
from google.adk.integrations.temporal importAdkWorkerPlugin
66
+
from google.adk.integrations.temporal importWorkerPlugin
67
67
68
68
asyncdefmain():
69
69
worker = Worker(
70
70
client,
71
71
task_queue="my-queue",
72
72
# Configures ADK Runtime & Pydantic Support
73
-
plugins=[AdkWorkerPlugin()]
73
+
plugins=[WorkerPlugin()]
74
74
)
75
75
await worker.run()
76
76
```
77
77
78
-
**What `AdkWorkerPlugin` Does:**
78
+
**What `WorkerPlugin` Does:**
79
79
***Data Converter**: Enables Pydantic serialization for ADK objects.
80
80
***Interceptors**: Sets up specific ADK runtime hooks for determinism (replacing `time.time`, `uuid.uuid4`) before workflow execution.
81
81
* TODO: is this enough . **Unsandboxed Workflow Runner**: Configures the worker to use the `UnsandboxedWorkflowRunner`, allowing standard imports in ADK agents.
0 commit comments