Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix some tests
  • Loading branch information
kristapratico committed May 29, 2024
commit 9683ea5f24844385982974164ced6bf1bd9df0eb
2 changes: 1 addition & 1 deletion sdk/openai/azure-openai/tests/test_assistants.py
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ def test_assistants_runs_functions(self, client, api_type, api_version, **kwargs
retrieved_step = client.beta.threads.runs.steps.retrieve(
thread_id=run.thread_id,
run_id=r.id,
step_id=run_steps[0].id
step_id=run_steps.data[0].id
)
assert retrieved_step.id
assert retrieved_step.created_at
Expand Down
6 changes: 2 additions & 4 deletions sdk/openai/azure-openai/tests/test_chat_completions.py
Original file line number Diff line number Diff line change
Expand Up @@ -789,9 +789,8 @@ def test_chat_completion_seed(self, client, api_type, api_version, **kwargs):
]

completion = client.chat.completions.create(messages=messages, seed=42, **kwargs)
assert completion.system_fingerprint
completion = client.chat.completions.create(messages=messages, seed=42, **kwargs)
assert completion.system_fingerprint
if api_type != GPT_4_OPENAI: # bug in openai where system_fingerprint is not always returned
assert completion.system_fingerprint

@configure
@pytest.mark.parametrize("api_type, api_version", [(GPT_4_AZURE, GA), (GPT_4_AZURE, GA), (GPT_4_OPENAI, "v1")])
Expand All @@ -804,7 +803,6 @@ def test_chat_completion_json_response(self, client, api_type, api_version, **kw
completion = client.chat.completions.create(messages=messages, response_format={ "type": "json_object" }, **kwargs)
assert completion.id
assert completion.object == "chat.completion"
assert completion.system_fingerprint
assert completion.model
assert completion.created
assert completion.usage.completion_tokens is not None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -807,9 +807,8 @@ async def test_chat_completion_seed(self, client_async, api_type, api_version, *
]

completion = await client_async.chat.completions.create(messages=messages, seed=42, **kwargs)
assert completion.system_fingerprint
completion = await client_async.chat.completions.create(messages=messages, seed=42, **kwargs)
assert completion.system_fingerprint
if api_type != GPT_4_OPENAI: # bug in openai where system_fingerprint is not always returned
assert completion.system_fingerprint

@configure_async
@pytest.mark.asyncio
Expand All @@ -823,7 +822,6 @@ async def test_chat_completion_json_response(self, client_async, api_type, api_v
completion = await client_async.chat.completions.create(messages=messages, response_format={ "type": "json_object" }, **kwargs)
assert completion.id
assert completion.object == "chat.completion"
assert completion.system_fingerprint
assert completion.model
assert completion.created
assert completion.usage.completion_tokens is not None
Expand Down