mirror of
https://github.com/tiennm99/litellm.git
synced 2026-08-20 08:23:47 +00:00
ResponsesAPIStreamingResponse
This commit is contained in:
@@ -756,3 +756,8 @@ class ResponsesAPIResponse(TypedDict, total=False):
|
||||
truncation: Optional[Literal["auto", "disabled"]]
|
||||
usage: Optional[ResponseUsage]
|
||||
user: Optional[str]
|
||||
|
||||
|
||||
class ResponsesAPIStreamingResponse(TypedDict, total=False):
|
||||
type: str
|
||||
response: ResponsesAPIResponse
|
||||
|
||||
@@ -16,3 +16,16 @@ async def test_basic_openai_responses_api():
|
||||
print("litellm response=", json.dumps(response, indent=4, default=str))
|
||||
|
||||
# validate_responses_api_response()
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_basic_openai_responses_api_streaming():
|
||||
litellm._turn_on_debug()
|
||||
response = await litellm.aresponses(
|
||||
model="gpt-4o",
|
||||
input="Tell me a three sentence bedtime story about a unicorn.",
|
||||
stream=True,
|
||||
)
|
||||
|
||||
for event in response:
|
||||
print("litellm response=", json.dumps(event, indent=4, default=str))
|
||||
|
||||
Reference in New Issue
Block a user