Skip to content

Commit

Permalink
fix: handle unsupported LLM exception message (langflow-ai#4199)
Browse files Browse the repository at this point in the history
* fix: handle unsupported LLM exception message

* Update src/backend/base/langflow/components/agents/ToolCallingAgent.py

Co-authored-by: Gabriel Luiz Freitas Almeida <[email protected]>

* [autofix.ci] apply automated fixes

---------

Co-authored-by: Gabriel Luiz Freitas Almeida <[email protected]>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored and diogocabral committed Nov 26, 2024
1 parent 3ce8419 commit 79a369b
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,8 @@ def create_agent_runnable(self):
("placeholder", "{agent_scratchpad}"),
]
prompt = ChatPromptTemplate.from_messages(messages)
return create_tool_calling_agent(self.llm, self.tools, prompt)
try:
return create_tool_calling_agent(self.llm, self.tools, prompt)
except NotImplementedError as e:
message = f"{self.display_name} does not support tool calling." "Please try using a compatible model."
raise NotImplementedError(message) from e

0 comments on commit 79a369b

Please sign in to comment.