Skip to content

Commit ec3d128

Browse files
add fixture
1 parent edd8a90 commit ec3d128

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

tests/conftest.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1177,6 +1177,30 @@ def streaming_chat_completions_model_response():
11771177
]
11781178

11791179

1180+
@pytest.fixture
1181+
def nonstreaming_chat_completions_model_response():
1182+
return openai.types.chat.ChatCompletion(
1183+
id="chatcmpl-test",
1184+
choices=[
1185+
openai.types.chat.chat_completion.Choice(
1186+
index=0,
1187+
finish_reason="stop",
1188+
message=openai.types.chat.ChatCompletionMessage(
1189+
role="assistant", content="Test response"
1190+
),
1191+
)
1192+
],
1193+
created=1234567890,
1194+
model="gpt-3.5-turbo",
1195+
object="chat.completion",
1196+
usage=openai.types.CompletionUsage(
1197+
prompt_tokens=10,
1198+
completion_tokens=20,
1199+
total_tokens=30,
1200+
),
1201+
)
1202+
1203+
11801204
@pytest.fixture
11811205
def nonstreaming_responses_model_response():
11821206
return openai.types.responses.Response(

0 commit comments

Comments
 (0)