docs: add csv use case (#16756)

This commit is contained in:
Bagatur
2024-01-30 09:39:46 -08:00
committed by GitHub
parent 4acd2654a3
commit b0347f3e2b
15 changed files with 1048 additions and 271 deletions

View File

@@ -2,7 +2,7 @@
from __future__ import annotations
import warnings
from typing import TYPE_CHECKING, Any, Dict, List, Literal, Optional, Sequence, Union
from typing import TYPE_CHECKING, Any, Dict, Literal, Optional, Sequence, Union
from langchain_core.messages import AIMessage, SystemMessage
from langchain_core.prompts import BasePromptTemplate, PromptTemplate
@@ -40,7 +40,6 @@ def create_sql_agent(
prefix: Optional[str] = None,
suffix: Optional[str] = None,
format_instructions: Optional[str] = None,
input_variables: Optional[List[str]] = None,
top_k: int = 10,
max_iterations: Optional[int] = 15,
max_execution_time: Optional[float] = None,
@@ -70,9 +69,6 @@ def create_sql_agent(
format_instructions: Formatting instructions to pass to
ZeroShotAgent.create_prompt() when 'agent_type' is
"zero-shot-react-description". Otherwise ignored.
input_variables: DEPRECATED. Input variables to explicitly specify as part of
ZeroShotAgent.create_prompt() when 'agent_type' is
"zero-shot-react-description". Otherwise ignored.
top_k: Number of rows to query for by default.
max_iterations: Passed to AgentExecutor init.
max_execution_time: Passed to AgentExecutor init.
@@ -203,7 +199,10 @@ def create_sql_agent(
)
else:
raise ValueError(f"Agent type {agent_type} not supported at the moment.")
raise ValueError(
f"Agent type {agent_type} not supported at the moment. Must be one of "
"'openai-tools', 'openai-functions', or 'zero-shot-react-description'."
)
return AgentExecutor(
name="SQL Agent Executor",