test(test_proxy_custom_logger.py): fix proxy test

This commit is contained in:
Krrish Dholakia 2024-02-27 14:52:45 -08:00
parent d8669dea64
commit 411787963b

View file

@ -274,7 +274,7 @@ def test_chat_completion_stream(client):
print("\n\n decode_data", data) print("\n\n decode_data", data)
# Access the content of choices[0]['message']['content'] # Access the content of choices[0]['message']['content']
content = data["choices"][0]["delta"]["content"] or "" content = data["choices"][0]["delta"].get("content", None) or ""
# Process the content as needed # Process the content as needed
print("Content:", content) print("Content:", content)