Replies: 1 comment
-
The issue you're encountering with the In contrast, the Here is the relevant part of the code that shows the different handling based on the if agent_type == AgentType.ZERO_SHOT_REACT_DESCRIPTION:
if include_df_in_prompt is not None and suffix is not None:
raise ValueError(
"If suffix is specified, include_df_in_prompt should not be."
)
prompt = _get_prompt(
df,
prefix=prefix,
suffix=suffix,
include_df_in_prompt=include_df_in_prompt,
number_of_head_rows=number_of_head_rows,
)
agent: Union[BaseSingleActionAgent, BaseMultiActionAgent] = RunnableAgent(
runnable=create_react_agent(llm, tools, prompt), # type: ignore
input_keys_arg=["input"],
return_keys_arg=["output"],
)
elif agent_type in (AgentType.OPENAI_FUNCTIONS, "openai-tools", "tool-calling"):
prompt = _get_functions_prompt(
df,
prefix=prefix,
suffix=suffix,
include_df_in_prompt=include_df_in_prompt,
number_of_head_rows=number_of_head_rows,
)
if agent_type == AgentType.OPENAI_FUNCTIONS:
runnable = create_openai_functions_agent(
cast(BaseLanguageModel, llm), tools, prompt
)
agent = RunnableAgent(
runnable=runnable,
input_keys_arg=["input"],
return_keys_arg=["output"],
)
else:
if agent_type == "openai-tools":
runnable = create_openai_tools_agent(
cast(BaseLanguageModel, llm), tools, prompt
)
else:
runnable = create_tool_calling_agent(
cast(BaseLanguageModel, llm), tools, prompt
)
agent = RunnableMultiActionAgent(
runnable=runnable,
input_keys_arg=["input"],
return_keys_arg=["output"],
)
else:
raise ValueError(
f"Agent type {agent_type} not supported at the moment. Must be one of "
"'tool-calling', 'openai-tools', 'openai-functions', or "
"'zero-shot-react-description'."
) In the To resolve this issue, ensure that the
This setup ensures that the
|
Beta Was this translation helpful? Give feedback.
-
Checked other resources
Commit to Help
Example Code
Description
The code will run without any errors, but in the logs, the output of the first tool sql_db_list_tables outputs tables that shouldn't exist and so does the next tool sql_db_schema, which returns table columns that don't exist.
The code will work fine if I use the zero_shot_react_description as the agent type.
Why is that? According to the langchain documentation Chatbedrock should be supporting tool calling.
System Info
langchain-0.2.1
Python3.9
Beta Was this translation helpful? Give feedback.
All reactions