mirror of
https://github.com/hwchase17/langchain.git
synced 2026-06-09 18:50:33 +00:00
openai[patch]: default to invoke on o1 stream() (#27983)
This commit is contained in:
@@ -1061,3 +1061,27 @@ def test_prediction_tokens() -> None:
|
||||
]
|
||||
assert output_token_details["accepted_prediction_tokens"] > 0
|
||||
assert output_token_details["rejected_prediction_tokens"] > 0
|
||||
|
||||
|
||||
def test_stream_o1() -> None:
|
||||
list(ChatOpenAI(model="o1-mini").stream("how are you"))
|
||||
|
||||
|
||||
async def test_astream_o1() -> None:
|
||||
async for _ in ChatOpenAI(model="o1-mini").astream("how are you"):
|
||||
pass
|
||||
|
||||
|
||||
class Foo(BaseModel):
|
||||
response: str
|
||||
|
||||
|
||||
def test_stream_response_format() -> None:
|
||||
list(ChatOpenAI(model="gpt-4o-mini").stream("how are ya", response_format=Foo))
|
||||
|
||||
|
||||
async def test_astream_response_format() -> None:
|
||||
async for _ in ChatOpenAI(model="gpt-4o-mini").astream(
|
||||
"how are ya", response_format=Foo
|
||||
):
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user