Skip to content

Commit 28b4d8b

Browse files
authored
Minor Agent SDK doc and sample fixes (#577)
* Update extension bundle version to 4.34.0 in host.json and add setup instructions for preview version in getting-started.md * Add DTS settings to local.settings.json.template * Remove unnecessary semicolon in hello_world.py * Uncomment a line in setup instructions * Improve formatting * Fix DTS sample connection string * Document OPENAI_DEFAULT_MODEL requirement
1 parent eff54bf commit 28b4d8b

File tree

4 files changed

+21
-5
lines changed

4 files changed

+21
-5
lines changed

docs/openai_agents/getting-started.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ python -m venv venv
3535
# On macOS/Linux:
3636
source venv/bin/activate
3737
# On Windows:
38-
# venv\Scripts\activate
38+
venv\Scripts\activate
3939
```
4040

4141
### Install Dependencies
@@ -62,6 +62,18 @@ pip install -r requirements.txt
6262

6363
**Durable Task Scheduler is the preferred backend** for this integration as it provides enhanced performance, better observability, and simplified local development. While not a hard requirement, it's strongly recommended for production workloads.
6464

65+
IMPORTANT: Ensure your function app is using the *preview* extension bundle version 4.34.0 or higher by specifying it in `host.json`:
66+
67+
```json
68+
{
69+
"version": "2.0",
70+
"extensionBundle": {
71+
"id": "Microsoft.Azure.Functions.ExtensionBundle.Preview",
72+
"version": "[4.34.0, 5.0.0)"
73+
}
74+
}
75+
```
76+
6577
There are two ways to configure the backend locally:
6678

6779
#### Using the Emulator (Recommended)
@@ -126,8 +138,9 @@ Update `local.settings.json` with your service configuration:
126138
"FUNCTIONS_WORKER_RUNTIME": "python",
127139
"AZURE_OPENAI_ENDPOINT": "https://<resource-name>.openai.azure.com/",
128140
"AZURE_OPENAI_DEPLOYMENT": "<deployment-name>",
141+
"OPENAI_DEFAULT_MODEL": "<deployment-name>",
129142
"AZURE_OPENAI_API_VERSION": "2024-10-01-preview",
130-
"DURABLE_TASK_SCHEDULER_CONNECTION_STRING": "http://localhost:8080;Authentication=None;",
143+
"DURABLE_TASK_SCHEDULER_CONNECTION_STRING": "Endpoint=http://localhost:8080;Authentication=None;",
131144
"TASKHUB": "default"
132145
}
133146
}

samples-v2/openai_agents/basic/hello_world.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def main():
1010
)
1111

1212
result = Runner.run_sync(agent, "Tell me about recursion in programming.")
13-
return result.final_output;
13+
return result.final_output
1414
# Function calls itself,
1515
# Looping in smaller pieces,
1616
# Endless by design.

samples-v2/openai_agents/host.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@
1919
},
2020
"extensionBundle": {
2121
"id": "Microsoft.Azure.Functions.ExtensionBundle.Preview",
22-
"version": "[4.29.0, 5.0.0)"
22+
"version": "[4.34.0, 5.0.0)"
2323
}
2424
}

samples-v2/openai_agents/local.settings.json.template

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
"FUNCTIONS_WORKER_RUNTIME": "python",
66
"AZURE_OPENAI_ENDPOINT": "https://your-openai-service.openai.azure.com/",
77
"AZURE_OPENAI_DEPLOYMENT": "your-gpt-deployment-name",
8-
"AZURE_OPENAI_API_VERSION": "2025-03-01-preview"
8+
"OPENAI_DEFAULT_MODEL": "deployment-name",
9+
"AZURE_OPENAI_API_VERSION": "2025-03-01-preview",
10+
"DURABLE_TASK_SCHEDULER_CONNECTION_STRING": "Endpoint=http://localhost:8080;Authentication=None;",
11+
"TASKHUB": "default"
912
}
1013
}

0 commit comments

Comments
 (0)