@@ -1398,175 +1398,6 @@ def nonstreaming_google_genai_model_response():
13981398 )
13991399
14001400
1401- @pytest .fixture
1402- def streaming_chat_completions_model_responses ():
1403- def inner ():
1404- yield [
1405- openai .types .chat .chat_completion_chunk .ChatCompletionChunk (
1406- id = "chatcmpl-turn-1" ,
1407- object = "chat.completion.chunk" ,
1408- created = 10000000 ,
1409- model = "gpt-3.5-turbo" ,
1410- choices = [
1411- openai .types .chat .chat_completion_chunk .Choice (
1412- index = 0 ,
1413- delta = openai .types .chat .chat_completion_chunk .ChoiceDelta (
1414- role = "assistant"
1415- ),
1416- finish_reason = None ,
1417- ),
1418- ],
1419- ),
1420- openai .types .chat .chat_completion_chunk .ChatCompletionChunk (
1421- id = "chatcmpl-turn-1" ,
1422- object = "chat.completion.chunk" ,
1423- created = 10000000 ,
1424- model = "gpt-3.5-turbo" ,
1425- choices = [
1426- openai .types .chat .chat_completion_chunk .Choice (
1427- index = 0 ,
1428- delta = openai .types .chat .chat_completion_chunk .ChoiceDelta (
1429- tool_calls = [
1430- openai .types .chat .chat_completion_chunk .ChoiceDeltaToolCall (
1431- index = 0 ,
1432- id = "call_BbeyNhCKa6kYLYzrD40NGm3b" ,
1433- type = "function" ,
1434- function = openai .types .chat .chat_completion_chunk .ChoiceDeltaToolCallFunction (
1435- name = "get_word_length" ,
1436- arguments = "" ,
1437- ),
1438- ),
1439- ],
1440- ),
1441- finish_reason = None ,
1442- ),
1443- ],
1444- ),
1445- openai .types .chat .chat_completion_chunk .ChatCompletionChunk (
1446- id = "chatcmpl-turn-1" ,
1447- object = "chat.completion.chunk" ,
1448- created = 10000000 ,
1449- model = "gpt-3.5-turbo" ,
1450- choices = [
1451- openai .types .chat .chat_completion_chunk .Choice (
1452- index = 0 ,
1453- delta = openai .types .chat .chat_completion_chunk .ChoiceDelta (
1454- tool_calls = [
1455- openai .types .chat .chat_completion_chunk .ChoiceDeltaToolCall (
1456- index = 0 ,
1457- function = openai .types .chat .chat_completion_chunk .ChoiceDeltaToolCallFunction (
1458- arguments = '{"word": "eudca"}' ,
1459- ),
1460- ),
1461- ],
1462- ),
1463- finish_reason = None ,
1464- ),
1465- ],
1466- ),
1467- openai .types .chat .chat_completion_chunk .ChatCompletionChunk (
1468- id = "chatcmpl-turn-1" ,
1469- object = "chat.completion.chunk" ,
1470- created = 10000000 ,
1471- model = "gpt-3.5-turbo" ,
1472- choices = [
1473- openai .types .chat .chat_completion_chunk .Choice (
1474- index = 0 ,
1475- delta = openai .types .chat .chat_completion_chunk .ChoiceDelta (
1476- content = "5"
1477- ),
1478- finish_reason = None ,
1479- ),
1480- ],
1481- ),
1482- openai .types .chat .chat_completion_chunk .ChatCompletionChunk (
1483- id = "chatcmpl-turn-1" ,
1484- object = "chat.completion.chunk" ,
1485- created = 10000000 ,
1486- model = "gpt-3.5-turbo" ,
1487- choices = [
1488- openai .types .chat .chat_completion_chunk .Choice (
1489- index = 0 ,
1490- delta = openai .types .chat .chat_completion_chunk .ChoiceDelta (),
1491- finish_reason = "function_call" ,
1492- ),
1493- ],
1494- ),
1495- openai .types .chat .chat_completion_chunk .ChatCompletionChunk (
1496- id = "chatcmpl-turn-1" ,
1497- object = "chat.completion.chunk" ,
1498- created = 10000000 ,
1499- model = "gpt-3.5-turbo" ,
1500- choices = [],
1501- usage = openai .types .chat .chat_completion_chunk .CompletionUsage (
1502- prompt_tokens = 142 ,
1503- completion_tokens = 50 ,
1504- total_tokens = 192 ,
1505- ),
1506- ),
1507- ]
1508-
1509- yield [
1510- openai .types .chat .chat_completion_chunk .ChatCompletionChunk (
1511- id = "chatcmpl-turn-2" ,
1512- object = "chat.completion.chunk" ,
1513- created = 10000000 ,
1514- model = "gpt-3.5-turbo" ,
1515- choices = [
1516- openai .types .chat .chat_completion_chunk .Choice (
1517- index = 0 ,
1518- delta = openai .types .chat .chat_completion_chunk .ChoiceDelta (
1519- role = "assistant"
1520- ),
1521- finish_reason = None ,
1522- ),
1523- ],
1524- ),
1525- openai .types .chat .chat_completion_chunk .ChatCompletionChunk (
1526- id = "chatcmpl-turn-2" ,
1527- object = "chat.completion.chunk" ,
1528- created = 10000000 ,
1529- model = "gpt-3.5-turbo" ,
1530- choices = [
1531- openai .types .chat .chat_completion_chunk .Choice (
1532- index = 0 ,
1533- delta = openai .types .chat .chat_completion_chunk .ChoiceDelta (
1534- content = "The word eudca has 5 letters."
1535- ),
1536- finish_reason = None ,
1537- ),
1538- ],
1539- ),
1540- openai .types .chat .chat_completion_chunk .ChatCompletionChunk (
1541- id = "chatcmpl-turn-2" ,
1542- object = "chat.completion.chunk" ,
1543- created = 10000000 ,
1544- model = "gpt-3.5-turbo" ,
1545- choices = [
1546- openai .types .chat .chat_completion_chunk .Choice (
1547- index = 0 ,
1548- delta = openai .types .chat .chat_completion_chunk .ChoiceDelta (),
1549- finish_reason = "stop" ,
1550- ),
1551- ],
1552- ),
1553- openai .types .chat .chat_completion_chunk .ChatCompletionChunk (
1554- id = "chatcmpl-turn-2" ,
1555- object = "chat.completion.chunk" ,
1556- created = 10000000 ,
1557- model = "gpt-3.5-turbo" ,
1558- choices = [],
1559- usage = openai .types .chat .chat_completion_chunk .CompletionUsage (
1560- prompt_tokens = 89 ,
1561- completion_tokens = 28 ,
1562- total_tokens = 117 ,
1563- ),
1564- ),
1565- ]
1566-
1567- return inner
1568-
1569-
15701401@pytest .fixture
15711402def responses_tool_call_model_responses ():
15721403 def inner (
0 commit comments