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: openai_agents/basic/README.md
+56-2Lines changed: 56 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,8 @@ Simple examples to get started with OpenAI Agents SDK integrated with Temporal w
4
4
5
5
*Adapted from [OpenAI Agents SDK basic examples](https://github.com/openai/openai-agents-python/tree/main/examples/basic)*
6
6
7
+
Before running these examples, be sure to review the [prerequisites and background on the integration](../README.md).
8
+
7
9
## Running the Examples
8
10
9
11
First, start the worker (supports all basic examples):
@@ -14,12 +16,64 @@ uv run openai_agents/basic/run_worker.py
14
16
Then run individual examples in separate terminals:
15
17
16
18
### Hello World Agent
19
+
Basic agent that only responds in haikus:
17
20
```bash
18
21
uv run openai_agents/basic/run_hello_world_workflow.py
19
22
```
20
23
21
24
### Tools Agent
22
-
Agent with access to external tools (weather API):
25
+
Agent with access to external tools (simulated weather API):
23
26
```bash
24
27
uv run openai_agents/basic/run_tools_workflow.py
25
-
```
28
+
```
29
+
30
+
### Agent Lifecycle with Hooks
31
+
Demonstrates agent lifecycle events and handoffs between agents:
32
+
```bash
33
+
uv run openai_agents/basic/run_agent_lifecycle_workflow.py
34
+
```
35
+
36
+
### Lifecycle with Usage Tracking
37
+
Shows detailed usage tracking with RunHooks (requests, tokens, etc.):
38
+
```bash
39
+
uv run openai_agents/basic/run_lifecycle_workflow.py
40
+
```
41
+
42
+
### Dynamic System Prompts
43
+
Agent with dynamic instruction generation based on context (haiku/pirate/robot):
44
+
```bash
45
+
uv run openai_agents/basic/run_dynamic_system_prompt_workflow.py
46
+
```
47
+
48
+
### Non-Strict Output Types
49
+
Demonstrates different JSON schema validation approaches:
50
+
```bash
51
+
uv run openai_agents/basic/run_non_strict_output_workflow.py
52
+
```
53
+
54
+
Note: `CustomOutputSchema` is not supported by the Temporal OpenAI Agents SDK integration and is omitted in this example.
55
+
56
+
### Image Processing - Local
57
+
Process local image files with AI vision:
58
+
```bash
59
+
uv run openai_agents/basic/run_local_image_workflow.py
60
+
```
61
+
62
+
### Image Processing - Remote
63
+
Process remote image URLs with AI vision:
64
+
```bash
65
+
uv run openai_agents/basic/run_remote_image_workflow.py
66
+
```
67
+
68
+
### Previous Response ID
69
+
Demonstrates conversation continuity using response IDs:
70
+
```bash
71
+
uv run openai_agents/basic/run_previous_response_id_workflow.py
72
+
```
73
+
74
+
## Omitted Examples
75
+
76
+
The following examples from the [reference repository](https://github.com/openai/openai-agents-python/tree/main/examples/basic) are not included in this Temporal adaptation:
77
+
78
+
-**Session** - Stores state in local SQLite database, not appropriate for distributed workflows
79
+
-**Stream Items/Stream Text** - Streaming is not supported in Temporal OpenAI Agents SDK integration
0 commit comments