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
get tests passing
  • Loading branch information
kristapratico committed Feb 12, 2024
commit 6dbb52ce03bb67649d34152834dcd6adf0445c3c
Original file line number Diff line number Diff line change
Expand Up @@ -1050,20 +1050,14 @@ def test_chat_completion_vision(self, client, azure_openai_creds, api_type, **kw
}
],
)
assert completion.id
assert completion.object == "chat.completion"
assert completion.model
assert completion.created
assert completion.usage.completion_tokens is not None
assert completion.usage.prompt_tokens is not None
assert completion.usage.total_tokens == completion.usage.completion_tokens + completion.usage.prompt_tokens
assert len(completion.choices) == 1
assert completion.choices[0].index is not None
assert completion.choices[0].message.content is not None
assert completion.choices[0].message.role

@configure
@pytest.mark.parametrize("api_type", [OPENAI, GPT_4_AZURE])
@pytest.mark.parametrize("api_type", [OPENAI])
def test_chat_completion_logprobs(self, client, azure_openai_creds, api_type, **kwargs):
messages = [
{"role": "system", "content": "You are a helpful assistant."},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1072,21 +1072,15 @@ async def test_chat_completion_vision(self, client_async, azure_openai_creds, ap
}
],
)
assert completion.id
assert completion.object == "chat.completion"
assert completion.model
assert completion.created
assert completion.usage.completion_tokens is not None
assert completion.usage.prompt_tokens is not None
assert completion.usage.total_tokens == completion.usage.completion_tokens + completion.usage.prompt_tokens
assert len(completion.choices) == 1
assert completion.choices[0].index is not None
assert completion.choices[0].message.content is not None
assert completion.choices[0].message.role

@configure_async
@pytest.mark.asyncio
@pytest.mark.parametrize("api_type", [OPENAI, GPT_4_AZURE])
@pytest.mark.parametrize("api_type", [OPENAI])
async def test_chat_completion_logprobs(self, client_async, azure_openai_creds, api_type, **kwargs):
messages = [
{"role": "system", "content": "You are a helpful assistant."},
Expand Down