File tree Expand file tree Collapse file tree
server-ai-langchain/src/ldai_langchain
server-ai-openai/src/ldai_openai Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -172,12 +172,12 @@ def extract_last_message_content(messages: List[Any]) -> str:
172172 Extract the string content of the last message in a list.
173173
174174 :param messages: List of LangChain message objects
175- :return: String content of the last message, or empty string if none
175+ :return: String content of the last message, or empty string if none or content is not a str
176176 """
177177 if messages :
178178 last = messages [- 1 ]
179- if hasattr (last , 'content' ):
180- return str ( last .content )
179+ if hasattr (last , 'content' ) and isinstance ( last . content , str ) :
180+ return last .content
181181 return ''
182182
183183
Original file line number Diff line number Diff line change @@ -81,9 +81,9 @@ def get_ai_metrics_from_response(response: Any) -> LDAIMetrics:
8181# Tool names that require their own API type in the Chat Completions API.
8282# LD stores all tools as type="function"; these are converted to their correct type.
8383_NATIVE_API_TOOL_NAMES = frozenset ({
84- 'web_search_tool ' ,
84+ 'web_search ' ,
8585 'file_search' ,
86- 'computer_use_preview ' ,
86+ 'tool_search ' ,
8787})
8888
8989
You can’t perform that action at this time.
0 commit comments