mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-11 22:04:37 +00:00
x
This commit is contained in:
parent
3e7f7b63e3
commit
808f56b841
@ -12,6 +12,7 @@ from langchain_core.messages import (
|
|||||||
BaseMessage,
|
BaseMessage,
|
||||||
BaseMessageChunk,
|
BaseMessageChunk,
|
||||||
HumanMessage,
|
HumanMessage,
|
||||||
|
MessageLikeRepresentation,
|
||||||
)
|
)
|
||||||
from pydantic import BaseModel
|
from pydantic import BaseModel
|
||||||
from typing_extensions import TypedDict
|
from typing_extensions import TypedDict
|
||||||
@ -525,7 +526,9 @@ def test_image_generation_multi_turn() -> None:
|
|||||||
}
|
}
|
||||||
llm_with_tools = llm.bind_tools([tool])
|
llm_with_tools = llm.bind_tools([tool])
|
||||||
|
|
||||||
chat_history = [{"role": "user", "content": "Make a picture of a fuzzy cat"}]
|
chat_history: list[MessageLikeRepresentation] = [
|
||||||
|
{"role": "user", "content": "Make a picture of a fuzzy cat"}
|
||||||
|
]
|
||||||
ai_message = llm_with_tools.invoke(chat_history)
|
ai_message = llm_with_tools.invoke(chat_history)
|
||||||
_check_response(ai_message)
|
_check_response(ai_message)
|
||||||
tool_output = ai_message.additional_kwargs["tool_outputs"][0]
|
tool_output = ai_message.additional_kwargs["tool_outputs"][0]
|
||||||
|
Loading…
Reference in New Issue
Block a user