Does gpt-4o-mini ignore "dict" parameters to tools? #25925
Replies: 2 comments
-
Hey @scottpersinger! I'm here to help you with any questions or issues you have. I'm an AI bot that can assist with bug fixes, answer queries, and guide you on becoming a contributor. Let me know how I can assist you! No, Here is the relevant code snippet: def _call(
self,
prompt: str,
stop: Optional[List[str]] = None,
run_manager: Optional[CallbackManagerForLLMRun] = None,
**kwargs: Any,
) -> str:
...
params = {**self._default_params(), **kwargs}
for token in self.client.generate(prompt, **params):
... This shows that the method does take into account additional parameters passed as Additionally, in the Here is the relevant code snippet: def _generate(
self,
messages: List[BaseMessage],
stop: Optional[List[str]] = None,
run_manager: Optional[CallbackManagerForLLMRun] = None,
**kwargs: Any,
) -> ChatResult:
...
if isinstance(function_call, dict):
forced = True
function_call_name = function_call["name"]
messages.append(AIMessage(content=f"<tool>{function_call_name}</tool>"))
... This further confirms that "dict" parameters are handled appropriately in tool functions [2]. |
Beta Was this translation helpful? Give feedback.
-
No argument - I believe that LangChain itself is doing the right thing. But the dict parameter is in practice being ignored by the model and it fails to generate any tool call that includes the parameter. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Checked other resources
Commit to Help
Example Code
Description
Anyone else notice that gpt-4o-mini seems to be ignoring "dict" typed args to tool functions?
System Info
langchain 0.2.5 Building applications with LLMs thro...
langchain-community 0.2.5 Community contributed LangChain inte...
langchain-core 0.2.26 Building applications with LLMs thro...
langchain-openai 0.1.9 An integration package connecting Op...
Beta Was this translation helpful? Give feedback.
All reactions