Update CSVAgent.py: handle_parsing_errors and agent_type options
This commit is contained in:
parent
6493d51bac
commit
fec3451d93
1 changed files with 4 additions and 3 deletions
|
|
@ -13,20 +13,21 @@ class CSVAgentComponent(CustomComponent):
|
||||||
return {
|
return {
|
||||||
"llm": {"display_name": "LLM", "type": BaseLanguageModel},
|
"llm": {"display_name": "LLM", "type": BaseLanguageModel},
|
||||||
"path": {"display_name": "Path", "field_type": "file", "suffixes": [".csv"], "file_types": [".csv"]},
|
"path": {"display_name": "Path", "field_type": "file", "suffixes": [".csv"], "file_types": [".csv"]},
|
||||||
"handle_parse_errors": {"display_name": "Handle Parse Errors", "advanced": True},
|
"handle_parsing_errors": {"display_name": "Handle Parse Errors", "advanced": True},
|
||||||
"agent_type": {
|
"agent_type": {
|
||||||
"display_name": "Agent Type",
|
"display_name": "Agent Type",
|
||||||
"options": ["zero-shot-react-description", "openai-functions", "openai-tools"],
|
"options": ["zero-shot-react-description", "openai-functions", "openai-tools"],
|
||||||
|
"advanced": True,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
def build(
|
def build(
|
||||||
self, llm: BaseLanguageModel, path: str, handle_parse_errors: bool = True, agent_type: str = "openai-tools"
|
self, llm: BaseLanguageModel, path: str, handle_parsing_errors: bool = True, agent_type: str = "openai-tools"
|
||||||
) -> AgentExecutor:
|
) -> AgentExecutor:
|
||||||
# Instantiate and return the CSV agent class with the provided llm and path
|
# Instantiate and return the CSV agent class with the provided llm and path
|
||||||
return create_csv_agent(
|
return create_csv_agent(
|
||||||
llm=llm,
|
llm=llm,
|
||||||
path=path,
|
path=path,
|
||||||
agent_type=agent_type,
|
agent_type=agent_type,
|
||||||
agent_executor_kwargs=dict(handle_parse_errors=handle_parse_errors),
|
agent_executor_kwargs=dict(handle_parsing_errors=handle_parsing_errors, verbose=True),
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue