mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-19 09:30:15 +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:
|
||||
updated_payload = payload.copy()
|
||||
if messages := updated_payload.pop("messages"):
|
||||
last_user_message = next(
|
||||
(m for m in reversed(messages) if m.get("role") == "user"), None
|
||||
)
|
||||
if last_user_message:
|
||||
updated_payload["input"] = last_user_message["content"]
|
||||
updated_payload["input"] = messages
|
||||
|
||||
return updated_payload
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user