diff --git a/langchain/chat_models/openai.py b/langchain/chat_models/openai.py index e09ac9abf72..0a8d7b84fd3 100644 --- a/langchain/chat_models/openai.py +++ b/langchain/chat_models/openai.py @@ -100,7 +100,9 @@ def _convert_dict_to_message(_dict: Mapping[str, Any]) -> BaseMessage: if role == "user": return HumanMessage(content=_dict["content"]) elif role == "assistant": - content = _dict["content"] or "" # OpenAI returns None for tool invocations + # Fix for azure + # Also OpenAI returns None for tool invocations + content = _dict.get("content", "") if _dict.get("function_call"): additional_kwargs = {"function_call": dict(_dict["function_call"])} else: diff --git a/langchain/vectorstores/base.py b/langchain/vectorstores/base.py index a09ee25759c..73b2710228a 100644 --- a/langchain/vectorstores/base.py +++ b/langchain/vectorstores/base.py @@ -445,7 +445,7 @@ class VectorStoreRetriever(BaseRetriever): search_kwargs: dict = Field(default_factory=dict) allowed_search_types: ClassVar[Collection[str]] = ( "similarity", - "similarity_score_threshold", + "similarityatscore_threshold", "mmr", )