langchain_experimental.agents.agent_toolkits.spark.base.create_spark_dataframe_agent(llm: BaseLLM, df: Any, callback_manager: Optional[BaseCallbackManager] = None, prefix: str = '\nYou are working with a spark dataframe in Python. The name of the dataframe is `df`.\nYou should use the tools below to answer the question posed of you:', suffix: str = '\nThis is the result of `print(df.first())`:\n{df}\n\nBegin!\nQuestion: {input}\n{agent_scratchpad}', input_variables: Optional[List[str]] = None, verbose: bool = False, return_intermediate_steps: bool = False, max_iterations: Optional[int] = 15, max_execution_time: Optional[float] = None, early_stopping_method: str = 'force', agent_executor_kwargs: Optional[Dict[str, Any]] = None, **kwargs: Any) AgentExecutor[source]ยถ

Construct a Spark agent from an LLM and dataframe.

  • llm (BaseLLM) โ€“

  • df (Any) โ€“

  • callback_manager (Optional[BaseCallbackManager]) โ€“

  • prefix (str) โ€“

  • suffix (str) โ€“

  • input_variables (Optional[List[str]]) โ€“

  • verbose (bool) โ€“

  • return_intermediate_steps (bool) โ€“

  • max_iterations (Optional[int]) โ€“

  • max_execution_time (Optional[float]) โ€“

  • early_stopping_method (str) โ€“

  • agent_executor_kwargs (Optional[Dict[str, Any]]) โ€“

  • kwargs (Any) โ€“

Return type


Examples using create_spark_dataframe_agentยถ