mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 19:24:27 +00:00
ResponsesAPIStreamingResponse
This commit is contained in:
parent
f32968409e
commit
8da714104b
2 changed files with 18 additions and 0 deletions
|
@ -756,3 +756,8 @@ class ResponsesAPIResponse(TypedDict, total=False):
|
||||||
truncation: Optional[Literal["auto", "disabled"]]
|
truncation: Optional[Literal["auto", "disabled"]]
|
||||||
usage: Optional[ResponseUsage]
|
usage: Optional[ResponseUsage]
|
||||||
user: Optional[str]
|
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))
|
print("litellm response=", json.dumps(response, indent=4, default=str))
|
||||||
|
|
||||||
# validate_responses_api_response()
|
# 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))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue