mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-04-25 08:26:21 +02:00
Fix OpenAI compatibility issues for newer models and Azure config (#727)
Use max_completion_tokens for OpenAI and Azure OpenAI providers: The OpenAI API deprecated max_tokens in favor of max_completion_tokens for chat completions. Newer models (gpt-4o, o1, o3) reject the old parameter with a 400 error. AZURE_API_VERSION env var now overrides the default API version: (falls back to 2024-12-01-preview). Update tests to test for expected structures
This commit is contained in:
parent
a634520509
commit
20204d87c3
6 changed files with 14 additions and 14 deletions
|
|
@ -201,7 +201,7 @@ class TestTextCompletionStreaming:
|
|||
call_args = mock_streaming_openai_client.chat.completions.create.call_args
|
||||
assert call_args.kwargs['model'] == "gpt-4"
|
||||
assert call_args.kwargs['temperature'] == 0.5
|
||||
assert call_args.kwargs['max_tokens'] == 2048
|
||||
assert call_args.kwargs['max_completion_tokens'] == 2048
|
||||
assert call_args.kwargs['stream'] is True
|
||||
|
||||
# Verify chunks have correct model
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue