Skip to content

Commit c1f464d

Browse files
author
Charlotte Zhuang
committed
add details
1 parent be4e2e5 commit c1f464d

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
OPENAI_API_KEY=123
2+
SCALE_GP_API_KEY=abc
3+
SCALE_GP_ACCOUNT_ID=456

examples/tutorials/10_agentic/10_temporal/011_custom_agent_chat/project/special_run_agent.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ class SpecialRunAgentParams:
6666

6767

6868
class SpecialRunAgentResult(TypedDict):
69+
"""Note that activities must return a serializable dict."""
70+
6971
final_output: Any
7072
"""The final output of the agent. This should not be None."""
7173

@@ -75,7 +77,11 @@ class SpecialRunAgentResult(TypedDict):
7577

7678
@activity.defn(name=SPECIAL_RUN_AGENT_ACTIVITY_NAME)
7779
async def special_run_agent(params: SpecialRunAgentParams) -> SpecialRunAgentResult:
78-
"""Run an agent with streaming and automatic TaskMessage creation."""
80+
"""
81+
Run an agent with streaming and automatic TaskMessage creation.
82+
83+
Note that activities must return a serializable dict.
84+
"""
7985

8086
tool_call_map: dict[str, ResponseFunctionToolCall] = {}
8187
redacted_params = redact_mcp_server_params(

examples/tutorials/10_agentic/10_temporal/011_custom_agent_chat/project/workflow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ async def on_task_event_send(self, params: SendEventParams) -> None:
118118
parent_span_id=span.id if span else None,
119119
)
120120

121-
# Custom activity that generates a response
121+
# Custom activity that we implemented in special_run_agent.py
122122
run_result: SpecialRunAgentResult = await workflow.execute_activity(
123123
activity=SPECIAL_RUN_AGENT_ACTIVITY_NAME,
124124
arg=SpecialRunAgentParams(

0 commit comments

Comments
 (0)