mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-03 03:59:42 +00:00
docs: fix kwargs docstring (#25010)
Fix: 
This commit is contained in:
@@ -156,7 +156,7 @@ class BaseSingleActionAgent(BaseModel):
|
||||
llm: Language model to use.
|
||||
tools: Tools to use.
|
||||
callback_manager: Callback manager to use.
|
||||
**kwargs: Additional arguments.
|
||||
kwargs: Additional arguments.
|
||||
|
||||
Returns:
|
||||
BaseSingleActionAgent: Agent object.
|
||||
@@ -939,7 +939,7 @@ class Agent(BaseSingleActionAgent):
|
||||
tools: Tools to use.
|
||||
callback_manager: Callback manager to use.
|
||||
output_parser: Output parser to use.
|
||||
**kwargs: Additional arguments.
|
||||
kwargs: Additional arguments.
|
||||
|
||||
Returns:
|
||||
Agent: Agent object.
|
||||
@@ -1110,7 +1110,7 @@ class AgentExecutor(Chain):
|
||||
agent: Agent to use.
|
||||
tools: Tools to use.
|
||||
callbacks: Callbacks to use.
|
||||
**kwargs: Additional arguments.
|
||||
kwargs: Additional arguments.
|
||||
|
||||
Returns:
|
||||
AgentExecutor: Agent executor object.
|
||||
@@ -1741,7 +1741,7 @@ class AgentExecutor(Chain):
|
||||
Args:
|
||||
input: Input to the agent.
|
||||
config: Config to use.
|
||||
**kwargs: Additional arguments.
|
||||
kwargs: Additional arguments.
|
||||
|
||||
Yields:
|
||||
AddableDict: Addable dictionary.
|
||||
@@ -1772,7 +1772,7 @@ class AgentExecutor(Chain):
|
||||
Args:
|
||||
input: Input to the agent.
|
||||
config: Config to use.
|
||||
**kwargs: Additional arguments.
|
||||
kwargs: Additional arguments.
|
||||
|
||||
Yields:
|
||||
AddableDict: Addable dictionary.
|
||||
|
@@ -33,7 +33,7 @@ def create_vectorstore_agent(
|
||||
prefix (str, optional): The prefix prompt for the agent. If not provided uses default PREFIX.
|
||||
verbose (bool, optional): If you want to see the content of the scratchpad. [ Defaults to False ]
|
||||
agent_executor_kwargs (Optional[Dict[str, Any]], optional): If there is any other parameter you want to send to the agent. [ Defaults to None ]
|
||||
**kwargs: Additional named parameters to pass to the ZeroShotAgent.
|
||||
kwargs: Additional named parameters to pass to the ZeroShotAgent.
|
||||
|
||||
Returns:
|
||||
AgentExecutor: Returns a callable AgentExecutor object. Either you can call it or use run method with the query to get the response
|
||||
@@ -74,7 +74,7 @@ def create_vectorstore_router_agent(
|
||||
prefix (str, optional): The prefix prompt for the router agent. If not provided uses default ROUTER_PREFIX.
|
||||
verbose (bool, optional): If you want to see the content of the scratchpad. [ Defaults to False ]
|
||||
agent_executor_kwargs (Optional[Dict[str, Any]], optional): If there is any other parameter you want to send to the agent. [ Defaults to None ]
|
||||
**kwargs: Additional named parameters to pass to the ZeroShotAgent.
|
||||
kwargs: Additional named parameters to pass to the ZeroShotAgent.
|
||||
|
||||
Returns:
|
||||
AgentExecutor: Returns a callable AgentExecutor object. Either you can call it or use run method with the query to get the response.
|
||||
|
@@ -45,7 +45,7 @@ def initialize_agent(
|
||||
agent_kwargs: Additional keyword arguments to pass to the underlying agent.
|
||||
Defaults to None.
|
||||
tags: Tags to apply to the traced runs. Defaults to None.
|
||||
**kwargs: Additional keyword arguments passed to the agent executor.
|
||||
kwargs: Additional keyword arguments passed to the agent executor.
|
||||
|
||||
Returns:
|
||||
An agent executor.
|
||||
|
@@ -44,7 +44,7 @@ def load_agent_from_config(
|
||||
config: Config dict to load agent from.
|
||||
llm: Language model to use as the agent.
|
||||
tools: List of tools this agent has access to.
|
||||
**kwargs: Additional keyword arguments passed to the agent executor.
|
||||
kwargs: Additional keyword arguments passed to the agent executor.
|
||||
|
||||
Returns:
|
||||
An agent executor.
|
||||
@@ -98,7 +98,7 @@ def load_agent(
|
||||
|
||||
Args:
|
||||
path: Path to the agent file.
|
||||
**kwargs: Additional keyword arguments passed to the agent executor.
|
||||
kwargs: Additional keyword arguments passed to the agent executor.
|
||||
|
||||
Returns:
|
||||
An agent executor.
|
||||
|
@@ -128,7 +128,7 @@ class ZeroShotAgent(Agent):
|
||||
format_instructions: The format instructions to use.
|
||||
Defaults to FORMAT_INSTRUCTIONS.
|
||||
input_variables: The input variables to use. Defaults to None.
|
||||
**kwargs: Additional parameters to pass to the agent.
|
||||
kwargs: Additional parameters to pass to the agent.
|
||||
"""
|
||||
cls._validate_tools(tools)
|
||||
prompt = cls.create_prompt(
|
||||
|
@@ -261,7 +261,7 @@ class OpenAIAssistantRunnable(RunnableSerializable[Dict, OutputType]):
|
||||
model: Assistant model to use.
|
||||
client: OpenAI or AzureOpenAI client.
|
||||
Will create a default OpenAI client if not specified.
|
||||
**kwargs: Additional arguments.
|
||||
kwargs: Additional arguments.
|
||||
|
||||
Returns:
|
||||
OpenAIAssistantRunnable configured to run using the created assistant.
|
||||
@@ -418,7 +418,7 @@ class OpenAIAssistantRunnable(RunnableSerializable[Dict, OutputType]):
|
||||
tools: Override Assistant tools for this run.
|
||||
run_metadata: Metadata to associate with new run.
|
||||
config: Runnable config. Defaults to None.
|
||||
**kwargs: Additional arguments.
|
||||
kwargs: Additional arguments.
|
||||
|
||||
Return:
|
||||
If self.as_agent, will return
|
||||
|
@@ -262,7 +262,7 @@ class OpenAIFunctionsAgent(BaseSingleActionAgent):
|
||||
extra_prompt_messages: Extra prompt messages to use. Defaults to None.
|
||||
system_message: The system message to use.
|
||||
Defaults to a default system message.
|
||||
**kwargs: Additional parameters to pass to the agent.
|
||||
kwargs: Additional parameters to pass to the agent.
|
||||
"""
|
||||
prompt = cls.create_prompt(
|
||||
extra_prompt_messages=extra_prompt_messages,
|
||||
|
@@ -307,7 +307,7 @@ class OpenAIMultiFunctionsAgent(BaseMultiActionAgent):
|
||||
extra_prompt_messages: Extra prompt messages to use. Default is None.
|
||||
system_message: The system message to use.
|
||||
Default is a default system message.
|
||||
**kwargs: Additional arguments.
|
||||
kwargs: Additional arguments.
|
||||
"""
|
||||
prompt = cls.create_prompt(
|
||||
extra_prompt_messages=extra_prompt_messages,
|
||||
|
@@ -445,7 +445,7 @@ class ConversationalRetrievalChain(BaseConversationalRetrievalChain):
|
||||
combine_docs_chain_kwargs: Parameters to pass as kwargs to `load_qa_chain`
|
||||
when constructing the combine_docs_chain.
|
||||
callbacks: Callbacks to pass to all subchains.
|
||||
**kwargs: Additional parameters to pass when initializing
|
||||
kwargs: Additional parameters to pass when initializing
|
||||
ConversationalRetrievalChain
|
||||
"""
|
||||
combine_docs_chain_kwargs = combine_docs_chain_kwargs or {}
|
||||
|
@@ -197,7 +197,7 @@ class ElasticsearchDatabaseChain(Chain):
|
||||
answer_prompt: The prompt to use for answering user question given data.
|
||||
query_output_parser: The output parser to use for parsing model-generated
|
||||
ES query. Defaults to SimpleJsonOutputParser.
|
||||
**kwargs: Additional arguments to pass to the constructor.
|
||||
kwargs: Additional arguments to pass to the constructor.
|
||||
"""
|
||||
query_prompt = query_prompt or DSL_PROMPT
|
||||
query_output_parser = query_output_parser or SimpleJsonOutputParser()
|
||||
|
@@ -245,7 +245,7 @@ class FlareChain(Chain):
|
||||
Args:
|
||||
llm: Language model to use.
|
||||
max_generation_len: Maximum length of the generated response.
|
||||
**kwargs: Additional arguments to pass to the constructor.
|
||||
kwargs: Additional arguments to pass to the constructor.
|
||||
|
||||
Returns:
|
||||
FlareChain class with the given language model.
|
||||
|
@@ -217,7 +217,7 @@ def get_query_constructor_prompt(
|
||||
enable_limit: Whether to enable the limit operator. Defaults to False.
|
||||
schema_prompt: Prompt for describing query schema. Should have string input
|
||||
variables allowed_comparators and allowed_operators.
|
||||
**kwargs: Additional named params to pass to FewShotPromptTemplate init.
|
||||
kwargs: Additional named params to pass to FewShotPromptTemplate init.
|
||||
|
||||
Returns:
|
||||
A prompt template that can be used to construct queries.
|
||||
@@ -339,7 +339,7 @@ def load_query_constructor_runnable(
|
||||
variables allowed_comparators and allowed_operators.
|
||||
fix_invalid: Whether to fix invalid filter directives by ignoring invalid
|
||||
operators, comparators and attributes.
|
||||
**kwargs: Additional named params to pass to FewShotPromptTemplate init.
|
||||
kwargs: Additional named params to pass to FewShotPromptTemplate init.
|
||||
|
||||
Returns:
|
||||
A Runnable that can be used to construct queries.
|
||||
|
@@ -224,7 +224,7 @@ def create_structured_output_runnable(
|
||||
structured outputs or a single one. If True and model does not return any
|
||||
structured outputs then chain output is None. If False and model does not
|
||||
return any structured outputs then chain output is an empty list.
|
||||
**kwargs: Additional named arguments.
|
||||
kwargs: Additional named arguments.
|
||||
|
||||
Returns:
|
||||
A runnable sequence that will return a structured output(s) matching the given
|
||||
|
@@ -36,7 +36,7 @@ class JsonSchemaEvaluator(StringEvaluator):
|
||||
"""Initializes the JsonSchemaEvaluator.
|
||||
|
||||
Args:
|
||||
**kwargs: Additional keyword arguments.
|
||||
kwargs: Additional keyword arguments.
|
||||
|
||||
Raises:
|
||||
ImportError: If the jsonschema package is not installed.
|
||||
|
@@ -158,7 +158,7 @@ class StringEvaluator(_EvalArgsMixin, ABC):
|
||||
prediction (str): The LLM or chain prediction to evaluate.
|
||||
reference (Optional[str], optional): The reference label to evaluate against.
|
||||
input (Optional[str], optional): The input to consider during evaluation.
|
||||
**kwargs: Additional keyword arguments, including callbacks, tags, etc.
|
||||
kwargs: Additional keyword arguments, including callbacks, tags, etc.
|
||||
Returns:
|
||||
dict: The evaluation results containing the score or value.
|
||||
It is recommended that the dictionary contain the following keys:
|
||||
@@ -181,7 +181,7 @@ class StringEvaluator(_EvalArgsMixin, ABC):
|
||||
prediction (str): The LLM or chain prediction to evaluate.
|
||||
reference (Optional[str], optional): The reference label to evaluate against.
|
||||
input (Optional[str], optional): The input to consider during evaluation.
|
||||
**kwargs: Additional keyword arguments, including callbacks, tags, etc.
|
||||
kwargs: Additional keyword arguments, including callbacks, tags, etc.
|
||||
Returns:
|
||||
dict: The evaluation results containing the score or value.
|
||||
It is recommended that the dictionary contain the following keys:
|
||||
@@ -212,7 +212,7 @@ class StringEvaluator(_EvalArgsMixin, ABC):
|
||||
prediction (str): The LLM or chain prediction to evaluate.
|
||||
reference (Optional[str], optional): The reference label to evaluate against.
|
||||
input (Optional[str], optional): The input to consider during evaluation.
|
||||
**kwargs: Additional keyword arguments, including callbacks, tags, etc.
|
||||
kwargs: Additional keyword arguments, including callbacks, tags, etc.
|
||||
Returns:
|
||||
dict: The evaluation results containing the score or value.
|
||||
""" # noqa: E501
|
||||
@@ -235,7 +235,7 @@ class StringEvaluator(_EvalArgsMixin, ABC):
|
||||
prediction (str): The LLM or chain prediction to evaluate.
|
||||
reference (Optional[str], optional): The reference label to evaluate against.
|
||||
input (Optional[str], optional): The input to consider during evaluation.
|
||||
**kwargs: Additional keyword arguments, including callbacks, tags, etc.
|
||||
kwargs: Additional keyword arguments, including callbacks, tags, etc.
|
||||
Returns:
|
||||
dict: The evaluation results containing the score or value.
|
||||
""" # noqa: E501
|
||||
@@ -265,7 +265,7 @@ class PairwiseStringEvaluator(_EvalArgsMixin, ABC):
|
||||
prediction_b (str): The output string from the second model.
|
||||
reference (Optional[str], optional): The expected output / reference string.
|
||||
input (Optional[str], optional): The input string.
|
||||
**kwargs: Additional keyword arguments, such as callbacks and optional reference strings.
|
||||
kwargs: Additional keyword arguments, such as callbacks and optional reference strings.
|
||||
Returns:
|
||||
dict: A dictionary containing the preference, scores, and/or other information.
|
||||
""" # noqa: E501
|
||||
@@ -286,7 +286,7 @@ class PairwiseStringEvaluator(_EvalArgsMixin, ABC):
|
||||
prediction_b (str): The output string from the second model.
|
||||
reference (Optional[str], optional): The expected output / reference string.
|
||||
input (Optional[str], optional): The input string.
|
||||
**kwargs: Additional keyword arguments, such as callbacks and optional reference strings.
|
||||
kwargs: Additional keyword arguments, such as callbacks and optional reference strings.
|
||||
Returns:
|
||||
dict: A dictionary containing the preference, scores, and/or other information.
|
||||
""" # noqa: E501
|
||||
@@ -316,7 +316,7 @@ class PairwiseStringEvaluator(_EvalArgsMixin, ABC):
|
||||
prediction_b (str): The output string from the second model.
|
||||
reference (Optional[str], optional): The expected output / reference string.
|
||||
input (Optional[str], optional): The input string.
|
||||
**kwargs: Additional keyword arguments, such as callbacks and optional reference strings.
|
||||
kwargs: Additional keyword arguments, such as callbacks and optional reference strings.
|
||||
Returns:
|
||||
dict: A dictionary containing the preference, scores, and/or other information.
|
||||
""" # noqa: E501
|
||||
@@ -345,7 +345,7 @@ class PairwiseStringEvaluator(_EvalArgsMixin, ABC):
|
||||
prediction_b (str): The output string from the second model.
|
||||
reference (Optional[str], optional): The expected output / reference string.
|
||||
input (Optional[str], optional): The input string.
|
||||
**kwargs: Additional keyword arguments, such as callbacks and optional reference strings.
|
||||
kwargs: Additional keyword arguments, such as callbacks and optional reference strings.
|
||||
Returns:
|
||||
dict: A dictionary containing the preference, scores, and/or other information.
|
||||
""" # noqa: E501
|
||||
|
@@ -278,7 +278,7 @@ class StringDistanceEvalChain(StringEvaluator, _RapidFuzzChainMixin):
|
||||
reference (Optional[str], optional): The reference string.
|
||||
input (Optional[str], optional): The input string.
|
||||
callbacks (Callbacks, optional): The callbacks to use.
|
||||
**kwargs: Additional keyword arguments.
|
||||
kwargs: Additional keyword arguments.
|
||||
|
||||
Returns:
|
||||
dict: The evaluation results containing the score.
|
||||
@@ -314,7 +314,7 @@ class StringDistanceEvalChain(StringEvaluator, _RapidFuzzChainMixin):
|
||||
reference (Optional[str], optional): The reference string.
|
||||
input (Optional[str], optional): The input string.
|
||||
callbacks (Callbacks, optional): The callbacks to use.
|
||||
**kwargs: Additional keyword arguments.
|
||||
kwargs: Additional keyword arguments.
|
||||
|
||||
Returns:
|
||||
dict: The evaluation results containing the score.
|
||||
@@ -412,7 +412,7 @@ class PairwiseStringDistanceEvalChain(PairwiseStringEvaluator, _RapidFuzzChainMi
|
||||
callbacks (Callbacks, optional): The callbacks to use.
|
||||
tags (List[str], optional): Tags to apply to traces.
|
||||
metadata (Dict[str, Any], optional): Metadata to apply to traces.
|
||||
**kwargs: Additional keyword arguments.
|
||||
kwargs: Additional keyword arguments.
|
||||
|
||||
Returns:
|
||||
dict: The evaluation results containing the score.
|
||||
@@ -446,7 +446,7 @@ class PairwiseStringDistanceEvalChain(PairwiseStringEvaluator, _RapidFuzzChainMi
|
||||
callbacks (Callbacks, optional): The callbacks to use.
|
||||
tags (List[str], optional): Tags to apply to traces.
|
||||
metadata (Dict[str, Any], optional): Metadata to apply to traces.
|
||||
**kwargs: Additional keyword arguments.
|
||||
kwargs: Additional keyword arguments.
|
||||
|
||||
Returns:
|
||||
dict: The evaluation results containing the score.
|
||||
|
@@ -104,7 +104,7 @@ class LLMChainFilter(BaseDocumentCompressor):
|
||||
Args:
|
||||
llm: The language model to use for filtering.
|
||||
prompt: The prompt to use for the filter.
|
||||
**kwargs: Additional arguments to pass to the constructor.
|
||||
kwargs: Additional arguments to pass to the constructor.
|
||||
|
||||
Returns:
|
||||
A LLMChainFilter that uses the given language model.
|
||||
|
@@ -105,7 +105,7 @@ class LLMListwiseRerank(BaseDocumentCompressor):
|
||||
llm: The language model to use for filtering. **Must implement
|
||||
BaseLanguageModel.with_structured_output().**
|
||||
prompt: The prompt to use for the filter.
|
||||
**kwargs: Additional arguments to pass to the constructor.
|
||||
kwargs: Additional arguments to pass to the constructor.
|
||||
|
||||
Returns:
|
||||
A LLMListwiseRerank document compressor that uses the given language model.
|
||||
|
Reference in New Issue
Block a user