Construct a Spark SQL agent from an LLM and tools.
create_spark_sql_agent(
llm: BaseLanguageModel,
toolkit: SparkSQLToolkit,
callback_manager: Optional[BaseCallbackManager] = None,
callbacks: Callbacks = None,
prefix: str = SQL_PREFIX,
suffix: str = SQL_SUFFIX,
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,
early_stopping_method: str = 'force',
verbose: bool = False,
agent_executor_kwargs: Optional[Dict[str, Any]] = None,
**kwargs: Any = {}
) -> AgentExecutor| Name | Type | Description |
|---|---|---|
llm* | BaseLanguageModel | The language model to use. |
toolkit* | SparkSQLToolkit | The Spark SQL toolkit. |
callback_manager | Optional[BaseCallbackManager] | Default: NoneOptional. The callback manager. Default is None. |
callbacks | Callbacks | Default: NoneOptional. The callbacks. Default is None. |
prefix | str | Default: SQL_PREFIXOptional. The prefix for the prompt. Default is SQL_PREFIX. |
suffix | str | Default: SQL_SUFFIXOptional. The suffix for the prompt. Default is SQL_SUFFIX. |
format_instructions | Optional[str] | Default: NoneOptional. The format instructions for the prompt. Default is None. |
input_variables | Optional[List[str]] | Default: NoneOptional. The input variables for the prompt. Default is None. |
top_k | int | Default: 10Optional. The top k for the prompt. Default is 10. |
max_iterations | Optional[int] | Default: 15Optional. The maximum iterations to run. Default is 15. |
max_execution_time | Optional[float] | Default: NoneOptional. The maximum execution time. Default is None. |
early_stopping_method | str | Default: 'force'Optional. The early stopping method. Default is "force". |
verbose | bool | Default: FalseOptional. Whether to print verbose output. Default is False. |
agent_executor_kwargs | Optional[Dict[str, Any]] | Default: NoneOptional. The agent executor kwargs. Default is None. |
kwargs | Any | Default: {}Any. Additional keyword arguments. |