From 55c676cdbaf57586e2bb2cc271494e481535abc6 Mon Sep 17 00:00:00 2001 From: Pamela Fox Date: Thu, 7 Aug 2025 11:43:47 -0700 Subject: [PATCH] Add support for GPT-5 model family --- app/backend/approaches/approach.py | 3 +++ docs/deploy_features.md | 16 ++++++++++-- docs/reasoning.md | 39 +++++++++++++++++++++++++++--- 3 files changed, 53 insertions(+), 5 deletions(-) diff --git a/app/backend/approaches/approach.py b/app/backend/approaches/approach.py index ab58ba528a..71722108b0 100644 --- a/app/backend/approaches/approach.py +++ b/app/backend/approaches/approach.py @@ -136,6 +136,9 @@ class Approach(ABC): "o3": GPTReasoningModelSupport(streaming=True), "o3-mini": GPTReasoningModelSupport(streaming=True), "o4-mini": GPTReasoningModelSupport(streaming=True), + "gpt-5": GPTReasoningModelSupport(streaming=True), + "gpt-5-nano": GPTReasoningModelSupport(streaming=True), + "gpt-5-mini": GPTReasoningModelSupport(streaming=True), } # Set a higher token limit for GPT reasoning models RESPONSE_DEFAULT_TOKEN_LIMIT = 1024 diff --git a/docs/deploy_features.md b/docs/deploy_features.md index 89d79ca4b0..e6efee4c5b 100644 --- a/docs/deploy_features.md +++ b/docs/deploy_features.md @@ -35,10 +35,16 @@ As of early June 2025, the default chat completion model is `gpt-4.1-mini`. If y For example: ```bash - azd env set AZURE_OPENAI_CHATGPT_DEPLOYMENT gpt-4o + azd env set AZURE_OPENAI_CHATGPT_DEPLOYMENT gpt-5-chat ``` -1. To set the GPT model to a different [available model](https://learn.microsoft.com/azure/ai-services/openai/concepts/models), run this command with the appropriate model name. +1. To set the GPT model to a different [available model](https://learn.microsoft.com/azure/ai-services/openai/concepts/models), run this command with the appropriate model name. For reasoning models like gpt-5/o3/o4, check [the reasoning guide](./reasoning.md) + + For gpt-5-chat: + + ```shell + azd env set AZURE_OPENAI_CHATGPT_MODEL gpt-5-chat + ``` For gpt-4.1-mini: @@ -72,6 +78,12 @@ As of early June 2025, the default chat completion model is `gpt-4.1-mini`. If y 1. To set the Azure OpenAI model version from the [available versions](https://learn.microsoft.com/azure/ai-services/openai/concepts/models), run this command with the appropriate version string. + For gpt-5-chat: + + ```shell + azd env set AZURE_OPENAI_CHATGPT_DEPLOYMENT_VERSION 2025-08-07 + ``` + For gpt-4.1-mini: ```bash diff --git a/docs/reasoning.md b/docs/reasoning.md index e4fd36f631..d632f41be1 100644 --- a/docs/reasoning.md +++ b/docs/reasoning.md @@ -6,6 +6,9 @@ This repository includes an optional feature that uses reasoning models to gener ### Supported Models +* gpt-5 +* gpt-5-mini +* gpt-5-nano * o4-mini * o3 * o3-mini @@ -21,6 +24,36 @@ This repository includes an optional feature that uses reasoning models to gener Set the environment variables for your Azure OpenAI GPT deployments to your reasoning model + For gpt-5: + + ```shell + azd env set AZURE_OPENAI_CHATGPT_MODEL gpt-5 + azd env set AZURE_OPENAI_CHATGPT_DEPLOYMENT gpt-5 + azd env set AZURE_OPENAI_CHATGPT_DEPLOYMENT_VERSION 2025-08-07 + azd env set AZURE_OPENAI_CHATGPT_DEPLOYMENT_SKU GlobalStandard + azd env set AZURE_OPENAI_API_VERSION 2025-04-01-preview + ``` + + For gpt-5-mini: + + ```shell + azd env set AZURE_OPENAI_CHATGPT_MODEL gpt-5-mini + azd env set AZURE_OPENAI_CHATGPT_DEPLOYMENT gpt-5-mini + azd env set AZURE_OPENAI_CHATGPT_DEPLOYMENT_VERSION 2025-08-07 + azd env set AZURE_OPENAI_CHATGPT_DEPLOYMENT_SKU GlobalStandard + azd env set AZURE_OPENAI_API_VERSION 2025-04-01-preview + ``` + + For gpt-5-nano: + + ```shell + azd env set AZURE_OPENAI_CHATGPT_MODEL gpt-5-nano + azd env set AZURE_OPENAI_CHATGPT_DEPLOYMENT gpt-5-nano + azd env set AZURE_OPENAI_CHATGPT_DEPLOYMENT_VERSION 2025-08-07 + azd env set AZURE_OPENAI_CHATGPT_DEPLOYMENT_SKU GlobalStandard + azd env set AZURE_OPENAI_API_VERSION 2025-04-01-preview + ``` + For o4-mini: ```shell @@ -63,12 +96,12 @@ This repository includes an optional feature that uses reasoning models to gener 2. **(Optional) Set default reasoning effort** - You can configure how much effort the reasoning model spends on processing and understanding the user's request. Valid options are `low`, `medium`, and `high`. Reasoning effort defaults to `medium` if not set. + You can configure how much effort the reasoning model spends on processing and understanding the user's request. Valid options are `minimal` (for GPT-5 models only), `low`, `medium`, and `high`. Reasoning effort defaults to `medium` if not set. - Set the environment variable for reasoning effort + Set the environment variable for reasoning effort: ```shell - azd env set AZURE_OPENAI_REASONING_EFFORT medium + azd env set AZURE_OPENAI_REASONING_EFFORT minimal ``` 3. **Update the infrastructure and application:**