diff --git a/.env.example b/.env.example index c4a4ea3..bfcca79 100644 --- a/.env.example +++ b/.env.example @@ -17,4 +17,5 @@ AZURE_DEPLOYMENT=gpt-5 # Optional Azure settings AZURE_API_VERSION= AZURE_SUMMARY_LEVEL= +AZURE_VERBOSITY_LEVEL= AZURE_TRUNCATION= \ No newline at end of file diff --git a/.gitignore b/.gitignore index ca8fae1..0dd9a5e 100644 --- a/.gitignore +++ b/.gitignore @@ -40,7 +40,7 @@ env/ .env # Recordings -recordings/ +/recordings/ # Legacy openai backend backend_openai.py \ No newline at end of file diff --git a/README.md b/README.md index 84d2c94..1e8b6b2 100644 --- a/README.md +++ b/README.md @@ -39,13 +39,14 @@ If you prefer to deploy the service (for example, to allow multiple members of y Make a copy of the file `.env.example` as `.env` and update the following flags as needed: -| Flag | Description | Default | -| --------------------- | ------------------------------------------------------------------------------------------------------------------------------ | ----------- | -| `AZURE_BASE_URL` | Your Azure OpenAI endpoint base URL (no trailing slash), e.g. `https://.openai.azure.com`. | required | -| `AZURE_API_KEY` | Azure OpenAI API key. | required | -| `AZURE_DEPLOYMENT` | Name of the Azure model deployment to use. | `gpt-5` | -| `SERVICE_API_KEY` | Arbitrary API key to protect your service. Set it to a random string. | `change-me` | -| `AZURE_SUMMARY_LEVEL` | Set to `none` to disable summaries. You might have to disable them if your organization hasn't been approved for this feature. | `detailed` | +| Flag | Description | Default | +| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------ | ----------- | +| `SERVICE_API_KEY` | Arbitrary API key to protect your service. Set it to a random string. | `change-me` | +| `AZURE_BASE_URL` | Your Azure OpenAI endpoint base URL (no trailing slash), e.g. `https://.openai.azure.com`. | required | +| `AZURE_API_KEY` | Azure OpenAI API key. | required | +| `AZURE_DEPLOYMENT` | Name of the Azure model deployment to use. | `gpt-5` | +| `AZURE_VERBOSITY_LEVEL` | Hint the model to be more or less expansive in its replies. Use either `high` / `medium` / `low` | `medium` | +| `AZURE_SUMMARY_LEVEL` | Set to `none` to disable summaries. You might have to disable them if your organization hasn't been approved for this feature. | `detailed` | Alternatively, you can pass them through the environment where you run the application. diff --git a/app/azure/request_adapter.py b/app/azure/request_adapter.py index 35fd405..f7fe0e7 100644 --- a/app/azure/request_adapter.py +++ b/app/azure/request_adapter.py @@ -178,6 +178,10 @@ class RequestAdapter: if settings["AZURE_SUMMARY_LEVEL"] in {"auto", "detailed", "concise"}: responses_body["reasoning"]["summary"] = settings["AZURE_SUMMARY_LEVEL"] + # No need to pass verbosity if it's set to medium, as it's the model's default + if settings["AZURE_VERBOSITY_LEVEL"] in {"low", "high"}: + responses_body["text"] = {"verbosity": settings["AZURE_VERBOSITY_LEVEL"]} + responses_body["store"] = False responses_body["stream_options"] = {"include_obfuscation": False} responses_body["truncation"] = settings["AZURE_TRUNCATION"] diff --git a/app/settings.py b/app/settings.py index e716c00..6a31680 100644 --- a/app/settings.py +++ b/app/settings.py @@ -23,6 +23,7 @@ AZURE_DEPLOYMENT = env.str("AZURE_DEPLOYMENT") or "gpt-5" AZURE_API_VERSION = env.str("AZURE_API_VERSION") or "2025-04-01-preview" AZURE_SUMMARY_LEVEL = env.str("AZURE_SUMMARY_LEVEL") or "detailed" +AZURE_VERBOSITY_LEVEL = env.str("AZURE_VERBOSITY_LEVEL") or "medium" AZURE_TRUNCATION = env.str("AZURE_TRUNCATION") or "auto" AZURE_RESPONSES_API_URL = ( diff --git a/tests/recordings/verbosity_level/downstream_request.json b/tests/recordings/verbosity_level/downstream_request.json new file mode 100644 index 0000000..faa20ae --- /dev/null +++ b/tests/recordings/verbosity_level/downstream_request.json @@ -0,0 +1,396 @@ +{ + "model": "gpt-minimal", + "temperature": 0, + "user": "REDACTED", + "messages": [ + { + "role": "system", + "content": "REDACTED" + }, + { + "role": "user", + "content": "REDACTED" + }, + { + "role": "user", + "content": "REDACTED" + } + ], + "tools": [ + { + "type": "function", + "function": { + "name": "REDACTED", + "description": "REDACTED", + "parameters": { + "type": "object", + "properties": { + "explanation": { + "type": "string", + "description": "REDACTED" + }, + "query": { + "type": "string", + "description": "REDACTED" + }, + "target_directories": { + "type": "array", + "items": { + "type": "string" + }, + "description": "REDACTED" + }, + "search_only_prs": { + "type": "boolean", + "description": "REDACTED" + } + }, + "required": [ + "explanation", + "query", + "target_directories" + ] + } + } + }, + { + "type": "function", + "function": { + "name": "REDACTED", + "description": "REDACTED", + "parameters": { + "type": "object", + "properties": { + "command": { + "type": "string", + "description": "REDACTED" + }, + "is_background": { + "type": "boolean", + "description": "REDACTED" + }, + "explanation": { + "type": "string", + "description": "REDACTED" + } + }, + "required": [ + "command", + "is_background" + ] + } + } + }, + { + "type": "function", + "function": { + "name": "REDACTED", + "description": "REDACTED", + "parameters": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "REDACTED" + }, + "path": { + "type": "string", + "description": "REDACTED" + }, + "glob": { + "type": "string", + "description": "REDACTED" + }, + "output_mode": { + "type": "string", + "description": "REDACTED", + "enum": [ + "content", + "files_with_matches", + "count" + ] + }, + "-B": { + "type": "number", + "description": "REDACTED" + }, + "-A": { + "type": "number", + "description": "REDACTED" + }, + "-C": { + "type": "number", + "description": "REDACTED" + }, + "-i": { + "type": "boolean", + "description": "REDACTED" + }, + "type": { + "type": "string", + "description": "REDACTED" + }, + "head_limit": { + "type": "number", + "description": "REDACTED" + }, + "multiline": { + "type": "boolean", + "description": "REDACTED" + } + }, + "required": [ + "pattern" + ] + } + } + }, + { + "type": "function", + "function": { + "name": "REDACTED", + "description": "REDACTED", + "parameters": { + "type": "object", + "properties": { + "target_file": { + "type": "string", + "description": "REDACTED" + }, + "explanation": { + "type": "string", + "description": "REDACTED" + } + }, + "required": [ + "target_file" + ] + } + } + }, + { + "type": "function", + "function": { + "name": "REDACTED", + "description": "REDACTED", + "parameters": { + "type": "object", + "properties": { + "paths": { + "description": "REDACTED", + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [] + } + } + }, + { + "type": "function", + "function": { + "name": "REDACTED", + "description": "REDACTED", + "parameters": { + "type": "object", + "properties": { + "target_notebook": { + "type": "string", + "description": "REDACTED" + }, + "cell_idx": { + "type": "number", + "description": "REDACTED" + }, + "is_new_cell": { + "type": "boolean", + "description": "REDACTED" + }, + "cell_language": { + "type": "string", + "description": "REDACTED" + }, + "old_string": { + "type": "string", + "description": "REDACTED" + }, + "new_string": { + "type": "string", + "description": "REDACTED" + } + }, + "required": [ + "target_notebook", + "cell_idx", + "is_new_cell", + "cell_language", + "old_string", + "new_string" + ] + } + } + }, + { + "type": "function", + "function": { + "name": "REDACTED", + "description": "REDACTED", + "parameters": { + "type": "object", + "properties": { + "merge": { + "type": "boolean", + "description": "REDACTED" + }, + "todos": { + "type": "array", + "description": "REDACTED", + "items": { + "type": "object", + "properties": { + "content": { + "type": "string", + "description": "REDACTED" + }, + "status": { + "type": "string", + "enum": [ + "pending", + "in_progress", + "completed", + "cancelled" + ], + "description": "REDACTED" + }, + "id": { + "type": "string", + "description": "REDACTED" + } + }, + "required": [ + "content", + "status", + "id" + ] + }, + "minItems": 2 + } + }, + "required": [ + "merge", + "todos" + ] + } + } + }, + { + "type": "function", + "function": { + "name": "REDACTED", + "description": "REDACTED", + "parameters": { + "type": "object", + "properties": { + "target_file": { + "type": "string", + "description": "REDACTED" + }, + "instructions": { + "type": "string", + "description": "REDACTED" + }, + "code_edit": { + "type": "string", + "description": "REDACTED" + } + }, + "required": [ + "target_file", + "instructions", + "code_edit" + ] + } + } + }, + { + "type": "function", + "function": { + "name": "REDACTED", + "description": "REDACTED", + "parameters": { + "type": "object", + "properties": { + "target_file": { + "type": "string", + "description": "REDACTED" + }, + "offset": { + "type": "integer", + "description": "REDACTED" + }, + "limit": { + "type": "integer", + "description": "REDACTED" + } + }, + "required": [ + "target_file" + ] + } + } + }, + { + "type": "function", + "function": { + "name": "REDACTED", + "description": "REDACTED", + "parameters": { + "type": "object", + "properties": { + "target_directory": { + "type": "string", + "description": "REDACTED" + }, + "ignore_globs": { + "type": "array", + "items": { + "type": "string" + }, + "description": "REDACTED" + } + }, + "required": [ + "target_directory" + ] + } + } + }, + { + "type": "function", + "function": { + "name": "REDACTED", + "description": "REDACTED", + "parameters": { + "type": "object", + "properties": { + "target_directory": { + "type": "string", + "description": "REDACTED" + }, + "glob_pattern": { + "type": "string", + "description": "REDACTED" + } + }, + "required": [ + "glob_pattern" + ] + } + } + } + ], + "tool_choice": "auto", + "stream": true +} \ No newline at end of file diff --git a/tests/recordings/verbosity_level/downstream_response.sse b/tests/recordings/verbosity_level/downstream_response.sse new file mode 100644 index 0000000..b78257c --- /dev/null +++ b/tests/recordings/verbosity_level/downstream_response.sse @@ -0,0 +1,144 @@ +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641856,"model":"gpt-minimal","choices":[{"index":0,"delta":{"role":"assistant","content":"\n\n"},"finish_reason":null}]} + +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641857,"model":"gpt-minimal","choices":[{"index":0,"delta":{"role":"assistant","content":"\n\n"},"finish_reason":null}]} + +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641857,"model":"gpt-minimal","choices":[{"index":0,"delta":{"role":"assistant","content":"Hey"},"finish_reason":null}]} + +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641857,"model":"gpt-minimal","choices":[{"index":0,"delta":{"role":"assistant","content":"!"},"finish_reason":null}]} + +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641857,"model":"gpt-minimal","choices":[{"index":0,"delta":{"role":"assistant","content":" I"},"finish_reason":null}]} + +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641857,"model":"gpt-minimal","choices":[{"index":0,"delta":{"role":"assistant","content":"’m"},"finish_reason":null}]} + +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641857,"model":"gpt-minimal","choices":[{"index":0,"delta":{"role":"assistant","content":" here"},"finish_reason":null}]} + +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641857,"model":"gpt-minimal","choices":[{"index":0,"delta":{"role":"assistant","content":" and"},"finish_reason":null}]} + +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641857,"model":"gpt-minimal","choices":[{"index":0,"delta":{"role":"assistant","content":" ready"},"finish_reason":null}]} + +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641857,"model":"gpt-minimal","choices":[{"index":0,"delta":{"role":"assistant","content":" to"},"finish_reason":null}]} + +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641857,"model":"gpt-minimal","choices":[{"index":0,"delta":{"role":"assistant","content":" help"},"finish_reason":null}]} + +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641857,"model":"gpt-minimal","choices":[{"index":0,"delta":{"role":"assistant","content":"."},"finish_reason":null}]} + +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641857,"model":"gpt-minimal","choices":[{"index":0,"delta":{"role":"assistant","content":" How"},"finish_reason":null}]} + +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641857,"model":"gpt-minimal","choices":[{"index":0,"delta":{"role":"assistant","content":"’s"},"finish_reason":null}]} + +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641857,"model":"gpt-minimal","choices":[{"index":0,"delta":{"role":"assistant","content":" your"},"finish_reason":null}]} + +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641857,"model":"gpt-minimal","choices":[{"index":0,"delta":{"role":"assistant","content":" project"},"finish_reason":null}]} + +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641857,"model":"gpt-minimal","choices":[{"index":0,"delta":{"role":"assistant","content":" going"},"finish_reason":null}]} + +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641857,"model":"gpt-minimal","choices":[{"index":0,"delta":{"role":"assistant","content":"?"},"finish_reason":null}]} + +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641857,"model":"gpt-minimal","choices":[{"index":0,"delta":{"role":"assistant","content":" Do"},"finish_reason":null}]} + +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641857,"model":"gpt-minimal","choices":[{"index":0,"delta":{"role":"assistant","content":" you"},"finish_reason":null}]} + +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641857,"model":"gpt-minimal","choices":[{"index":0,"delta":{"role":"assistant","content":" want"},"finish_reason":null}]} + +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641857,"model":"gpt-minimal","choices":[{"index":0,"delta":{"role":"assistant","content":" me"},"finish_reason":null}]} + +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641857,"model":"gpt-minimal","choices":[{"index":0,"delta":{"role":"assistant","content":" to"},"finish_reason":null}]} + +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641857,"model":"gpt-minimal","choices":[{"index":0,"delta":{"role":"assistant","content":" pick"},"finish_reason":null}]} + +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641857,"model":"gpt-minimal","choices":[{"index":0,"delta":{"role":"assistant","content":" up"},"finish_reason":null}]} + +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641857,"model":"gpt-minimal","choices":[{"index":0,"delta":{"role":"assistant","content":" anything"},"finish_reason":null}]} + +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641857,"model":"gpt-minimal","choices":[{"index":0,"delta":{"role":"assistant","content":" specific"},"finish_reason":null}]} + +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641857,"model":"gpt-minimal","choices":[{"index":0,"delta":{"role":"assistant","content":" in"},"finish_reason":null}]} + +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641857,"model":"gpt-minimal","choices":[{"index":0,"delta":{"role":"assistant","content":" your"},"finish_reason":null}]} + +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641857,"model":"gpt-minimal","choices":[{"index":0,"delta":{"role":"assistant","content":" repo"},"finish_reason":null}]} + +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641857,"model":"gpt-minimal","choices":[{"index":0,"delta":{"role":"assistant","content":","},"finish_reason":null}]} + +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641857,"model":"gpt-minimal","choices":[{"index":0,"delta":{"role":"assistant","content":" run"},"finish_reason":null}]} + +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641857,"model":"gpt-minimal","choices":[{"index":0,"delta":{"role":"assistant","content":" tests"},"finish_reason":null}]} + +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641857,"model":"gpt-minimal","choices":[{"index":0,"delta":{"role":"assistant","content":","},"finish_reason":null}]} + +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641858,"model":"gpt-minimal","choices":[{"index":0,"delta":{"role":"assistant","content":" or"},"finish_reason":null}]} + +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641858,"model":"gpt-minimal","choices":[{"index":0,"delta":{"role":"assistant","content":" review"},"finish_reason":null}]} + +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641858,"model":"gpt-minimal","choices":[{"index":0,"delta":{"role":"assistant","content":" recent"},"finish_reason":null}]} + +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641858,"model":"gpt-minimal","choices":[{"index":0,"delta":{"role":"assistant","content":" changes"},"finish_reason":null}]} + +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641858,"model":"gpt-minimal","choices":[{"index":0,"delta":{"role":"assistant","content":"?"},"finish_reason":null}]} + +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641858,"model":"gpt-minimal","choices":[{"index":0,"delta":{"role":"assistant","content":" If"},"finish_reason":null}]} + +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641858,"model":"gpt-minimal","choices":[{"index":0,"delta":{"role":"assistant","content":" you"},"finish_reason":null}]} + +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641858,"model":"gpt-minimal","choices":[{"index":0,"delta":{"role":"assistant","content":"’re"},"finish_reason":null}]} + +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641858,"model":"gpt-minimal","choices":[{"index":0,"delta":{"role":"assistant","content":" working"},"finish_reason":null}]} + +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641858,"model":"gpt-minimal","choices":[{"index":0,"delta":{"role":"assistant","content":" on"},"finish_reason":null}]} + +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641858,"model":"gpt-minimal","choices":[{"index":0,"delta":{"role":"assistant","content":" the"},"finish_reason":null}]} + +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641858,"model":"gpt-minimal","choices":[{"index":0,"delta":{"role":"assistant","content":" “"},"finish_reason":null}]} + +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641858,"model":"gpt-minimal","choices":[{"index":0,"delta":{"role":"assistant","content":"add"},"finish_reason":null}]} + +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641858,"model":"gpt-minimal","choices":[{"index":0,"delta":{"role":"assistant","content":" support"},"finish_reason":null}]} + +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641858,"model":"gpt-minimal","choices":[{"index":0,"delta":{"role":"assistant","content":" for"},"finish_reason":null}]} + +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641858,"model":"gpt-minimal","choices":[{"index":0,"delta":{"role":"assistant","content":" verbosity"},"finish_reason":null}]} + +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641858,"model":"gpt-minimal","choices":[{"index":0,"delta":{"role":"assistant","content":"”"},"finish_reason":null}]} + +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641858,"model":"gpt-minimal","choices":[{"index":0,"delta":{"role":"assistant","content":" branch"},"finish_reason":null}]} + +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641858,"model":"gpt-minimal","choices":[{"index":0,"delta":{"role":"assistant","content":","},"finish_reason":null}]} + +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641858,"model":"gpt-minimal","choices":[{"index":0,"delta":{"role":"assistant","content":" I"},"finish_reason":null}]} + +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641858,"model":"gpt-minimal","choices":[{"index":0,"delta":{"role":"assistant","content":" can"},"finish_reason":null}]} + +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641858,"model":"gpt-minimal","choices":[{"index":0,"delta":{"role":"assistant","content":" check"},"finish_reason":null}]} + +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641858,"model":"gpt-minimal","choices":[{"index":0,"delta":{"role":"assistant","content":" the"},"finish_reason":null}]} + +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641858,"model":"gpt-minimal","choices":[{"index":0,"delta":{"role":"assistant","content":" adapters"},"finish_reason":null}]} + +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641858,"model":"gpt-minimal","choices":[{"index":0,"delta":{"role":"assistant","content":" and"},"finish_reason":null}]} + +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641858,"model":"gpt-minimal","choices":[{"index":0,"delta":{"role":"assistant","content":" tests"},"finish_reason":null}]} + +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641858,"model":"gpt-minimal","choices":[{"index":0,"delta":{"role":"assistant","content":" around"},"finish_reason":null}]} + +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641858,"model":"gpt-minimal","choices":[{"index":0,"delta":{"role":"assistant","content":" the"},"finish_reason":null}]} + +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641858,"model":"gpt-minimal","choices":[{"index":0,"delta":{"role":"assistant","content":" verbosity"},"finish_reason":null}]} + +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641858,"model":"gpt-minimal","choices":[{"index":0,"delta":{"role":"assistant","content":" recordings"},"finish_reason":null}]} + +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641858,"model":"gpt-minimal","choices":[{"index":0,"delta":{"role":"assistant","content":" and"},"finish_reason":null}]} + +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641858,"model":"gpt-minimal","choices":[{"index":0,"delta":{"role":"assistant","content":" make"},"finish_reason":null}]} + +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641859,"model":"gpt-minimal","choices":[{"index":0,"delta":{"role":"assistant","content":" sure"},"finish_reason":null}]} + +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641859,"model":"gpt-minimal","choices":[{"index":0,"delta":{"role":"assistant","content":" everything"},"finish_reason":null}]} + +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641859,"model":"gpt-minimal","choices":[{"index":0,"delta":{"role":"assistant","content":" passes"},"finish_reason":null}]} + +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641859,"model":"gpt-minimal","choices":[{"index":0,"delta":{"role":"assistant","content":"."},"finish_reason":null}]} + +data: {"id":"chatcmpl-W6D40tdKgwgksA18Xc4zKeCN","object":"chat.completion.chunk","created":1758641860,"model":"gpt-minimal","choices":[{"index":0,"delta":{},"finish_reason":"stop"}]} + +data: [DONE] + diff --git a/tests/recordings/verbosity_level/upstream_request.json b/tests/recordings/verbosity_level/upstream_request.json new file mode 100644 index 0000000..0f18cde --- /dev/null +++ b/tests/recordings/verbosity_level/upstream_request.json @@ -0,0 +1,403 @@ +{ + "instructions": "REDACTED", + "input": [ + { + "role": "user", + "content": [ + { + "type": "input_text", + "text": "REDACTED" + } + ] + }, + { + "role": "user", + "content": [ + { + "type": "input_text", + "text": "REDACTED" + } + ] + } + ], + "model": "gpt-5", + "tools": [ + { + "type": "function", + "name": "REDACTED", + "description": "REDACTED", + "parameters": { + "type": "object", + "properties": { + "explanation": { + "type": "string", + "description": "REDACTED" + }, + "query": { + "type": "string", + "description": "REDACTED" + }, + "target_directories": { + "type": "array", + "items": { + "type": "string" + }, + "description": "REDACTED" + }, + "search_only_prs": { + "type": "boolean", + "description": "REDACTED" + } + }, + "required": [ + "explanation", + "query", + "target_directories" + ] + }, + "strict": false + }, + { + "type": "function", + "name": "REDACTED", + "description": "REDACTED", + "parameters": { + "type": "object", + "properties": { + "command": { + "type": "string", + "description": "REDACTED" + }, + "is_background": { + "type": "boolean", + "description": "REDACTED" + }, + "explanation": { + "type": "string", + "description": "REDACTED" + } + }, + "required": [ + "command", + "is_background" + ] + }, + "strict": false + }, + { + "type": "function", + "name": "REDACTED", + "description": "REDACTED", + "parameters": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "REDACTED" + }, + "path": { + "type": "string", + "description": "REDACTED" + }, + "glob": { + "type": "string", + "description": "REDACTED" + }, + "output_mode": { + "type": "string", + "description": "REDACTED", + "enum": [ + "content", + "files_with_matches", + "count" + ] + }, + "-B": { + "type": "number", + "description": "REDACTED" + }, + "-A": { + "type": "number", + "description": "REDACTED" + }, + "-C": { + "type": "number", + "description": "REDACTED" + }, + "-i": { + "type": "boolean", + "description": "REDACTED" + }, + "type": { + "type": "string", + "description": "REDACTED" + }, + "head_limit": { + "type": "number", + "description": "REDACTED" + }, + "multiline": { + "type": "boolean", + "description": "REDACTED" + } + }, + "required": [ + "pattern" + ] + }, + "strict": false + }, + { + "type": "function", + "name": "REDACTED", + "description": "REDACTED", + "parameters": { + "type": "object", + "properties": { + "target_file": { + "type": "string", + "description": "REDACTED" + }, + "explanation": { + "type": "string", + "description": "REDACTED" + } + }, + "required": [ + "target_file" + ] + }, + "strict": false + }, + { + "type": "function", + "name": "REDACTED", + "description": "REDACTED", + "parameters": { + "type": "object", + "properties": { + "paths": { + "description": "REDACTED", + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [] + }, + "strict": false + }, + { + "type": "function", + "name": "REDACTED", + "description": "REDACTED", + "parameters": { + "type": "object", + "properties": { + "target_notebook": { + "type": "string", + "description": "REDACTED" + }, + "cell_idx": { + "type": "number", + "description": "REDACTED" + }, + "is_new_cell": { + "type": "boolean", + "description": "REDACTED" + }, + "cell_language": { + "type": "string", + "description": "REDACTED" + }, + "old_string": { + "type": "string", + "description": "REDACTED" + }, + "new_string": { + "type": "string", + "description": "REDACTED" + } + }, + "required": [ + "target_notebook", + "cell_idx", + "is_new_cell", + "cell_language", + "old_string", + "new_string" + ] + }, + "strict": false + }, + { + "type": "function", + "name": "REDACTED", + "description": "REDACTED", + "parameters": { + "type": "object", + "properties": { + "merge": { + "type": "boolean", + "description": "REDACTED" + }, + "todos": { + "type": "array", + "description": "REDACTED", + "items": { + "type": "object", + "properties": { + "content": { + "type": "string", + "description": "REDACTED" + }, + "status": { + "type": "string", + "enum": [ + "pending", + "in_progress", + "completed", + "cancelled" + ], + "description": "REDACTED" + }, + "id": { + "type": "string", + "description": "REDACTED" + } + }, + "required": [ + "content", + "status", + "id" + ] + }, + "minItems": 2 + } + }, + "required": [ + "merge", + "todos" + ] + }, + "strict": false + }, + { + "type": "function", + "name": "REDACTED", + "description": "REDACTED", + "parameters": { + "type": "object", + "properties": { + "target_file": { + "type": "string", + "description": "REDACTED" + }, + "instructions": { + "type": "string", + "description": "REDACTED" + }, + "code_edit": { + "type": "string", + "description": "REDACTED" + } + }, + "required": [ + "target_file", + "instructions", + "code_edit" + ] + }, + "strict": false + }, + { + "type": "function", + "name": "REDACTED", + "description": "REDACTED", + "parameters": { + "type": "object", + "properties": { + "target_file": { + "type": "string", + "description": "REDACTED" + }, + "offset": { + "type": "integer", + "description": "REDACTED" + }, + "limit": { + "type": "integer", + "description": "REDACTED" + } + }, + "required": [ + "target_file" + ] + }, + "strict": false + }, + { + "type": "function", + "name": "REDACTED", + "description": "REDACTED", + "parameters": { + "type": "object", + "properties": { + "target_directory": { + "type": "string", + "description": "REDACTED" + }, + "ignore_globs": { + "type": "array", + "items": { + "type": "string" + }, + "description": "REDACTED" + } + }, + "required": [ + "target_directory" + ] + }, + "strict": false + }, + { + "type": "function", + "name": "REDACTED", + "description": "REDACTED", + "parameters": { + "type": "object", + "properties": { + "target_directory": { + "type": "string", + "description": "REDACTED" + }, + "glob_pattern": { + "type": "string", + "description": "REDACTED" + } + }, + "required": [ + "glob_pattern" + ] + }, + "strict": false + } + ], + "tool_choice": "auto", + "prompt_cache_key": "REDACTED", + "stream": true, + "reasoning": { + "effort": "minimal", + "summary": "detailed" + }, + "text": { + "verbosity": "high" + }, + "store": false, + "stream_options": { + "include_obfuscation": false + }, + "truncation": "auto" +} \ No newline at end of file diff --git a/tests/recordings/verbosity_level/upstream_response.sse b/tests/recordings/verbosity_level/upstream_response.sse new file mode 100644 index 0000000..cf68c4c --- /dev/null +++ b/tests/recordings/verbosity_level/upstream_response.sse @@ -0,0 +1,234 @@ +event: response.created +data: {"type":"response.created","sequence_number":0,"response":{"id":"resp_68d2bebfb8c08197b0afbe4bc582e1ee0bc73c1b7c8f273d","object":"response","created_at":1758641855,"status":"in_progress","background":false,"content_filters":null,"error":null,"incomplete_details":null,"instructions":"REDACTED","max_output_tokens":null,"max_tool_calls":null,"model":"gpt-5","output":[],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":"REDACTED","reasoning":{"effort":"minimal","summary":"detailed"},"safety_identifier":null,"service_tier":"auto","store":false,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[{"type":"function","description":"REDACTED","name":"REDACTED","parameters":{"type":"object","properties":{"explanation":{"type":"string","description":"REDACTED"},"query":{"type":"string","description":"REDACTED"},"target_directories":{"type":"array","items":{"type":"string"},"description":"REDACTED"},"search_only_prs":{"type":"boolean","description":"REDACTED"}},"required":["explanation","query","target_directories"]},"strict":false},{"type":"function","description":"REDACTED","name":"REDACTED","parameters":{"type":"object","properties":{"command":{"type":"string","description":"REDACTED"},"is_background":{"type":"boolean","description":"REDACTED"},"explanation":{"type":"string","description":"REDACTED"}},"required":["command","is_background"]},"strict":false},{"type":"function","description":"REDACTED","name":"REDACTED","parameters":{"type":"object","properties":{"pattern":{"type":"string","description":"REDACTED"},"path":{"type":"string","description":"REDACTED"},"glob":{"type":"string","description":"REDACTED"},"output_mode":{"type":"string","description":"REDACTED","enum":["content","files_with_matches","count"]},"-B":{"type":"number","description":"REDACTED"},"-A":{"type":"number","description":"REDACTED"},"-C":{"type":"number","description":"REDACTED"},"-i":{"type":"boolean","description":"REDACTED"},"type":{"type":"string","description":"REDACTED"},"head_limit":{"type":"number","description":"REDACTED"},"multiline":{"type":"boolean","description":"REDACTED"}},"required":["pattern"]},"strict":false},{"type":"function","description":"REDACTED","name":"REDACTED","parameters":{"type":"object","properties":{"target_file":{"type":"string","description":"REDACTED"},"explanation":{"type":"string","description":"REDACTED"}},"required":["target_file"]},"strict":false},{"type":"function","description":"REDACTED","name":"REDACTED","parameters":{"type":"object","properties":{"paths":{"description":"REDACTED","type":"array","items":{"type":"string"}}},"required":[]},"strict":false},{"type":"function","description":"REDACTED","name":"REDACTED","parameters":{"type":"object","properties":{"target_notebook":{"type":"string","description":"REDACTED"},"cell_idx":{"type":"number","description":"REDACTED"},"is_new_cell":{"type":"boolean","description":"REDACTED"},"cell_language":{"type":"string","description":"REDACTED"},"old_string":{"type":"string","description":"REDACTED"},"new_string":{"type":"string","description":"REDACTED"}},"required":["target_notebook","cell_idx","is_new_cell","cell_language","old_string","new_string"]},"strict":false},{"type":"function","description":"REDACTED","name":"REDACTED","parameters":{"type":"object","properties":{"merge":{"type":"boolean","description":"REDACTED"},"todos":{"type":"array","description":"REDACTED","items":{"type":"object","properties":{"content":{"type":"string","description":"REDACTED"},"status":{"type":"string","enum":["pending","in_progress","completed","cancelled"],"description":"REDACTED"},"id":{"type":"string","description":"REDACTED"}},"required":["content","status","id"]},"minItems":2}},"required":["merge","todos"]},"strict":false},{"type":"function","description":"REDACTED","name":"REDACTED","parameters":{"type":"object","properties":{"target_file":{"type":"string","description":"REDACTED"},"instructions":{"type":"string","description":"REDACTED"},"code_edit":{"type":"string","description":"REDACTED"}},"required":["target_file","instructions","code_edit"]},"strict":false},{"type":"function","description":"REDACTED","name":"REDACTED","parameters":{"type":"object","properties":{"target_file":{"type":"string","description":"REDACTED"},"offset":{"type":"integer","description":"REDACTED"},"limit":{"type":"integer","description":"REDACTED"}},"required":["target_file"]},"strict":false},{"type":"function","description":"REDACTED","name":"REDACTED","parameters":{"type":"object","properties":{"target_directory":{"type":"string","description":"REDACTED"},"ignore_globs":{"type":"array","items":{"type":"string"},"description":"REDACTED"}},"required":["target_directory"]},"strict":false},{"type":"function","description":"REDACTED","name":"REDACTED","parameters":{"type":"object","properties":{"target_directory":{"type":"string","description":"REDACTED"},"glob_pattern":{"type":"string","description":"REDACTED"}},"required":["glob_pattern"]},"strict":false}],"top_p":1.0,"truncation":"auto","usage":null,"user":null,"metadata":{}}} + +event: response.in_progress +data: {"type":"response.in_progress","sequence_number":1,"response":{"id":"resp_68d2bebfb8c08197b0afbe4bc582e1ee0bc73c1b7c8f273d","object":"response","created_at":1758641855,"status":"in_progress","background":false,"content_filters":null,"error":null,"incomplete_details":null,"instructions":"REDACTED","max_output_tokens":null,"max_tool_calls":null,"model":"gpt-5","output":[],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":"REDACTED","reasoning":{"effort":"minimal","summary":"detailed"},"safety_identifier":null,"service_tier":"auto","store":false,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[{"type":"function","description":"REDACTED","name":"REDACTED","parameters":{"type":"object","properties":{"explanation":{"type":"string","description":"REDACTED"},"query":{"type":"string","description":"REDACTED"},"target_directories":{"type":"array","items":{"type":"string"},"description":"REDACTED"},"search_only_prs":{"type":"boolean","description":"REDACTED"}},"required":["explanation","query","target_directories"]},"strict":false},{"type":"function","description":"REDACTED","name":"REDACTED","parameters":{"type":"object","properties":{"command":{"type":"string","description":"REDACTED"},"is_background":{"type":"boolean","description":"REDACTED"},"explanation":{"type":"string","description":"REDACTED"}},"required":["command","is_background"]},"strict":false},{"type":"function","description":"REDACTED","name":"REDACTED","parameters":{"type":"object","properties":{"pattern":{"type":"string","description":"REDACTED"},"path":{"type":"string","description":"REDACTED"},"glob":{"type":"string","description":"REDACTED"},"output_mode":{"type":"string","description":"REDACTED","enum":["content","files_with_matches","count"]},"-B":{"type":"number","description":"REDACTED"},"-A":{"type":"number","description":"REDACTED"},"-C":{"type":"number","description":"REDACTED"},"-i":{"type":"boolean","description":"REDACTED"},"type":{"type":"string","description":"REDACTED"},"head_limit":{"type":"number","description":"REDACTED"},"multiline":{"type":"boolean","description":"REDACTED"}},"required":["pattern"]},"strict":false},{"type":"function","description":"REDACTED","name":"REDACTED","parameters":{"type":"object","properties":{"target_file":{"type":"string","description":"REDACTED"},"explanation":{"type":"string","description":"REDACTED"}},"required":["target_file"]},"strict":false},{"type":"function","description":"REDACTED","name":"REDACTED","parameters":{"type":"object","properties":{"paths":{"description":"REDACTED","type":"array","items":{"type":"string"}}},"required":[]},"strict":false},{"type":"function","description":"REDACTED","name":"REDACTED","parameters":{"type":"object","properties":{"target_notebook":{"type":"string","description":"REDACTED"},"cell_idx":{"type":"number","description":"REDACTED"},"is_new_cell":{"type":"boolean","description":"REDACTED"},"cell_language":{"type":"string","description":"REDACTED"},"old_string":{"type":"string","description":"REDACTED"},"new_string":{"type":"string","description":"REDACTED"}},"required":["target_notebook","cell_idx","is_new_cell","cell_language","old_string","new_string"]},"strict":false},{"type":"function","description":"REDACTED","name":"REDACTED","parameters":{"type":"object","properties":{"merge":{"type":"boolean","description":"REDACTED"},"todos":{"type":"array","description":"REDACTED","items":{"type":"object","properties":{"content":{"type":"string","description":"REDACTED"},"status":{"type":"string","enum":["pending","in_progress","completed","cancelled"],"description":"REDACTED"},"id":{"type":"string","description":"REDACTED"}},"required":["content","status","id"]},"minItems":2}},"required":["merge","todos"]},"strict":false},{"type":"function","description":"REDACTED","name":"REDACTED","parameters":{"type":"object","properties":{"target_file":{"type":"string","description":"REDACTED"},"instructions":{"type":"string","description":"REDACTED"},"code_edit":{"type":"string","description":"REDACTED"}},"required":["target_file","instructions","code_edit"]},"strict":false},{"type":"function","description":"REDACTED","name":"REDACTED","parameters":{"type":"object","properties":{"target_file":{"type":"string","description":"REDACTED"},"offset":{"type":"integer","description":"REDACTED"},"limit":{"type":"integer","description":"REDACTED"}},"required":["target_file"]},"strict":false},{"type":"function","description":"REDACTED","name":"REDACTED","parameters":{"type":"object","properties":{"target_directory":{"type":"string","description":"REDACTED"},"ignore_globs":{"type":"array","items":{"type":"string"},"description":"REDACTED"}},"required":["target_directory"]},"strict":false},{"type":"function","description":"REDACTED","name":"REDACTED","parameters":{"type":"object","properties":{"target_directory":{"type":"string","description":"REDACTED"},"glob_pattern":{"type":"string","description":"REDACTED"}},"required":["glob_pattern"]},"strict":false}],"top_p":1.0,"truncation":"auto","usage":null,"user":null,"metadata":{}}} + +event: response.output_item.added +data: {"type":"response.output_item.added","sequence_number":2,"output_index":0,"item":{"id":"rs_68d2bec0ceb48197aed2a85c3c3ee5d80bc73c1b7c8f273d","type":"reasoning","summary":[]}} + +event: response.output_item.done +data: {"type":"response.output_item.done","sequence_number":3,"output_index":0,"item":{"id":"rs_68d2bec0ceb48197aed2a85c3c3ee5d80bc73c1b7c8f273d","type":"reasoning","summary":[]}} + +event: response.output_item.added +data: {"type":"response.output_item.added","sequence_number":4,"output_index":1,"item":{"id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","type":"message","status":"in_progress","content":[],"role":"assistant"}} + +event: response.content_part.added +data: {"type":"response.content_part.added","sequence_number":5,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"part":{"type":"output_text","annotations":[],"text":""}} + +event: response.output_text.delta +data: {"type":"response.output_text.delta","sequence_number":6,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"delta":"Hey"} + +event: response.output_text.delta +data: {"type":"response.output_text.delta","sequence_number":7,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"delta":"!"} + +event: response.output_text.delta +data: {"type":"response.output_text.delta","sequence_number":8,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"delta":" I"} + +event: response.output_text.delta +data: {"type":"response.output_text.delta","sequence_number":9,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"delta":"’m"} + +event: response.output_text.delta +data: {"type":"response.output_text.delta","sequence_number":10,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"delta":" here"} + +event: response.output_text.delta +data: {"type":"response.output_text.delta","sequence_number":11,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"delta":" and"} + +event: response.output_text.delta +data: {"type":"response.output_text.delta","sequence_number":12,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"delta":" ready"} + +event: response.output_text.delta +data: {"type":"response.output_text.delta","sequence_number":13,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"delta":" to"} + +event: response.output_text.delta +data: {"type":"response.output_text.delta","sequence_number":14,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"delta":" help"} + +event: response.output_text.delta +data: {"type":"response.output_text.delta","sequence_number":15,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"delta":"."} + +event: response.output_text.delta +data: {"type":"response.output_text.delta","sequence_number":16,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"delta":" How"} + +event: response.output_text.delta +data: {"type":"response.output_text.delta","sequence_number":17,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"delta":"’s"} + +event: response.output_text.delta +data: {"type":"response.output_text.delta","sequence_number":18,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"delta":" your"} + +event: response.output_text.delta +data: {"type":"response.output_text.delta","sequence_number":19,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"delta":" project"} + +event: response.output_text.delta +data: {"type":"response.output_text.delta","sequence_number":20,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"delta":" going"} + +event: response.output_text.delta +data: {"type":"response.output_text.delta","sequence_number":21,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"delta":"?"} + +event: response.output_text.delta +data: {"type":"response.output_text.delta","sequence_number":22,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"delta":" Do"} + +event: response.output_text.delta +data: {"type":"response.output_text.delta","sequence_number":23,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"delta":" you"} + +event: response.output_text.delta +data: {"type":"response.output_text.delta","sequence_number":24,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"delta":" want"} + +event: response.output_text.delta +data: {"type":"response.output_text.delta","sequence_number":25,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"delta":" me"} + +event: response.output_text.delta +data: {"type":"response.output_text.delta","sequence_number":26,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"delta":" to"} + +event: response.output_text.delta +data: {"type":"response.output_text.delta","sequence_number":27,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"delta":" pick"} + +event: response.output_text.delta +data: {"type":"response.output_text.delta","sequence_number":28,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"delta":" up"} + +event: response.output_text.delta +data: {"type":"response.output_text.delta","sequence_number":29,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"delta":" anything"} + +event: response.output_text.delta +data: {"type":"response.output_text.delta","sequence_number":30,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"delta":" specific"} + +event: response.output_text.delta +data: {"type":"response.output_text.delta","sequence_number":31,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"delta":" in"} + +event: response.output_text.delta +data: {"type":"response.output_text.delta","sequence_number":32,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"delta":" your"} + +event: response.output_text.delta +data: {"type":"response.output_text.delta","sequence_number":33,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"delta":" repo"} + +event: response.output_text.delta +data: {"type":"response.output_text.delta","sequence_number":34,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"delta":","} + +event: response.output_text.delta +data: {"type":"response.output_text.delta","sequence_number":35,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"delta":" run"} + +event: response.output_text.delta +data: {"type":"response.output_text.delta","sequence_number":36,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"delta":" tests"} + +event: response.output_text.delta +data: {"type":"response.output_text.delta","sequence_number":37,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"delta":","} + +event: response.output_text.delta +data: {"type":"response.output_text.delta","sequence_number":38,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"delta":" or"} + +event: response.output_text.delta +data: {"type":"response.output_text.delta","sequence_number":39,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"delta":" review"} + +event: response.output_text.delta +data: {"type":"response.output_text.delta","sequence_number":40,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"delta":" recent"} + +event: response.output_text.delta +data: {"type":"response.output_text.delta","sequence_number":41,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"delta":" changes"} + +event: response.output_text.delta +data: {"type":"response.output_text.delta","sequence_number":42,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"delta":"?"} + +event: response.output_text.delta +data: {"type":"response.output_text.delta","sequence_number":43,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"delta":" If"} + +event: response.output_text.delta +data: {"type":"response.output_text.delta","sequence_number":44,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"delta":" you"} + +event: response.output_text.delta +data: {"type":"response.output_text.delta","sequence_number":45,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"delta":"’re"} + +event: response.output_text.delta +data: {"type":"response.output_text.delta","sequence_number":46,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"delta":" working"} + +event: response.output_text.delta +data: {"type":"response.output_text.delta","sequence_number":47,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"delta":" on"} + +event: response.output_text.delta +data: {"type":"response.output_text.delta","sequence_number":48,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"delta":" the"} + +event: response.output_text.delta +data: {"type":"response.output_text.delta","sequence_number":49,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"delta":" “"} + +event: response.output_text.delta +data: {"type":"response.output_text.delta","sequence_number":50,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"delta":"add"} + +event: response.output_text.delta +data: {"type":"response.output_text.delta","sequence_number":51,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"delta":" support"} + +event: response.output_text.delta +data: {"type":"response.output_text.delta","sequence_number":52,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"delta":" for"} + +event: response.output_text.delta +data: {"type":"response.output_text.delta","sequence_number":53,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"delta":" verbosity"} + +event: response.output_text.delta +data: {"type":"response.output_text.delta","sequence_number":54,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"delta":"”"} + +event: response.output_text.delta +data: {"type":"response.output_text.delta","sequence_number":55,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"delta":" branch"} + +event: response.output_text.delta +data: {"type":"response.output_text.delta","sequence_number":56,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"delta":","} + +event: response.output_text.delta +data: {"type":"response.output_text.delta","sequence_number":57,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"delta":" I"} + +event: response.output_text.delta +data: {"type":"response.output_text.delta","sequence_number":58,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"delta":" can"} + +event: response.output_text.delta +data: {"type":"response.output_text.delta","sequence_number":59,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"delta":" check"} + +event: response.output_text.delta +data: {"type":"response.output_text.delta","sequence_number":60,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"delta":" the"} + +event: response.output_text.delta +data: {"type":"response.output_text.delta","sequence_number":61,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"delta":" adapters"} + +event: response.output_text.delta +data: {"type":"response.output_text.delta","sequence_number":62,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"delta":" and"} + +event: response.output_text.delta +data: {"type":"response.output_text.delta","sequence_number":63,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"delta":" tests"} + +event: response.output_text.delta +data: {"type":"response.output_text.delta","sequence_number":64,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"delta":" around"} + +event: response.output_text.delta +data: {"type":"response.output_text.delta","sequence_number":65,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"delta":" the"} + +event: response.output_text.delta +data: {"type":"response.output_text.delta","sequence_number":66,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"delta":" verbosity"} + +event: response.output_text.delta +data: {"type":"response.output_text.delta","sequence_number":67,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"delta":" recordings"} + +event: response.output_text.delta +data: {"type":"response.output_text.delta","sequence_number":68,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"delta":" and"} + +event: response.output_text.delta +data: {"type":"response.output_text.delta","sequence_number":69,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"delta":" make"} + +event: response.output_text.delta +data: {"type":"response.output_text.delta","sequence_number":70,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"delta":" sure"} + +event: response.output_text.delta +data: {"type":"response.output_text.delta","sequence_number":71,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"delta":" everything"} + +event: response.output_text.delta +data: {"type":"response.output_text.delta","sequence_number":72,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"delta":" passes"} + +event: response.output_text.delta +data: {"type":"response.output_text.delta","sequence_number":73,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"delta":"."} + +event: response.output_text.done +data: {"type":"response.output_text.done","sequence_number":74,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"text":"REDACTED"} + +event: response.content_part.done +data: {"type":"response.content_part.done","sequence_number":75,"item_id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","output_index":1,"content_index":0,"part":{"type":"output_text","annotations":[],"text":"REDACTED"}} + +event: response.output_item.done +data: {"type":"response.output_item.done","sequence_number":76,"output_index":1,"item":{"id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","type":"message","status":"completed","content":[{"type":"output_text","annotations":[],"text":"REDACTED"}],"role":"assistant"}} + +event: response.completed +data: {"type":"response.completed","sequence_number":77,"response":{"id":"resp_68d2bebfb8c08197b0afbe4bc582e1ee0bc73c1b7c8f273d","object":"response","created_at":1758641855,"status":"completed","background":false,"content_filters":null,"error":null,"incomplete_details":null,"instructions":"REDACTED","max_output_tokens":null,"max_tool_calls":null,"model":"gpt-5","output":[{"id":"rs_68d2bec0ceb48197aed2a85c3c3ee5d80bc73c1b7c8f273d","type":"reasoning","summary":[]},{"id":"msg_68d2bec106948197b3f5d655b909a84c0bc73c1b7c8f273d","type":"message","status":"completed","content":[{"type":"output_text","annotations":[],"text":"REDACTED"}],"role":"assistant"}],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":"REDACTED","reasoning":{"effort":"minimal","summary":"detailed"},"safety_identifier":null,"service_tier":"default","store":false,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[{"type":"function","description":"REDACTED","name":"REDACTED","parameters":{"type":"object","properties":{"explanation":{"type":"string","description":"REDACTED"},"query":{"type":"string","description":"REDACTED"},"target_directories":{"type":"array","items":{"type":"string"},"description":"REDACTED"},"search_only_prs":{"type":"boolean","description":"REDACTED"}},"required":["explanation","query","target_directories"]},"strict":false},{"type":"function","description":"REDACTED","name":"REDACTED","parameters":{"type":"object","properties":{"command":{"type":"string","description":"REDACTED"},"is_background":{"type":"boolean","description":"REDACTED"},"explanation":{"type":"string","description":"REDACTED"}},"required":["command","is_background"]},"strict":false},{"type":"function","description":"REDACTED","name":"REDACTED","parameters":{"type":"object","properties":{"pattern":{"type":"string","description":"REDACTED"},"path":{"type":"string","description":"REDACTED"},"glob":{"type":"string","description":"REDACTED"},"output_mode":{"type":"string","description":"REDACTED","enum":["content","files_with_matches","count"]},"-B":{"type":"number","description":"REDACTED"},"-A":{"type":"number","description":"REDACTED"},"-C":{"type":"number","description":"REDACTED"},"-i":{"type":"boolean","description":"REDACTED"},"type":{"type":"string","description":"REDACTED"},"head_limit":{"type":"number","description":"REDACTED"},"multiline":{"type":"boolean","description":"REDACTED"}},"required":["pattern"]},"strict":false},{"type":"function","description":"REDACTED","name":"REDACTED","parameters":{"type":"object","properties":{"target_file":{"type":"string","description":"REDACTED"},"explanation":{"type":"string","description":"REDACTED"}},"required":["target_file"]},"strict":false},{"type":"function","description":"REDACTED","name":"REDACTED","parameters":{"type":"object","properties":{"paths":{"description":"REDACTED","type":"array","items":{"type":"string"}}},"required":[]},"strict":false},{"type":"function","description":"REDACTED","name":"REDACTED","parameters":{"type":"object","properties":{"target_notebook":{"type":"string","description":"REDACTED"},"cell_idx":{"type":"number","description":"REDACTED"},"is_new_cell":{"type":"boolean","description":"REDACTED"},"cell_language":{"type":"string","description":"REDACTED"},"old_string":{"type":"string","description":"REDACTED"},"new_string":{"type":"string","description":"REDACTED"}},"required":["target_notebook","cell_idx","is_new_cell","cell_language","old_string","new_string"]},"strict":false},{"type":"function","description":"REDACTED","name":"REDACTED","parameters":{"type":"object","properties":{"merge":{"type":"boolean","description":"REDACTED"},"todos":{"type":"array","description":"REDACTED","items":{"type":"object","properties":{"content":{"type":"string","description":"REDACTED"},"status":{"type":"string","enum":["pending","in_progress","completed","cancelled"],"description":"REDACTED"},"id":{"type":"string","description":"REDACTED"}},"required":["content","status","id"]},"minItems":2}},"required":["merge","todos"]},"strict":false},{"type":"function","description":"REDACTED","name":"REDACTED","parameters":{"type":"object","properties":{"target_file":{"type":"string","description":"REDACTED"},"instructions":{"type":"string","description":"REDACTED"},"code_edit":{"type":"string","description":"REDACTED"}},"required":["target_file","instructions","code_edit"]},"strict":false},{"type":"function","description":"REDACTED","name":"REDACTED","parameters":{"type":"object","properties":{"target_file":{"type":"string","description":"REDACTED"},"offset":{"type":"integer","description":"REDACTED"},"limit":{"type":"integer","description":"REDACTED"}},"required":["target_file"]},"strict":false},{"type":"function","description":"REDACTED","name":"REDACTED","parameters":{"type":"object","properties":{"target_directory":{"type":"string","description":"REDACTED"},"ignore_globs":{"type":"array","items":{"type":"string"},"description":"REDACTED"}},"required":["target_directory"]},"strict":false},{"type":"function","description":"REDACTED","name":"REDACTED","parameters":{"type":"object","properties":{"target_directory":{"type":"string","description":"REDACTED"},"glob_pattern":{"type":"string","description":"REDACTED"}},"required":["glob_pattern"]},"strict":false}],"top_p":1.0,"truncation":"auto","usage":{"input_tokens":9639,"input_tokens_details":{"cached_tokens":0},"output_tokens":74,"output_tokens_details":{"reasoning_tokens":0},"total_tokens":9713},"user":null,"metadata":{}}} + diff --git a/tests/settings.py b/tests/settings.py index 06c36b9..46d6910 100644 --- a/tests/settings.py +++ b/tests/settings.py @@ -10,6 +10,7 @@ AZURE_BASE_URL = "https://test-resource.openai.azure.com" AZURE_API_KEY = "test-api-key" AZURE_DEPLOYMENT = "gpt-5" AZURE_SUMMARY_LEVEL = "detailed" +AZURE_VERBOSITY_LEVEL = "medium" AZURE_TRUNCATION = "auto" RECORD_TRAFFIC = False diff --git a/tests/test_replays.py b/tests/test_replays.py index 661582e..a26ee7f 100644 --- a/tests/test_replays.py +++ b/tests/test_replays.py @@ -40,3 +40,13 @@ class TestReplyWithParallelToolCall(ReplyBase): """Parallel tool calls in the reply.""" recording = "reply_parallel_tool_call" + + +class TestReplyVerbosityLevelHigh(ReplyBase): + """Reply with verbosity level set to high.""" + + def modify_settings(self, app): + """Sets verbosity level to high.""" + app.config["AZURE_VERBOSITY_LEVEL"] = "high" + + recording = "verbosity_level"