Skip to content

Commit

Permalink
x
Browse files Browse the repository at this point in the history
  • Loading branch information
efriis committed Mar 19, 2024
1 parent 767f102 commit be811e1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions libs/partners/openai/langchain_openai/chat_models/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,9 @@ def _convert_message_to_dict(message: BaseMessage) -> dict:
message_dict["role"] = "tool"
message_dict["tool_call_id"] = message.tool_call_id

warnings

# tool message doesn't have name: https://platform.openai.com/docs/api-reference/chat/create#chat-create-messages
del message_dict["name"]
if message_dict["name"] is None:
del message_dict["name"]
else:
raise TypeError(f"Got unknown type {message}")
if "name" in message.additional_kwargs:
Expand Down

0 comments on commit be811e1

Please sign in to comment.