mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-20 01:49:51 +00:00
cr
This commit is contained in:
parent
1460539bd1
commit
3951f90a9e
@ -416,11 +416,7 @@ def _is_builtin_tool(tool: dict) -> bool:
|
|||||||
def _transform_payload_for_responses(payload: dict) -> dict:
|
def _transform_payload_for_responses(payload: dict) -> dict:
|
||||||
updated_payload = payload.copy()
|
updated_payload = payload.copy()
|
||||||
if messages := updated_payload.pop("messages"):
|
if messages := updated_payload.pop("messages"):
|
||||||
last_user_message = next(
|
updated_payload["input"] = messages
|
||||||
(m for m in reversed(messages) if m.get("role") == "user"), None
|
|
||||||
)
|
|
||||||
if last_user_message:
|
|
||||||
updated_payload["input"] = last_user_message["content"]
|
|
||||||
|
|
||||||
return updated_payload
|
return updated_payload
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user