diff --git a/docs/openai_agents/getting-started.md b/docs/openai_agents/getting-started.md index f261f26b..61572182 100644 --- a/docs/openai_agents/getting-started.md +++ b/docs/openai_agents/getting-started.md @@ -35,7 +35,7 @@ python -m venv venv # On macOS/Linux: source venv/bin/activate # On Windows: -# venv\Scripts\activate +venv\Scripts\activate ``` ### Install Dependencies @@ -62,6 +62,18 @@ pip install -r requirements.txt **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. +IMPORTANT: Ensure your function app is using the *preview* extension bundle version 4.34.0 or higher by specifying it in `host.json`: + +```json +{ + "version": "2.0", + "extensionBundle": { + "id": "Microsoft.Azure.Functions.ExtensionBundle.Preview", + "version": "[4.34.0, 5.0.0)" + } +} +``` + There are two ways to configure the backend locally: #### Using the Emulator (Recommended) @@ -126,8 +138,9 @@ Update `local.settings.json` with your service configuration: "FUNCTIONS_WORKER_RUNTIME": "python", "AZURE_OPENAI_ENDPOINT": "https://.openai.azure.com/", "AZURE_OPENAI_DEPLOYMENT": "", + "OPENAI_DEFAULT_MODEL": "", "AZURE_OPENAI_API_VERSION": "2024-10-01-preview", - "DURABLE_TASK_SCHEDULER_CONNECTION_STRING": "http://localhost:8080;Authentication=None;", + "DURABLE_TASK_SCHEDULER_CONNECTION_STRING": "Endpoint=http://localhost:8080;Authentication=None;", "TASKHUB": "default" } } diff --git a/samples-v2/openai_agents/basic/hello_world.py b/samples-v2/openai_agents/basic/hello_world.py index 57c4ca98..e90da566 100644 --- a/samples-v2/openai_agents/basic/hello_world.py +++ b/samples-v2/openai_agents/basic/hello_world.py @@ -10,7 +10,7 @@ def main(): ) result = Runner.run_sync(agent, "Tell me about recursion in programming.") - return result.final_output; + return result.final_output # Function calls itself, # Looping in smaller pieces, # Endless by design. diff --git a/samples-v2/openai_agents/host.json b/samples-v2/openai_agents/host.json index 069e8f88..6ee8e9ce 100644 --- a/samples-v2/openai_agents/host.json +++ b/samples-v2/openai_agents/host.json @@ -19,6 +19,6 @@ }, "extensionBundle": { "id": "Microsoft.Azure.Functions.ExtensionBundle.Preview", - "version": "[4.29.0, 5.0.0)" + "version": "[4.34.0, 5.0.0)" } } \ No newline at end of file diff --git a/samples-v2/openai_agents/local.settings.json.template b/samples-v2/openai_agents/local.settings.json.template index 71126517..e51523da 100644 --- a/samples-v2/openai_agents/local.settings.json.template +++ b/samples-v2/openai_agents/local.settings.json.template @@ -5,6 +5,9 @@ "FUNCTIONS_WORKER_RUNTIME": "python", "AZURE_OPENAI_ENDPOINT": "https://your-openai-service.openai.azure.com/", "AZURE_OPENAI_DEPLOYMENT": "your-gpt-deployment-name", - "AZURE_OPENAI_API_VERSION": "2025-03-01-preview" + "OPENAI_DEFAULT_MODEL": "deployment-name", + "AZURE_OPENAI_API_VERSION": "2025-03-01-preview", + "DURABLE_TASK_SCHEDULER_CONNECTION_STRING": "Endpoint=http://localhost:8080;Authentication=None;", + "TASKHUB": "default" } } \ No newline at end of file