mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-19 13:23:35 +00:00
docs: fix kwargs docstring (#25010)
Fix: 
This commit is contained in:
parent
57747892ce
commit
e81ddb32a6
@ -38,7 +38,7 @@ def create_json_agent(
|
|||||||
input_variables: The input variables to use. Default is None.
|
input_variables: The input variables to use. Default is None.
|
||||||
verbose: Whether to print verbose output. Default is False.
|
verbose: Whether to print verbose output. Default is False.
|
||||||
agent_executor_kwargs: Optional additional arguments for the agent executor.
|
agent_executor_kwargs: Optional additional arguments for the agent executor.
|
||||||
**kwargs: Additional arguments for the agent.
|
kwargs: Additional arguments for the agent.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
The agent executor.
|
The agent executor.
|
||||||
|
@ -590,7 +590,7 @@ def load_huggingface_tool(
|
|||||||
model_repo_id: Optional model repo id. Defaults to None.
|
model_repo_id: Optional model repo id. Defaults to None.
|
||||||
token: Optional token. Defaults to None.
|
token: Optional token. Defaults to None.
|
||||||
remote: Optional remote. Defaults to False.
|
remote: Optional remote. Defaults to False.
|
||||||
**kwargs: Additional keyword arguments.
|
kwargs: Additional keyword arguments.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
A tool.
|
A tool.
|
||||||
@ -686,7 +686,7 @@ def load_tools(
|
|||||||
It is your responsibility to understand which tools
|
It is your responsibility to understand which tools
|
||||||
you're using and the risks associated with them.
|
you're using and the risks associated with them.
|
||||||
Defaults to False.
|
Defaults to False.
|
||||||
**kwargs: Additional keyword arguments.
|
kwargs: Additional keyword arguments.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
List of tools.
|
List of tools.
|
||||||
|
@ -62,7 +62,7 @@ class NLATool(Tool):
|
|||||||
verbose: Whether to print verbose output. Default is False.
|
verbose: Whether to print verbose output. Default is False.
|
||||||
return_intermediate_steps: Whether to return intermediate steps.
|
return_intermediate_steps: Whether to return intermediate steps.
|
||||||
Default is False.
|
Default is False.
|
||||||
**kwargs: Additional arguments.
|
kwargs: Additional arguments.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
The tool.
|
The tool.
|
||||||
|
@ -76,7 +76,7 @@ class NLAToolkit(BaseToolkit):
|
|||||||
spec: The OpenAPI spec.
|
spec: The OpenAPI spec.
|
||||||
requests: Optional requests object. Default is None.
|
requests: Optional requests object. Default is None.
|
||||||
verbose: Whether to print verbose output. Default is False.
|
verbose: Whether to print verbose output. Default is False.
|
||||||
**kwargs: Additional arguments.
|
kwargs: Additional arguments.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
The toolkit.
|
The toolkit.
|
||||||
@ -102,7 +102,7 @@ class NLAToolkit(BaseToolkit):
|
|||||||
open_api_url: The URL of the OpenAPI spec.
|
open_api_url: The URL of the OpenAPI spec.
|
||||||
requests: Optional requests object. Default is None.
|
requests: Optional requests object. Default is None.
|
||||||
verbose: Whether to print verbose output. Default is False.
|
verbose: Whether to print verbose output. Default is False.
|
||||||
**kwargs: Additional arguments.
|
kwargs: Additional arguments.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
The toolkit.
|
The toolkit.
|
||||||
|
@ -64,7 +64,7 @@ def create_openapi_agent(
|
|||||||
Default is False.
|
Default is False.
|
||||||
agent_executor_kwargs: Optional. Additional keyword arguments
|
agent_executor_kwargs: Optional. Additional keyword arguments
|
||||||
for the agent executor.
|
for the agent executor.
|
||||||
**kwargs: Additional arguments.
|
kwargs: Additional arguments.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
The agent executor.
|
The agent executor.
|
||||||
|
@ -421,7 +421,7 @@ def create_openapi_agent(
|
|||||||
Default is False.
|
Default is False.
|
||||||
allowed_operations: Optional. The allowed operations.
|
allowed_operations: Optional. The allowed operations.
|
||||||
Default is ("GET", "POST").
|
Default is ("GET", "POST").
|
||||||
**kwargs: Additional arguments.
|
kwargs: Additional arguments.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
The agent executor.
|
The agent executor.
|
||||||
|
@ -48,7 +48,7 @@ def connect_sse(client: Any, method: str, url: str, **kwargs: Any) -> Iterator:
|
|||||||
client: The HTTP client.
|
client: The HTTP client.
|
||||||
method: The HTTP method.
|
method: The HTTP method.
|
||||||
url: The URL.
|
url: The URL.
|
||||||
**kwargs: Additional keyword arguments.
|
kwargs: Additional keyword arguments.
|
||||||
|
|
||||||
Yields:
|
Yields:
|
||||||
The event source.
|
The event source.
|
||||||
@ -69,7 +69,7 @@ async def aconnect_sse(
|
|||||||
client: The HTTP client.
|
client: The HTTP client.
|
||||||
method: The HTTP method.
|
method: The HTTP method.
|
||||||
url: The URL.
|
url: The URL.
|
||||||
**kwargs: Additional keyword arguments.
|
kwargs: Additional keyword arguments.
|
||||||
|
|
||||||
Yields:
|
Yields:
|
||||||
The event source.
|
The event source.
|
||||||
|
@ -16,7 +16,7 @@ class AirtableLoader(BaseLoader):
|
|||||||
api_token: Airtable API token.
|
api_token: Airtable API token.
|
||||||
table_id: Airtable table ID.
|
table_id: Airtable table ID.
|
||||||
base_id:
|
base_id:
|
||||||
**kwargs: Additional parameters to pass to Table.all(). Refer to the
|
kwargs: Additional parameters to pass to Table.all(). Refer to the
|
||||||
pyairtable documentation for available options:
|
pyairtable documentation for available options:
|
||||||
https://pyairtable.readthedocs.io/en/latest/api.html#pyairtable.Table.all
|
https://pyairtable.readthedocs.io/en/latest/api.html#pyairtable.Table.all
|
||||||
""" # noqa: E501
|
""" # noqa: E501
|
||||||
|
@ -13,7 +13,7 @@ class MarkdownifyTransformer(BaseDocumentTransformer):
|
|||||||
convert: A list of tags to convert. This option can't be used with the strip option.
|
convert: A list of tags to convert. This option can't be used with the strip option.
|
||||||
autolinks: A boolean indicating whether the "automatic link" style should be used when a a tag's contents match its href. Defaults to True.
|
autolinks: A boolean indicating whether the "automatic link" style should be used when a a tag's contents match its href. Defaults to True.
|
||||||
heading_style: Defines how headings should be converted. Accepted values are ATX, ATX_CLOSED, SETEXT, and UNDERLINED (which is an alias for SETEXT). Defaults to ATX.
|
heading_style: Defines how headings should be converted. Accepted values are ATX, ATX_CLOSED, SETEXT, and UNDERLINED (which is an alias for SETEXT). Defaults to ATX.
|
||||||
**kwargs: Additional options to pass to markdownify.
|
kwargs: Additional options to pass to markdownify.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
@ -389,7 +389,7 @@ class Sambaverse(LLM):
|
|||||||
prompt: The prompt to pass into the model.
|
prompt: The prompt to pass into the model.
|
||||||
stop: Optional list of stop words to use when generating.
|
stop: Optional list of stop words to use when generating.
|
||||||
run_manager: Callback manager for the run.
|
run_manager: Callback manager for the run.
|
||||||
**kwargs: Additional keyword arguments. directly passed
|
kwargs: Additional keyword arguments. directly passed
|
||||||
to the sambaverse model in API call.
|
to the sambaverse model in API call.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
@ -426,7 +426,7 @@ class Sambaverse(LLM):
|
|||||||
stop: Stop words to use when generating. Model output is cut off at the
|
stop: Stop words to use when generating. Model output is cut off at the
|
||||||
first occurrence of any of the stop substrings.
|
first occurrence of any of the stop substrings.
|
||||||
run_manager: Callback manager for the run.
|
run_manager: Callback manager for the run.
|
||||||
**kwargs: Additional keyword arguments. directly passed
|
kwargs: Additional keyword arguments. directly passed
|
||||||
to the sambaverse model in API call.
|
to the sambaverse model in API call.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
@ -453,7 +453,7 @@ class Sambaverse(LLM):
|
|||||||
stop: Stop words to use when generating. Model output is cut off at the
|
stop: Stop words to use when generating. Model output is cut off at the
|
||||||
first occurrence of any of the stop substrings.
|
first occurrence of any of the stop substrings.
|
||||||
run_manager: Callback manager for the run.
|
run_manager: Callback manager for the run.
|
||||||
**kwargs: Additional keyword arguments. directly passed
|
kwargs: Additional keyword arguments. directly passed
|
||||||
to the sambaverse model in API call.
|
to the sambaverse model in API call.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
@ -951,7 +951,7 @@ class SambaStudio(LLM):
|
|||||||
stop: Stop words to use when generating. Model output is cut off at the
|
stop: Stop words to use when generating. Model output is cut off at the
|
||||||
first occurrence of any of the stop substrings.
|
first occurrence of any of the stop substrings.
|
||||||
run_manager: Callback manager for the run.
|
run_manager: Callback manager for the run.
|
||||||
**kwargs: Additional keyword arguments. directly passed
|
kwargs: Additional keyword arguments. directly passed
|
||||||
to the sambaverse model in API call.
|
to the sambaverse model in API call.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
|
@ -41,7 +41,7 @@ async def aexecute_cql(session: Session, query: str, **kwargs: Any) -> Any:
|
|||||||
Args:
|
Args:
|
||||||
session: The Cassandra session to use.
|
session: The Cassandra session to use.
|
||||||
query: The CQL query to execute.
|
query: The CQL query to execute.
|
||||||
**kwargs: Additional keyword arguments to pass to the session execute method.
|
kwargs: Additional keyword arguments to pass to the session execute method.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
The result of the query.
|
The result of the query.
|
||||||
|
@ -178,7 +178,7 @@ class Aerospike(VectorStore):
|
|||||||
wait_for_index: If True, wait for the all the texts to be indexed
|
wait_for_index: If True, wait for the all the texts to be indexed
|
||||||
before returning. Requires index_name to be provided. Defaults
|
before returning. Requires index_name to be provided. Defaults
|
||||||
to True.
|
to True.
|
||||||
**kwargs: Additional keyword arguments to pass to the client upsert call.
|
kwargs: Additional keyword arguments to pass to the client upsert call.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
List of ids from adding the texts into the vectorstore.
|
List of ids from adding the texts into the vectorstore.
|
||||||
|
@ -396,7 +396,7 @@ class ApertureDB(VectorStore):
|
|||||||
texts: List of text strings
|
texts: List of text strings
|
||||||
embedding: Embeddings object as for constructing the vectorstore
|
embedding: Embeddings object as for constructing the vectorstore
|
||||||
metadatas: Optional list of metadatas associated with the texts.
|
metadatas: Optional list of metadatas associated with the texts.
|
||||||
**kwargs: Additional arguments to pass to the constructor
|
kwargs: Additional arguments to pass to the constructor
|
||||||
"""
|
"""
|
||||||
store = cls(embeddings=embedding, **kwargs)
|
store = cls(embeddings=embedding, **kwargs)
|
||||||
store.add_texts(texts, metadatas)
|
store.add_texts(texts, metadatas)
|
||||||
@ -416,7 +416,7 @@ class ApertureDB(VectorStore):
|
|||||||
documents: List of Document objects
|
documents: List of Document objects
|
||||||
embedding: Embeddings object as for constructing the vectorstore
|
embedding: Embeddings object as for constructing the vectorstore
|
||||||
metadatas: Optional list of metadatas associated with the texts.
|
metadatas: Optional list of metadatas associated with the texts.
|
||||||
**kwargs: Additional arguments to pass to the constructor
|
kwargs: Additional arguments to pass to the constructor
|
||||||
"""
|
"""
|
||||||
store = cls(embeddings=embedding, **kwargs)
|
store = cls(embeddings=embedding, **kwargs)
|
||||||
store.add_documents(documents)
|
store.add_documents(documents)
|
||||||
|
@ -272,7 +272,7 @@ class Clarifai(VectorStore):
|
|||||||
token (Optional[str], optional): Session token. Defaults to None.
|
token (Optional[str], optional): Session token. Defaults to None.
|
||||||
metadatas (Optional[List[dict]]): Optional list
|
metadatas (Optional[List[dict]]): Optional list
|
||||||
of metadatas. Defaults to None.
|
of metadatas. Defaults to None.
|
||||||
**kwargs: Additional keyword arguments to be passed to the Search.
|
kwargs: Additional keyword arguments to be passed to the Search.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Clarifai: Clarifai vectorstore.
|
Clarifai: Clarifai vectorstore.
|
||||||
@ -310,7 +310,7 @@ class Clarifai(VectorStore):
|
|||||||
to return during vector search. Defaults to None.
|
to return during vector search. Defaults to None.
|
||||||
pat (Optional[str], optional): Personal access token. Defaults to None.
|
pat (Optional[str], optional): Personal access token. Defaults to None.
|
||||||
token (Optional[str], optional): Session token. Defaults to None.
|
token (Optional[str], optional): Session token. Defaults to None.
|
||||||
**kwargs: Additional keyword arguments to be passed to the Search.
|
kwargs: Additional keyword arguments to be passed to the Search.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Clarifai: Clarifai vectorstore.
|
Clarifai: Clarifai vectorstore.
|
||||||
|
@ -385,7 +385,7 @@ class DeepLake(VectorStore):
|
|||||||
model was trained. The search is performed using the Deep Memory model.
|
model was trained. The search is performed using the Deep Memory model.
|
||||||
If False, the distance metric is set to "COS" or whatever distance
|
If False, the distance metric is set to "COS" or whatever distance
|
||||||
metric user specifies.
|
metric user specifies.
|
||||||
**kwargs: Additional keyword arguments.
|
kwargs: Additional keyword arguments.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
List of Documents by the specified distance metric,
|
List of Documents by the specified distance metric,
|
||||||
@ -505,7 +505,7 @@ class DeepLake(VectorStore):
|
|||||||
Args:
|
Args:
|
||||||
k (int): Number of Documents to return. Defaults to 4.
|
k (int): Number of Documents to return. Defaults to 4.
|
||||||
query (str): Text to look up similar documents.
|
query (str): Text to look up similar documents.
|
||||||
**kwargs: Additional keyword arguments include:
|
kwargs: Additional keyword arguments include:
|
||||||
embedding (Callable): Embedding function to use. Defaults to None.
|
embedding (Callable): Embedding function to use. Defaults to None.
|
||||||
distance_metric (str): 'L2' for Euclidean, 'L1' for Nuclear, 'max'
|
distance_metric (str): 'L2' for Euclidean, 'L1' for Nuclear, 'max'
|
||||||
for L-infinity, 'cos' for cosine, 'dot' for dot product.
|
for L-infinity, 'cos' for cosine, 'dot' for dot product.
|
||||||
@ -567,7 +567,7 @@ class DeepLake(VectorStore):
|
|||||||
embedding (Union[List[float], np.ndarray]):
|
embedding (Union[List[float], np.ndarray]):
|
||||||
Embedding to find similar docs.
|
Embedding to find similar docs.
|
||||||
k (int): Number of Documents to return. Defaults to 4.
|
k (int): Number of Documents to return. Defaults to 4.
|
||||||
**kwargs: Additional keyword arguments including:
|
kwargs: Additional keyword arguments including:
|
||||||
filter (Union[Dict, Callable], optional):
|
filter (Union[Dict, Callable], optional):
|
||||||
Additional filter before embedding search.
|
Additional filter before embedding search.
|
||||||
- ``Dict`` - Key-value search on tensors of htype json. True
|
- ``Dict`` - Key-value search on tensors of htype json. True
|
||||||
@ -636,7 +636,7 @@ class DeepLake(VectorStore):
|
|||||||
Args:
|
Args:
|
||||||
query (str): Query text to search for.
|
query (str): Query text to search for.
|
||||||
k (int): Number of results to return. Defaults to 4.
|
k (int): Number of results to return. Defaults to 4.
|
||||||
**kwargs: Additional keyword arguments. Some of these arguments are:
|
kwargs: Additional keyword arguments. Some of these arguments are:
|
||||||
distance_metric: `L2` for Euclidean, `L1` for Nuclear, `max` L-infinity
|
distance_metric: `L2` for Euclidean, `L1` for Nuclear, `max` L-infinity
|
||||||
distance, `cos` for cosine similarity, 'dot' for dot product.
|
distance, `cos` for cosine similarity, 'dot' for dot product.
|
||||||
Defaults to `L2`.
|
Defaults to `L2`.
|
||||||
@ -728,7 +728,7 @@ class DeepLake(VectorStore):
|
|||||||
which the model was trained. The search is performed using the Deep
|
which the model was trained. The search is performed using the Deep
|
||||||
Memory model. If False, the distance metric is set to "COS" or
|
Memory model. If False, the distance metric is set to "COS" or
|
||||||
whatever distance metric user specifies.
|
whatever distance metric user specifies.
|
||||||
**kwargs: Additional keyword arguments.
|
kwargs: Additional keyword arguments.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
List[Documents] - A list of documents.
|
List[Documents] - A list of documents.
|
||||||
@ -795,7 +795,7 @@ class DeepLake(VectorStore):
|
|||||||
which the model was trained. The search is performed using the Deep
|
which the model was trained. The search is performed using the Deep
|
||||||
Memory model. If False, the distance metric is set to "COS" or
|
Memory model. If False, the distance metric is set to "COS" or
|
||||||
whatever distance metric user specifies.
|
whatever distance metric user specifies.
|
||||||
**kwargs: Additional keyword arguments
|
kwargs: Additional keyword arguments
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
List of Documents selected by maximal marginal relevance.
|
List of Documents selected by maximal marginal relevance.
|
||||||
@ -866,7 +866,7 @@ class DeepLake(VectorStore):
|
|||||||
Note, in other places, it is called embedding_function.
|
Note, in other places, it is called embedding_function.
|
||||||
metadatas (Optional[List[dict]]): List of metadatas. Defaults to None.
|
metadatas (Optional[List[dict]]): List of metadatas. Defaults to None.
|
||||||
ids (Optional[List[str]]): List of document IDs. Defaults to None.
|
ids (Optional[List[str]]): List of document IDs. Defaults to None.
|
||||||
**kwargs: Additional keyword arguments.
|
kwargs: Additional keyword arguments.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
DeepLake: Deep Lake dataset.
|
DeepLake: Deep Lake dataset.
|
||||||
|
@ -255,7 +255,7 @@ class DuckDB(VectorStore):
|
|||||||
texts: List of strings to add to the vector store.
|
texts: List of strings to add to the vector store.
|
||||||
embedding: The embedding function or model to use for generating embeddings.
|
embedding: The embedding function or model to use for generating embeddings.
|
||||||
metadatas: Optional list of metadata dictionaries associated with the texts.
|
metadatas: Optional list of metadata dictionaries associated with the texts.
|
||||||
**kwargs: Additional keyword arguments including:
|
kwargs: Additional keyword arguments including:
|
||||||
- connection: DuckDB connection. If not provided, a new connection will
|
- connection: DuckDB connection. If not provided, a new connection will
|
||||||
be created.
|
be created.
|
||||||
- vector_key: The column name for storing vectors. Default "vector".
|
- vector_key: The column name for storing vectors. Default "vector".
|
||||||
|
@ -285,7 +285,7 @@ class TiDBVectorStore(VectorStore):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
ids (Optional[List[str]]): A list of vector IDs to delete.
|
ids (Optional[List[str]]): A list of vector IDs to delete.
|
||||||
**kwargs: Additional keyword arguments.
|
kwargs: Additional keyword arguments.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
self._tidb.delete(ids=ids, **kwargs)
|
self._tidb.delete(ids=ids, **kwargs)
|
||||||
@ -305,7 +305,7 @@ class TiDBVectorStore(VectorStore):
|
|||||||
k (int, optional): The number of results to retrieve. Defaults to 4.
|
k (int, optional): The number of results to retrieve. Defaults to 4.
|
||||||
filter (dict, optional): A filter to apply to the search results.
|
filter (dict, optional): A filter to apply to the search results.
|
||||||
Defaults to None.
|
Defaults to None.
|
||||||
**kwargs: Additional keyword arguments.
|
kwargs: Additional keyword arguments.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
List[Document]: A list of Document objects representing the search results.
|
List[Document]: A list of Document objects representing the search results.
|
||||||
@ -328,7 +328,7 @@ class TiDBVectorStore(VectorStore):
|
|||||||
k (int, optional): The number of results to return. Defaults to 5.
|
k (int, optional): The number of results to return. Defaults to 5.
|
||||||
filter (dict, optional): A filter to apply to the search results.
|
filter (dict, optional): A filter to apply to the search results.
|
||||||
Defaults to None.
|
Defaults to None.
|
||||||
**kwargs: Additional keyword arguments.
|
kwargs: Additional keyword arguments.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
A list of tuples containing relevant documents and their similarity scores.
|
A list of tuples containing relevant documents and their similarity scores.
|
||||||
|
@ -428,7 +428,7 @@ class Weaviate(VectorStore):
|
|||||||
relevance_score_fn: Function for converting whatever distance function the
|
relevance_score_fn: Function for converting whatever distance function the
|
||||||
vector store uses to a relevance score, which is a normalized similarity
|
vector store uses to a relevance score, which is a normalized similarity
|
||||||
score (0 means dissimilar, 1 means similar).
|
score (0 means dissimilar, 1 means similar).
|
||||||
**kwargs: Additional named parameters to pass to ``Weaviate.__init__()``.
|
kwargs: Additional named parameters to pass to ``Weaviate.__init__()``.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
@ -639,7 +639,7 @@ class ZepVectorStore(VectorStore):
|
|||||||
api_url (str): The URL of the Zep API.
|
api_url (str): The URL of the Zep API.
|
||||||
api_key (Optional[str]): The API key for the Zep API.
|
api_key (Optional[str]): The API key for the Zep API.
|
||||||
config (Optional[CollectionConfig]): The configuration for the collection.
|
config (Optional[CollectionConfig]): The configuration for the collection.
|
||||||
**kwargs: Additional parameters specific to the vectorstore.
|
kwargs: Additional parameters specific to the vectorstore.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
ZepVectorStore: An instance of ZepVectorStore.
|
ZepVectorStore: An instance of ZepVectorStore.
|
||||||
|
@ -442,7 +442,7 @@ class ZepCloudVectorStore(VectorStore):
|
|||||||
associated with the texts.
|
associated with the texts.
|
||||||
collection_name (str): The name of the collection in the Zep store.
|
collection_name (str): The name of the collection in the Zep store.
|
||||||
api_key (str): The API key for the Zep API.
|
api_key (str): The API key for the Zep API.
|
||||||
**kwargs: Additional parameters specific to the vectorstore.
|
kwargs: Additional parameters specific to the vectorstore.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
ZepVectorStore: An instance of ZepVectorStore.
|
ZepVectorStore: An instance of ZepVectorStore.
|
||||||
|
@ -28,7 +28,7 @@ def dumps(obj: Any, *, pretty: bool = False, **kwargs: Any) -> str:
|
|||||||
pretty: Whether to pretty print the json. If true, the json will be
|
pretty: Whether to pretty print the json. If true, the json will be
|
||||||
indented with 2 spaces (if no indent is provided as part of kwargs).
|
indented with 2 spaces (if no indent is provided as part of kwargs).
|
||||||
Default is False.
|
Default is False.
|
||||||
**kwargs: Additional arguments to pass to json.dumps
|
kwargs: Additional arguments to pass to json.dumps
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
A json string representation of the object.
|
A json string representation of the object.
|
||||||
|
@ -89,7 +89,7 @@ class AIMessage(BaseMessage):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
content: The content of the message.
|
content: The content of the message.
|
||||||
**kwargs: Additional arguments to pass to the parent class.
|
kwargs: Additional arguments to pass to the parent class.
|
||||||
"""
|
"""
|
||||||
super().__init__(content=content, **kwargs)
|
super().__init__(content=content, **kwargs)
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ class BaseMessage(Serializable):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
content: The string contents of the message.
|
content: The string contents of the message.
|
||||||
**kwargs: Additional fields to pass to the
|
kwargs: Additional fields to pass to the
|
||||||
"""
|
"""
|
||||||
super().__init__(content=content, **kwargs)
|
super().__init__(content=content, **kwargs)
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ class HumanMessage(BaseMessage):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
content: The string contents of the message.
|
content: The string contents of the message.
|
||||||
**kwargs: Additional fields to pass to the message.
|
kwargs: Additional fields to pass to the message.
|
||||||
"""
|
"""
|
||||||
super().__init__(content=content, **kwargs)
|
super().__init__(content=content, **kwargs)
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ class RemoveMessage(BaseMessage):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
id: The ID of the message to remove.
|
id: The ID of the message to remove.
|
||||||
**kwargs: Additional fields to pass to the message.
|
kwargs: Additional fields to pass to the message.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
ValueError: If the 'content' field is passed in kwargs.
|
ValueError: If the 'content' field is passed in kwargs.
|
||||||
|
@ -45,7 +45,7 @@ class SystemMessage(BaseMessage):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
content: The string contents of the message.
|
content: The string contents of the message.
|
||||||
**kwargs: Additional fields to pass to the message.
|
kwargs: Additional fields to pass to the message.
|
||||||
"""
|
"""
|
||||||
super().__init__(content=content, **kwargs)
|
super().__init__(content=content, **kwargs)
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ class ToolMessage(BaseMessage):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
content: The string contents of the message.
|
content: The string contents of the message.
|
||||||
**kwargs: Additional fields to pass to the message
|
kwargs: Additional fields to pass to the message
|
||||||
"""
|
"""
|
||||||
super().__init__(content=content, **kwargs)
|
super().__init__(content=content, **kwargs)
|
||||||
|
|
||||||
|
@ -179,7 +179,7 @@ class BaseRetriever(RunnableSerializable[RetrieverInput, RetrieverOutput], ABC):
|
|||||||
Args:
|
Args:
|
||||||
input: The query string.
|
input: The query string.
|
||||||
config: Configuration for the retriever. Defaults to None.
|
config: Configuration for the retriever. Defaults to None.
|
||||||
**kwargs: Additional arguments to pass to the retriever.
|
kwargs: Additional arguments to pass to the retriever.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
List of relevant documents.
|
List of relevant documents.
|
||||||
@ -238,7 +238,7 @@ class BaseRetriever(RunnableSerializable[RetrieverInput, RetrieverOutput], ABC):
|
|||||||
Args:
|
Args:
|
||||||
input: The query string.
|
input: The query string.
|
||||||
config: Configuration for the retriever. Defaults to None.
|
config: Configuration for the retriever. Defaults to None.
|
||||||
**kwargs: Additional arguments to pass to the retriever.
|
kwargs: Additional arguments to pass to the retriever.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
List of relevant documents.
|
List of relevant documents.
|
||||||
@ -343,7 +343,7 @@ class BaseRetriever(RunnableSerializable[RetrieverInput, RetrieverOutput], ABC):
|
|||||||
and passed as arguments to the handlers defined in `callbacks`.
|
and passed as arguments to the handlers defined in `callbacks`.
|
||||||
Defaults to None.
|
Defaults to None.
|
||||||
run_name: Optional name for the run. Defaults to None.
|
run_name: Optional name for the run. Defaults to None.
|
||||||
**kwargs: Additional arguments to pass to the retriever.
|
kwargs: Additional arguments to pass to the retriever.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
List of relevant documents.
|
List of relevant documents.
|
||||||
@ -387,7 +387,7 @@ class BaseRetriever(RunnableSerializable[RetrieverInput, RetrieverOutput], ABC):
|
|||||||
and passed as arguments to the handlers defined in `callbacks`.
|
and passed as arguments to the handlers defined in `callbacks`.
|
||||||
Defaults to None.
|
Defaults to None.
|
||||||
run_name: Optional name for the run. Defaults to None.
|
run_name: Optional name for the run. Defaults to None.
|
||||||
**kwargs: Additional arguments to pass to the retriever.
|
kwargs: Additional arguments to pass to the retriever.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
List of relevant documents.
|
List of relevant documents.
|
||||||
|
@ -738,7 +738,7 @@ class Runnable(Generic[Input, Output], ABC):
|
|||||||
for more details. Defaults to None.
|
for more details. Defaults to None.
|
||||||
return_exceptions: Whether to return exceptions instead of raising them.
|
return_exceptions: Whether to return exceptions instead of raising them.
|
||||||
Defaults to False.
|
Defaults to False.
|
||||||
**kwargs: Additional keyword arguments to pass to the Runnable.
|
kwargs: Additional keyword arguments to pass to the Runnable.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
A list of outputs from the Runnable.
|
A list of outputs from the Runnable.
|
||||||
@ -802,7 +802,7 @@ class Runnable(Generic[Input, Output], ABC):
|
|||||||
for more details. Defaults to None. Defaults to None.
|
for more details. Defaults to None. Defaults to None.
|
||||||
return_exceptions: Whether to return exceptions instead of raising them.
|
return_exceptions: Whether to return exceptions instead of raising them.
|
||||||
Defaults to False.
|
Defaults to False.
|
||||||
**kwargs: Additional keyword arguments to pass to the Runnable.
|
kwargs: Additional keyword arguments to pass to the Runnable.
|
||||||
|
|
||||||
Yields:
|
Yields:
|
||||||
A tuple of the index of the input and the output from the Runnable.
|
A tuple of the index of the input and the output from the Runnable.
|
||||||
@ -846,7 +846,7 @@ class Runnable(Generic[Input, Output], ABC):
|
|||||||
Args:
|
Args:
|
||||||
input: The input to the Runnable.
|
input: The input to the Runnable.
|
||||||
config: The config to use for the Runnable. Defaults to None.
|
config: The config to use for the Runnable. Defaults to None.
|
||||||
**kwargs: Additional keyword arguments to pass to the Runnable.
|
kwargs: Additional keyword arguments to pass to the Runnable.
|
||||||
|
|
||||||
Yields:
|
Yields:
|
||||||
The output of the Runnable.
|
The output of the Runnable.
|
||||||
@ -866,7 +866,7 @@ class Runnable(Generic[Input, Output], ABC):
|
|||||||
Args:
|
Args:
|
||||||
input: The input to the Runnable.
|
input: The input to the Runnable.
|
||||||
config: The config to use for the Runnable. Defaults to None.
|
config: The config to use for the Runnable. Defaults to None.
|
||||||
**kwargs: Additional keyword arguments to pass to the Runnable.
|
kwargs: Additional keyword arguments to pass to the Runnable.
|
||||||
|
|
||||||
Yields:
|
Yields:
|
||||||
The output of the Runnable.
|
The output of the Runnable.
|
||||||
@ -943,7 +943,7 @@ class Runnable(Generic[Input, Output], ABC):
|
|||||||
exclude_names: Exclude logs with these names.
|
exclude_names: Exclude logs with these names.
|
||||||
exclude_types: Exclude logs with these types.
|
exclude_types: Exclude logs with these types.
|
||||||
exclude_tags: Exclude logs with these tags.
|
exclude_tags: Exclude logs with these tags.
|
||||||
**kwargs: Additional keyword arguments to pass to the Runnable.
|
kwargs: Additional keyword arguments to pass to the Runnable.
|
||||||
|
|
||||||
Yields:
|
Yields:
|
||||||
A RunLogPatch or RunLog object.
|
A RunLogPatch or RunLog object.
|
||||||
@ -1260,7 +1260,7 @@ class Runnable(Generic[Input, Output], ABC):
|
|||||||
Args:
|
Args:
|
||||||
input: An iterator of inputs to the Runnable.
|
input: An iterator of inputs to the Runnable.
|
||||||
config: The config to use for the Runnable. Defaults to None.
|
config: The config to use for the Runnable. Defaults to None.
|
||||||
**kwargs: Additional keyword arguments to pass to the Runnable.
|
kwargs: Additional keyword arguments to pass to the Runnable.
|
||||||
|
|
||||||
Yields:
|
Yields:
|
||||||
The output of the Runnable.
|
The output of the Runnable.
|
||||||
@ -1302,7 +1302,7 @@ class Runnable(Generic[Input, Output], ABC):
|
|||||||
Args:
|
Args:
|
||||||
input: An async iterator of inputs to the Runnable.
|
input: An async iterator of inputs to the Runnable.
|
||||||
config: The config to use for the Runnable. Defaults to None.
|
config: The config to use for the Runnable. Defaults to None.
|
||||||
**kwargs: Additional keyword arguments to pass to the Runnable.
|
kwargs: Additional keyword arguments to pass to the Runnable.
|
||||||
|
|
||||||
Yields:
|
Yields:
|
||||||
The output of the Runnable.
|
The output of the Runnable.
|
||||||
@ -4429,7 +4429,7 @@ class RunnableLambda(Runnable[Input, Output]):
|
|||||||
Args:
|
Args:
|
||||||
input: The input to this Runnable.
|
input: The input to this Runnable.
|
||||||
config: The config to use. Defaults to None.
|
config: The config to use. Defaults to None.
|
||||||
**kwargs: Additional keyword arguments.
|
kwargs: Additional keyword arguments.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
The output of this Runnable.
|
The output of this Runnable.
|
||||||
@ -4461,7 +4461,7 @@ class RunnableLambda(Runnable[Input, Output]):
|
|||||||
Args:
|
Args:
|
||||||
input: The input to this Runnable.
|
input: The input to this Runnable.
|
||||||
config: The config to use. Defaults to None.
|
config: The config to use. Defaults to None.
|
||||||
**kwargs: Additional keyword arguments.
|
kwargs: Additional keyword arguments.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
The output of this Runnable.
|
The output of this Runnable.
|
||||||
|
@ -196,7 +196,7 @@ class RunnableBranch(RunnableSerializable[Input, Output]):
|
|||||||
Args:
|
Args:
|
||||||
input: The input to the Runnable.
|
input: The input to the Runnable.
|
||||||
config: The configuration for the Runnable. Defaults to None.
|
config: The configuration for the Runnable. Defaults to None.
|
||||||
**kwargs: Additional keyword arguments to pass to the Runnable.
|
kwargs: Additional keyword arguments to pass to the Runnable.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
The output of the branch that was run.
|
The output of the branch that was run.
|
||||||
@ -309,7 +309,7 @@ class RunnableBranch(RunnableSerializable[Input, Output]):
|
|||||||
Args:
|
Args:
|
||||||
input: The input to the Runnable.
|
input: The input to the Runnable.
|
||||||
config: The configuration for the Runnable. Defaults to None.
|
config: The configuration for the Runnable. Defaults to None.
|
||||||
**kwargs: Additional keyword arguments to pass to the Runnable.
|
kwargs: Additional keyword arguments to pass to the Runnable.
|
||||||
|
|
||||||
Yields:
|
Yields:
|
||||||
The output of the branch that was run.
|
The output of the branch that was run.
|
||||||
@ -396,7 +396,7 @@ class RunnableBranch(RunnableSerializable[Input, Output]):
|
|||||||
Args:
|
Args:
|
||||||
input: The input to the Runnable.
|
input: The input to the Runnable.
|
||||||
config: The configuration for the Runnable. Defaults to None.
|
config: The configuration for the Runnable. Defaults to None.
|
||||||
**kwargs: Additional keyword arguments to pass to the Runnable.
|
kwargs: Additional keyword arguments to pass to the Runnable.
|
||||||
|
|
||||||
Yields:
|
Yields:
|
||||||
The output of the branch that was run.
|
The output of the branch that was run.
|
||||||
|
@ -859,7 +859,7 @@ class Tool(BaseTool):
|
|||||||
return_direct: Whether to return the output directly. Defaults to False.
|
return_direct: Whether to return the output directly. Defaults to False.
|
||||||
args_schema: The schema of the tool's input arguments. Defaults to None.
|
args_schema: The schema of the tool's input arguments. Defaults to None.
|
||||||
coroutine: The asynchronous version of the function. Defaults to None.
|
coroutine: The asynchronous version of the function. Defaults to None.
|
||||||
**kwargs: Additional arguments to pass to the tool.
|
kwargs: Additional arguments to pass to the tool.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
The tool.
|
The tool.
|
||||||
@ -992,7 +992,7 @@ class StructuredTool(BaseTool):
|
|||||||
error_on_invalid_docstring: if ``parse_docstring`` is provided, configure
|
error_on_invalid_docstring: if ``parse_docstring`` is provided, configure
|
||||||
whether to raise ValueError on invalid Google Style docstrings.
|
whether to raise ValueError on invalid Google Style docstrings.
|
||||||
Defaults to False.
|
Defaults to False.
|
||||||
**kwargs: Additional arguments to pass to the tool
|
kwargs: Additional arguments to pass to the tool
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
The tool.
|
The tool.
|
||||||
|
@ -72,7 +72,7 @@ class BaseTracer(_TracerCore, BaseCallbackHandler, ABC):
|
|||||||
parent_run_id: The parent run ID. Defaults to None.
|
parent_run_id: The parent run ID. Defaults to None.
|
||||||
metadata: The metadata for the run. Defaults to None.
|
metadata: The metadata for the run. Defaults to None.
|
||||||
name: The name of the run.
|
name: The name of the run.
|
||||||
**kwargs: Additional arguments.
|
kwargs: Additional arguments.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
The run.
|
The run.
|
||||||
@ -113,7 +113,7 @@ class BaseTracer(_TracerCore, BaseCallbackHandler, ABC):
|
|||||||
parent_run_id: The parent run ID. Defaults to None.
|
parent_run_id: The parent run ID. Defaults to None.
|
||||||
metadata: The metadata for the run. Defaults to None.
|
metadata: The metadata for the run. Defaults to None.
|
||||||
name: The name of the run.
|
name: The name of the run.
|
||||||
**kwargs: Additional arguments.
|
kwargs: Additional arguments.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
The run.
|
The run.
|
||||||
@ -148,7 +148,7 @@ class BaseTracer(_TracerCore, BaseCallbackHandler, ABC):
|
|||||||
chunk: The chunk. Defaults to None.
|
chunk: The chunk. Defaults to None.
|
||||||
run_id: The run ID.
|
run_id: The run ID.
|
||||||
parent_run_id: The parent run ID. Defaults to None.
|
parent_run_id: The parent run ID. Defaults to None.
|
||||||
**kwargs: Additional arguments.
|
kwargs: Additional arguments.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
The run.
|
The run.
|
||||||
@ -177,7 +177,7 @@ class BaseTracer(_TracerCore, BaseCallbackHandler, ABC):
|
|||||||
Args:
|
Args:
|
||||||
retry_state: The retry state.
|
retry_state: The retry state.
|
||||||
run_id: The run ID.
|
run_id: The run ID.
|
||||||
**kwargs: Additional arguments.
|
kwargs: Additional arguments.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
The run.
|
The run.
|
||||||
@ -194,7 +194,7 @@ class BaseTracer(_TracerCore, BaseCallbackHandler, ABC):
|
|||||||
Args:
|
Args:
|
||||||
response: The response.
|
response: The response.
|
||||||
run_id: The run ID.
|
run_id: The run ID.
|
||||||
**kwargs: Additional arguments.
|
kwargs: Additional arguments.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
The run.
|
The run.
|
||||||
@ -221,7 +221,7 @@ class BaseTracer(_TracerCore, BaseCallbackHandler, ABC):
|
|||||||
Args:
|
Args:
|
||||||
error: The error.
|
error: The error.
|
||||||
run_id: The run ID.
|
run_id: The run ID.
|
||||||
**kwargs: Additional arguments.
|
kwargs: Additional arguments.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
The run.
|
The run.
|
||||||
@ -260,7 +260,7 @@ class BaseTracer(_TracerCore, BaseCallbackHandler, ABC):
|
|||||||
metadata: The metadata for the run. Defaults to None.
|
metadata: The metadata for the run. Defaults to None.
|
||||||
run_type: The type of the run. Defaults to None.
|
run_type: The type of the run. Defaults to None.
|
||||||
name: The name of the run.
|
name: The name of the run.
|
||||||
**kwargs: Additional arguments.
|
kwargs: Additional arguments.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
The run.
|
The run.
|
||||||
@ -294,7 +294,7 @@ class BaseTracer(_TracerCore, BaseCallbackHandler, ABC):
|
|||||||
outputs: The outputs for the chain.
|
outputs: The outputs for the chain.
|
||||||
run_id: The run ID.
|
run_id: The run ID.
|
||||||
inputs: The inputs for the chain. Defaults to None.
|
inputs: The inputs for the chain. Defaults to None.
|
||||||
**kwargs: Additional arguments.
|
kwargs: Additional arguments.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
The run.
|
The run.
|
||||||
@ -323,7 +323,7 @@ class BaseTracer(_TracerCore, BaseCallbackHandler, ABC):
|
|||||||
error: The error.
|
error: The error.
|
||||||
inputs: The inputs for the chain. Defaults to None.
|
inputs: The inputs for the chain. Defaults to None.
|
||||||
run_id: The run ID.
|
run_id: The run ID.
|
||||||
**kwargs: Additional arguments.
|
kwargs: Additional arguments.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
The run.
|
The run.
|
||||||
@ -362,7 +362,7 @@ class BaseTracer(_TracerCore, BaseCallbackHandler, ABC):
|
|||||||
metadata: The metadata for the run. Defaults to None.
|
metadata: The metadata for the run. Defaults to None.
|
||||||
name: The name of the run.
|
name: The name of the run.
|
||||||
inputs: The inputs for the tool.
|
inputs: The inputs for the tool.
|
||||||
**kwargs: Additional arguments.
|
kwargs: Additional arguments.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
The run.
|
The run.
|
||||||
@ -388,7 +388,7 @@ class BaseTracer(_TracerCore, BaseCallbackHandler, ABC):
|
|||||||
Args:
|
Args:
|
||||||
output: The output for the tool.
|
output: The output for the tool.
|
||||||
run_id: The run ID.
|
run_id: The run ID.
|
||||||
**kwargs: Additional arguments.
|
kwargs: Additional arguments.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
The run.
|
The run.
|
||||||
@ -414,7 +414,7 @@ class BaseTracer(_TracerCore, BaseCallbackHandler, ABC):
|
|||||||
Args:
|
Args:
|
||||||
error: The error.
|
error: The error.
|
||||||
run_id: The run ID.
|
run_id: The run ID.
|
||||||
**kwargs: Additional arguments.
|
kwargs: Additional arguments.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
The run.
|
The run.
|
||||||
@ -449,7 +449,7 @@ class BaseTracer(_TracerCore, BaseCallbackHandler, ABC):
|
|||||||
tags: The tags for the run. Defaults to None.
|
tags: The tags for the run. Defaults to None.
|
||||||
metadata: The metadata for the run. Defaults to None.
|
metadata: The metadata for the run. Defaults to None.
|
||||||
name: The name of the run.
|
name: The name of the run.
|
||||||
**kwargs: Additional arguments.
|
kwargs: Additional arguments.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
The run.
|
The run.
|
||||||
@ -480,7 +480,7 @@ class BaseTracer(_TracerCore, BaseCallbackHandler, ABC):
|
|||||||
Args:
|
Args:
|
||||||
error: The error.
|
error: The error.
|
||||||
run_id: The run ID.
|
run_id: The run ID.
|
||||||
**kwargs: Additional arguments.
|
kwargs: Additional arguments.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
The run.
|
The run.
|
||||||
@ -502,7 +502,7 @@ class BaseTracer(_TracerCore, BaseCallbackHandler, ABC):
|
|||||||
Args:
|
Args:
|
||||||
documents: The documents.
|
documents: The documents.
|
||||||
run_id: The run ID.
|
run_id: The run ID.
|
||||||
**kwargs: Additional arguments.
|
kwargs: Additional arguments.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
The run.
|
The run.
|
||||||
|
@ -94,7 +94,7 @@ class LangChainTracer(BaseTracer):
|
|||||||
project_name: The project name. Defaults to the tracer project.
|
project_name: The project name. Defaults to the tracer project.
|
||||||
client: The client. Defaults to the global client.
|
client: The client. Defaults to the global client.
|
||||||
tags: The tags. Defaults to an empty list.
|
tags: The tags. Defaults to an empty list.
|
||||||
**kwargs: Additional keyword arguments.
|
kwargs: Additional keyword arguments.
|
||||||
"""
|
"""
|
||||||
super().__init__(**kwargs)
|
super().__init__(**kwargs)
|
||||||
self.example_id = (
|
self.example_id = (
|
||||||
@ -127,7 +127,7 @@ class LangChainTracer(BaseTracer):
|
|||||||
parent_run_id: The parent run ID. Defaults to None.
|
parent_run_id: The parent run ID. Defaults to None.
|
||||||
metadata: The metadata. Defaults to None.
|
metadata: The metadata. Defaults to None.
|
||||||
name: The name. Defaults to None.
|
name: The name. Defaults to None.
|
||||||
**kwargs: Additional keyword arguments.
|
kwargs: Additional keyword arguments.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Run: The run.
|
Run: The run.
|
||||||
|
@ -145,7 +145,7 @@ class VectorStore(ABC):
|
|||||||
Args:
|
Args:
|
||||||
items: Iterable of Documents to add to the vectorstore.
|
items: Iterable of Documents to add to the vectorstore.
|
||||||
batch_size: The size of each batch to upsert.
|
batch_size: The size of each batch to upsert.
|
||||||
**kwargs: Additional keyword arguments.
|
kwargs: Additional keyword arguments.
|
||||||
kwargs should only include parameters that are common to all
|
kwargs should only include parameters that are common to all
|
||||||
documents. (e.g., timeout for indexing, retry policy, etc.)
|
documents. (e.g., timeout for indexing, retry policy, etc.)
|
||||||
kwargs should not include ids to avoid ambiguous semantics.
|
kwargs should not include ids to avoid ambiguous semantics.
|
||||||
@ -186,7 +186,7 @@ class VectorStore(ABC):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
items: Sequence of Documents to add to the vectorstore.
|
items: Sequence of Documents to add to the vectorstore.
|
||||||
**kwargs: Additional keyword arguments.
|
kwargs: Additional keyword arguments.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
UpsertResponse: A response object that contains the list of IDs that were
|
UpsertResponse: A response object that contains the list of IDs that were
|
||||||
@ -247,7 +247,7 @@ class VectorStore(ABC):
|
|||||||
Args:
|
Args:
|
||||||
items: Iterable of Documents to add to the vectorstore.
|
items: Iterable of Documents to add to the vectorstore.
|
||||||
batch_size: The size of each batch to upsert.
|
batch_size: The size of each batch to upsert.
|
||||||
**kwargs: Additional keyword arguments.
|
kwargs: Additional keyword arguments.
|
||||||
kwargs should only include parameters that are common to all
|
kwargs should only include parameters that are common to all
|
||||||
documents. (e.g., timeout for indexing, retry policy, etc.)
|
documents. (e.g., timeout for indexing, retry policy, etc.)
|
||||||
kwargs should not include ids to avoid ambiguous semantics.
|
kwargs should not include ids to avoid ambiguous semantics.
|
||||||
@ -279,7 +279,7 @@ class VectorStore(ABC):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
items: Sequence of Documents to add to the vectorstore.
|
items: Sequence of Documents to add to the vectorstore.
|
||||||
**kwargs: Additional keyword arguments.
|
kwargs: Additional keyword arguments.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
UpsertResponse: A response object that contains the list of IDs that were
|
UpsertResponse: A response object that contains the list of IDs that were
|
||||||
@ -1048,7 +1048,7 @@ class VectorStore(ABC):
|
|||||||
Args:
|
Args:
|
||||||
documents: List of Documents to add to the vectorstore.
|
documents: List of Documents to add to the vectorstore.
|
||||||
embedding: Embedding function to use.
|
embedding: Embedding function to use.
|
||||||
**kwargs: Additional keyword arguments.
|
kwargs: Additional keyword arguments.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
VectorStore: VectorStore initialized from documents and embeddings.
|
VectorStore: VectorStore initialized from documents and embeddings.
|
||||||
@ -1069,7 +1069,7 @@ class VectorStore(ABC):
|
|||||||
Args:
|
Args:
|
||||||
documents: List of Documents to add to the vectorstore.
|
documents: List of Documents to add to the vectorstore.
|
||||||
embedding: Embedding function to use.
|
embedding: Embedding function to use.
|
||||||
**kwargs: Additional keyword arguments.
|
kwargs: Additional keyword arguments.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
VectorStore: VectorStore initialized from documents and embeddings.
|
VectorStore: VectorStore initialized from documents and embeddings.
|
||||||
@ -1094,7 +1094,7 @@ class VectorStore(ABC):
|
|||||||
embedding: Embedding function to use.
|
embedding: Embedding function to use.
|
||||||
metadatas: Optional list of metadatas associated with the texts.
|
metadatas: Optional list of metadatas associated with the texts.
|
||||||
Default is None.
|
Default is None.
|
||||||
**kwargs: Additional keyword arguments.
|
kwargs: Additional keyword arguments.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
VectorStore: VectorStore initialized from texts and embeddings.
|
VectorStore: VectorStore initialized from texts and embeddings.
|
||||||
@ -1115,7 +1115,7 @@ class VectorStore(ABC):
|
|||||||
embedding: Embedding function to use.
|
embedding: Embedding function to use.
|
||||||
metadatas: Optional list of metadatas associated with the texts.
|
metadatas: Optional list of metadatas associated with the texts.
|
||||||
Default is None.
|
Default is None.
|
||||||
**kwargs: Additional keyword arguments.
|
kwargs: Additional keyword arguments.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
VectorStore: VectorStore initialized from texts and embeddings.
|
VectorStore: VectorStore initialized from texts and embeddings.
|
||||||
|
@ -324,7 +324,7 @@ class InMemoryVectorStore(VectorStore):
|
|||||||
Args:
|
Args:
|
||||||
path: The path to load the vector store from.
|
path: The path to load the vector store from.
|
||||||
embedding: The embedding to use.
|
embedding: The embedding to use.
|
||||||
**kwargs: Additional arguments to pass to the constructor.
|
kwargs: Additional arguments to pass to the constructor.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
A VectorStore object.
|
A VectorStore object.
|
||||||
|
@ -25,7 +25,7 @@ def create_csv_agent(
|
|||||||
path: A string path, file-like object or a list of string paths/file-like
|
path: A string path, file-like object or a list of string paths/file-like
|
||||||
objects that can be read in as pandas DataFrames with pd.read_csv().
|
objects that can be read in as pandas DataFrames with pd.read_csv().
|
||||||
pandas_kwargs: Named arguments to pass to pd.read_csv().
|
pandas_kwargs: Named arguments to pass to pd.read_csv().
|
||||||
**kwargs: Additional kwargs to pass to langchain_experimental.agents.agent_toolkits.pandas.base.create_pandas_dataframe_agent().
|
kwargs: Additional kwargs to pass to langchain_experimental.agents.agent_toolkits.pandas.base.create_pandas_dataframe_agent().
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
An AgentExecutor with the specified agent_type agent and access to
|
An AgentExecutor with the specified agent_type agent and access to
|
||||||
|
@ -352,7 +352,7 @@ class DiffbotGraphTransformer:
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
documents (Sequence[Document]): The original documents.
|
documents (Sequence[Document]): The original documents.
|
||||||
**kwargs: Additional keyword arguments.
|
kwargs: Additional keyword arguments.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Sequence[GraphDocument]: The transformed documents as graphs.
|
Sequence[GraphDocument]: The transformed documents as graphs.
|
||||||
|
@ -774,7 +774,7 @@ class LLMGraphTransformer:
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
documents (Sequence[Document]): The original documents.
|
documents (Sequence[Document]): The original documents.
|
||||||
**kwargs: Additional keyword arguments.
|
kwargs: Additional keyword arguments.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Sequence[GraphDocument]: The transformed documents as graphs.
|
Sequence[GraphDocument]: The transformed documents as graphs.
|
||||||
|
@ -89,7 +89,7 @@ class RelikGraphTransformer:
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
documents (Sequence[Document]): The original documents.
|
documents (Sequence[Document]): The original documents.
|
||||||
**kwargs: Additional keyword arguments.
|
kwargs: Additional keyword arguments.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Sequence[GraphDocument]: The transformed documents as graphs.
|
Sequence[GraphDocument]: The transformed documents as graphs.
|
||||||
|
@ -41,7 +41,7 @@ def create_openai_data_generator(
|
|||||||
from the function types.
|
from the function types.
|
||||||
|
|
||||||
|
|
||||||
**kwargs: Additional keyword arguments to be passed to
|
kwargs: Additional keyword arguments to be passed to
|
||||||
`create_structured_output_chain`.
|
`create_structured_output_chain`.
|
||||||
|
|
||||||
|
|
||||||
|
@ -156,7 +156,7 @@ class BaseSingleActionAgent(BaseModel):
|
|||||||
llm: Language model to use.
|
llm: Language model to use.
|
||||||
tools: Tools to use.
|
tools: Tools to use.
|
||||||
callback_manager: Callback manager to use.
|
callback_manager: Callback manager to use.
|
||||||
**kwargs: Additional arguments.
|
kwargs: Additional arguments.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
BaseSingleActionAgent: Agent object.
|
BaseSingleActionAgent: Agent object.
|
||||||
@ -939,7 +939,7 @@ class Agent(BaseSingleActionAgent):
|
|||||||
tools: Tools to use.
|
tools: Tools to use.
|
||||||
callback_manager: Callback manager to use.
|
callback_manager: Callback manager to use.
|
||||||
output_parser: Output parser to use.
|
output_parser: Output parser to use.
|
||||||
**kwargs: Additional arguments.
|
kwargs: Additional arguments.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Agent: Agent object.
|
Agent: Agent object.
|
||||||
@ -1110,7 +1110,7 @@ class AgentExecutor(Chain):
|
|||||||
agent: Agent to use.
|
agent: Agent to use.
|
||||||
tools: Tools to use.
|
tools: Tools to use.
|
||||||
callbacks: Callbacks to use.
|
callbacks: Callbacks to use.
|
||||||
**kwargs: Additional arguments.
|
kwargs: Additional arguments.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
AgentExecutor: Agent executor object.
|
AgentExecutor: Agent executor object.
|
||||||
@ -1741,7 +1741,7 @@ class AgentExecutor(Chain):
|
|||||||
Args:
|
Args:
|
||||||
input: Input to the agent.
|
input: Input to the agent.
|
||||||
config: Config to use.
|
config: Config to use.
|
||||||
**kwargs: Additional arguments.
|
kwargs: Additional arguments.
|
||||||
|
|
||||||
Yields:
|
Yields:
|
||||||
AddableDict: Addable dictionary.
|
AddableDict: Addable dictionary.
|
||||||
@ -1772,7 +1772,7 @@ class AgentExecutor(Chain):
|
|||||||
Args:
|
Args:
|
||||||
input: Input to the agent.
|
input: Input to the agent.
|
||||||
config: Config to use.
|
config: Config to use.
|
||||||
**kwargs: Additional arguments.
|
kwargs: Additional arguments.
|
||||||
|
|
||||||
Yields:
|
Yields:
|
||||||
AddableDict: Addable dictionary.
|
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.
|
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 ]
|
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 ]
|
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:
|
Returns:
|
||||||
AgentExecutor: Returns a callable AgentExecutor object. Either you can call it or use run method with the query to get the response
|
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.
|
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 ]
|
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 ]
|
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:
|
Returns:
|
||||||
AgentExecutor: Returns a callable AgentExecutor object. Either you can call it or use run method with the query to get the response.
|
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.
|
agent_kwargs: Additional keyword arguments to pass to the underlying agent.
|
||||||
Defaults to None.
|
Defaults to None.
|
||||||
tags: Tags to apply to the traced runs. 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:
|
Returns:
|
||||||
An agent executor.
|
An agent executor.
|
||||||
|
@ -44,7 +44,7 @@ def load_agent_from_config(
|
|||||||
config: Config dict to load agent from.
|
config: Config dict to load agent from.
|
||||||
llm: Language model to use as the agent.
|
llm: Language model to use as the agent.
|
||||||
tools: List of tools this agent has access to.
|
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:
|
Returns:
|
||||||
An agent executor.
|
An agent executor.
|
||||||
@ -98,7 +98,7 @@ def load_agent(
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
path: Path to the agent file.
|
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:
|
Returns:
|
||||||
An agent executor.
|
An agent executor.
|
||||||
|
@ -128,7 +128,7 @@ class ZeroShotAgent(Agent):
|
|||||||
format_instructions: The format instructions to use.
|
format_instructions: The format instructions to use.
|
||||||
Defaults to FORMAT_INSTRUCTIONS.
|
Defaults to FORMAT_INSTRUCTIONS.
|
||||||
input_variables: The input variables to use. Defaults to None.
|
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)
|
cls._validate_tools(tools)
|
||||||
prompt = cls.create_prompt(
|
prompt = cls.create_prompt(
|
||||||
|
@ -261,7 +261,7 @@ class OpenAIAssistantRunnable(RunnableSerializable[Dict, OutputType]):
|
|||||||
model: Assistant model to use.
|
model: Assistant model to use.
|
||||||
client: OpenAI or AzureOpenAI client.
|
client: OpenAI or AzureOpenAI client.
|
||||||
Will create a default OpenAI client if not specified.
|
Will create a default OpenAI client if not specified.
|
||||||
**kwargs: Additional arguments.
|
kwargs: Additional arguments.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
OpenAIAssistantRunnable configured to run using the created assistant.
|
OpenAIAssistantRunnable configured to run using the created assistant.
|
||||||
@ -418,7 +418,7 @@ class OpenAIAssistantRunnable(RunnableSerializable[Dict, OutputType]):
|
|||||||
tools: Override Assistant tools for this run.
|
tools: Override Assistant tools for this run.
|
||||||
run_metadata: Metadata to associate with new run.
|
run_metadata: Metadata to associate with new run.
|
||||||
config: Runnable config. Defaults to None.
|
config: Runnable config. Defaults to None.
|
||||||
**kwargs: Additional arguments.
|
kwargs: Additional arguments.
|
||||||
|
|
||||||
Return:
|
Return:
|
||||||
If self.as_agent, will 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.
|
extra_prompt_messages: Extra prompt messages to use. Defaults to None.
|
||||||
system_message: The system message to use.
|
system_message: The system message to use.
|
||||||
Defaults to a default system message.
|
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(
|
prompt = cls.create_prompt(
|
||||||
extra_prompt_messages=extra_prompt_messages,
|
extra_prompt_messages=extra_prompt_messages,
|
||||||
|
@ -307,7 +307,7 @@ class OpenAIMultiFunctionsAgent(BaseMultiActionAgent):
|
|||||||
extra_prompt_messages: Extra prompt messages to use. Default is None.
|
extra_prompt_messages: Extra prompt messages to use. Default is None.
|
||||||
system_message: The system message to use.
|
system_message: The system message to use.
|
||||||
Default is a default system message.
|
Default is a default system message.
|
||||||
**kwargs: Additional arguments.
|
kwargs: Additional arguments.
|
||||||
"""
|
"""
|
||||||
prompt = cls.create_prompt(
|
prompt = cls.create_prompt(
|
||||||
extra_prompt_messages=extra_prompt_messages,
|
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`
|
combine_docs_chain_kwargs: Parameters to pass as kwargs to `load_qa_chain`
|
||||||
when constructing the combine_docs_chain.
|
when constructing the combine_docs_chain.
|
||||||
callbacks: Callbacks to pass to all subchains.
|
callbacks: Callbacks to pass to all subchains.
|
||||||
**kwargs: Additional parameters to pass when initializing
|
kwargs: Additional parameters to pass when initializing
|
||||||
ConversationalRetrievalChain
|
ConversationalRetrievalChain
|
||||||
"""
|
"""
|
||||||
combine_docs_chain_kwargs = combine_docs_chain_kwargs or {}
|
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.
|
answer_prompt: The prompt to use for answering user question given data.
|
||||||
query_output_parser: The output parser to use for parsing model-generated
|
query_output_parser: The output parser to use for parsing model-generated
|
||||||
ES query. Defaults to SimpleJsonOutputParser.
|
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_prompt = query_prompt or DSL_PROMPT
|
||||||
query_output_parser = query_output_parser or SimpleJsonOutputParser()
|
query_output_parser = query_output_parser or SimpleJsonOutputParser()
|
||||||
|
@ -245,7 +245,7 @@ class FlareChain(Chain):
|
|||||||
Args:
|
Args:
|
||||||
llm: Language model to use.
|
llm: Language model to use.
|
||||||
max_generation_len: Maximum length of the generated response.
|
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:
|
Returns:
|
||||||
FlareChain class with the given language model.
|
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.
|
enable_limit: Whether to enable the limit operator. Defaults to False.
|
||||||
schema_prompt: Prompt for describing query schema. Should have string input
|
schema_prompt: Prompt for describing query schema. Should have string input
|
||||||
variables allowed_comparators and allowed_operators.
|
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:
|
Returns:
|
||||||
A prompt template that can be used to construct queries.
|
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.
|
variables allowed_comparators and allowed_operators.
|
||||||
fix_invalid: Whether to fix invalid filter directives by ignoring invalid
|
fix_invalid: Whether to fix invalid filter directives by ignoring invalid
|
||||||
operators, comparators and attributes.
|
operators, comparators and attributes.
|
||||||
**kwargs: Additional named params to pass to FewShotPromptTemplate init.
|
kwargs: Additional named params to pass to FewShotPromptTemplate init.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
A Runnable that can be used to construct queries.
|
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 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
|
structured outputs then chain output is None. If False and model does not
|
||||||
return any structured outputs then chain output is an empty list.
|
return any structured outputs then chain output is an empty list.
|
||||||
**kwargs: Additional named arguments.
|
kwargs: Additional named arguments.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
A runnable sequence that will return a structured output(s) matching the given
|
A runnable sequence that will return a structured output(s) matching the given
|
||||||
|
@ -36,7 +36,7 @@ class JsonSchemaEvaluator(StringEvaluator):
|
|||||||
"""Initializes the JsonSchemaEvaluator.
|
"""Initializes the JsonSchemaEvaluator.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
**kwargs: Additional keyword arguments.
|
kwargs: Additional keyword arguments.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
ImportError: If the jsonschema package is not installed.
|
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.
|
prediction (str): The LLM or chain prediction to evaluate.
|
||||||
reference (Optional[str], optional): The reference label to evaluate against.
|
reference (Optional[str], optional): The reference label to evaluate against.
|
||||||
input (Optional[str], optional): The input to consider during evaluation.
|
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:
|
Returns:
|
||||||
dict: The evaluation results containing the score or value.
|
dict: The evaluation results containing the score or value.
|
||||||
It is recommended that the dictionary contain the following keys:
|
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.
|
prediction (str): The LLM or chain prediction to evaluate.
|
||||||
reference (Optional[str], optional): The reference label to evaluate against.
|
reference (Optional[str], optional): The reference label to evaluate against.
|
||||||
input (Optional[str], optional): The input to consider during evaluation.
|
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:
|
Returns:
|
||||||
dict: The evaluation results containing the score or value.
|
dict: The evaluation results containing the score or value.
|
||||||
It is recommended that the dictionary contain the following keys:
|
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.
|
prediction (str): The LLM or chain prediction to evaluate.
|
||||||
reference (Optional[str], optional): The reference label to evaluate against.
|
reference (Optional[str], optional): The reference label to evaluate against.
|
||||||
input (Optional[str], optional): The input to consider during evaluation.
|
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:
|
Returns:
|
||||||
dict: The evaluation results containing the score or value.
|
dict: The evaluation results containing the score or value.
|
||||||
""" # noqa: E501
|
""" # noqa: E501
|
||||||
@ -235,7 +235,7 @@ class StringEvaluator(_EvalArgsMixin, ABC):
|
|||||||
prediction (str): The LLM or chain prediction to evaluate.
|
prediction (str): The LLM or chain prediction to evaluate.
|
||||||
reference (Optional[str], optional): The reference label to evaluate against.
|
reference (Optional[str], optional): The reference label to evaluate against.
|
||||||
input (Optional[str], optional): The input to consider during evaluation.
|
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:
|
Returns:
|
||||||
dict: The evaluation results containing the score or value.
|
dict: The evaluation results containing the score or value.
|
||||||
""" # noqa: E501
|
""" # noqa: E501
|
||||||
@ -265,7 +265,7 @@ class PairwiseStringEvaluator(_EvalArgsMixin, ABC):
|
|||||||
prediction_b (str): The output string from the second model.
|
prediction_b (str): The output string from the second model.
|
||||||
reference (Optional[str], optional): The expected output / reference string.
|
reference (Optional[str], optional): The expected output / reference string.
|
||||||
input (Optional[str], optional): The input 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:
|
Returns:
|
||||||
dict: A dictionary containing the preference, scores, and/or other information.
|
dict: A dictionary containing the preference, scores, and/or other information.
|
||||||
""" # noqa: E501
|
""" # noqa: E501
|
||||||
@ -286,7 +286,7 @@ class PairwiseStringEvaluator(_EvalArgsMixin, ABC):
|
|||||||
prediction_b (str): The output string from the second model.
|
prediction_b (str): The output string from the second model.
|
||||||
reference (Optional[str], optional): The expected output / reference string.
|
reference (Optional[str], optional): The expected output / reference string.
|
||||||
input (Optional[str], optional): The input 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:
|
Returns:
|
||||||
dict: A dictionary containing the preference, scores, and/or other information.
|
dict: A dictionary containing the preference, scores, and/or other information.
|
||||||
""" # noqa: E501
|
""" # noqa: E501
|
||||||
@ -316,7 +316,7 @@ class PairwiseStringEvaluator(_EvalArgsMixin, ABC):
|
|||||||
prediction_b (str): The output string from the second model.
|
prediction_b (str): The output string from the second model.
|
||||||
reference (Optional[str], optional): The expected output / reference string.
|
reference (Optional[str], optional): The expected output / reference string.
|
||||||
input (Optional[str], optional): The input 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:
|
Returns:
|
||||||
dict: A dictionary containing the preference, scores, and/or other information.
|
dict: A dictionary containing the preference, scores, and/or other information.
|
||||||
""" # noqa: E501
|
""" # noqa: E501
|
||||||
@ -345,7 +345,7 @@ class PairwiseStringEvaluator(_EvalArgsMixin, ABC):
|
|||||||
prediction_b (str): The output string from the second model.
|
prediction_b (str): The output string from the second model.
|
||||||
reference (Optional[str], optional): The expected output / reference string.
|
reference (Optional[str], optional): The expected output / reference string.
|
||||||
input (Optional[str], optional): The input 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:
|
Returns:
|
||||||
dict: A dictionary containing the preference, scores, and/or other information.
|
dict: A dictionary containing the preference, scores, and/or other information.
|
||||||
""" # noqa: E501
|
""" # noqa: E501
|
||||||
|
@ -278,7 +278,7 @@ class StringDistanceEvalChain(StringEvaluator, _RapidFuzzChainMixin):
|
|||||||
reference (Optional[str], optional): The reference string.
|
reference (Optional[str], optional): The reference string.
|
||||||
input (Optional[str], optional): The input string.
|
input (Optional[str], optional): The input string.
|
||||||
callbacks (Callbacks, optional): The callbacks to use.
|
callbacks (Callbacks, optional): The callbacks to use.
|
||||||
**kwargs: Additional keyword arguments.
|
kwargs: Additional keyword arguments.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
dict: The evaluation results containing the score.
|
dict: The evaluation results containing the score.
|
||||||
@ -314,7 +314,7 @@ class StringDistanceEvalChain(StringEvaluator, _RapidFuzzChainMixin):
|
|||||||
reference (Optional[str], optional): The reference string.
|
reference (Optional[str], optional): The reference string.
|
||||||
input (Optional[str], optional): The input string.
|
input (Optional[str], optional): The input string.
|
||||||
callbacks (Callbacks, optional): The callbacks to use.
|
callbacks (Callbacks, optional): The callbacks to use.
|
||||||
**kwargs: Additional keyword arguments.
|
kwargs: Additional keyword arguments.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
dict: The evaluation results containing the score.
|
dict: The evaluation results containing the score.
|
||||||
@ -412,7 +412,7 @@ class PairwiseStringDistanceEvalChain(PairwiseStringEvaluator, _RapidFuzzChainMi
|
|||||||
callbacks (Callbacks, optional): The callbacks to use.
|
callbacks (Callbacks, optional): The callbacks to use.
|
||||||
tags (List[str], optional): Tags to apply to traces.
|
tags (List[str], optional): Tags to apply to traces.
|
||||||
metadata (Dict[str, Any], optional): Metadata to apply to traces.
|
metadata (Dict[str, Any], optional): Metadata to apply to traces.
|
||||||
**kwargs: Additional keyword arguments.
|
kwargs: Additional keyword arguments.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
dict: The evaluation results containing the score.
|
dict: The evaluation results containing the score.
|
||||||
@ -446,7 +446,7 @@ class PairwiseStringDistanceEvalChain(PairwiseStringEvaluator, _RapidFuzzChainMi
|
|||||||
callbacks (Callbacks, optional): The callbacks to use.
|
callbacks (Callbacks, optional): The callbacks to use.
|
||||||
tags (List[str], optional): Tags to apply to traces.
|
tags (List[str], optional): Tags to apply to traces.
|
||||||
metadata (Dict[str, Any], optional): Metadata to apply to traces.
|
metadata (Dict[str, Any], optional): Metadata to apply to traces.
|
||||||
**kwargs: Additional keyword arguments.
|
kwargs: Additional keyword arguments.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
dict: The evaluation results containing the score.
|
dict: The evaluation results containing the score.
|
||||||
|
@ -104,7 +104,7 @@ class LLMChainFilter(BaseDocumentCompressor):
|
|||||||
Args:
|
Args:
|
||||||
llm: The language model to use for filtering.
|
llm: The language model to use for filtering.
|
||||||
prompt: The prompt to use for the filter.
|
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:
|
Returns:
|
||||||
A LLMChainFilter that uses the given language model.
|
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
|
llm: The language model to use for filtering. **Must implement
|
||||||
BaseLanguageModel.with_structured_output().**
|
BaseLanguageModel.with_structured_output().**
|
||||||
prompt: The prompt to use for the filter.
|
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:
|
Returns:
|
||||||
A LLMListwiseRerank document compressor that uses the given language model.
|
A LLMListwiseRerank document compressor that uses the given language model.
|
||||||
|
@ -250,7 +250,7 @@ class Chroma(VectorStore):
|
|||||||
e.g. {"color" : "red", "price": 4.20}.
|
e.g. {"color" : "red", "price": 4.20}.
|
||||||
where_document: dict used to filter by the documents.
|
where_document: dict used to filter by the documents.
|
||||||
E.g. {$contains: {"text": "hello"}}.
|
E.g. {$contains: {"text": "hello"}}.
|
||||||
**kwargs: Additional keyword arguments to pass to Chroma collection query.
|
kwargs: Additional keyword arguments to pass to Chroma collection query.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
List of `n_results` nearest neighbor embeddings for provided
|
List of `n_results` nearest neighbor embeddings for provided
|
||||||
@ -286,7 +286,7 @@ class Chroma(VectorStore):
|
|||||||
metadatas: Optional list of metadatas.
|
metadatas: Optional list of metadatas.
|
||||||
When querying, you can filter on this metadata.
|
When querying, you can filter on this metadata.
|
||||||
ids: Optional list of IDs.
|
ids: Optional list of IDs.
|
||||||
**kwargs: Additional keyword arguments to pass.
|
kwargs: Additional keyword arguments to pass.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
List of IDs of the added images.
|
List of IDs of the added images.
|
||||||
@ -374,7 +374,7 @@ class Chroma(VectorStore):
|
|||||||
metadatas: Optional list of metadatas.
|
metadatas: Optional list of metadatas.
|
||||||
When querying, you can filter on this metadata.
|
When querying, you can filter on this metadata.
|
||||||
ids: Optional list of IDs.
|
ids: Optional list of IDs.
|
||||||
**kwargs: Additional keyword arguments.
|
kwargs: Additional keyword arguments.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
List of IDs of the added texts.
|
List of IDs of the added texts.
|
||||||
@ -456,7 +456,7 @@ class Chroma(VectorStore):
|
|||||||
query: Query text to search for.
|
query: Query text to search for.
|
||||||
k: Number of results to return. Defaults to 4.
|
k: Number of results to return. Defaults to 4.
|
||||||
filter: Filter by metadata. Defaults to None.
|
filter: Filter by metadata. Defaults to None.
|
||||||
**kwargs: Additional keyword arguments to pass to Chroma collection query.
|
kwargs: Additional keyword arguments to pass to Chroma collection query.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
List of documents most similar to the query text.
|
List of documents most similar to the query text.
|
||||||
@ -482,7 +482,7 @@ class Chroma(VectorStore):
|
|||||||
filter: Filter by metadata. Defaults to None.
|
filter: Filter by metadata. Defaults to None.
|
||||||
where_document: dict used to filter by the documents.
|
where_document: dict used to filter by the documents.
|
||||||
E.g. {$contains: {"text": "hello"}}.
|
E.g. {$contains: {"text": "hello"}}.
|
||||||
**kwargs: Additional keyword arguments to pass to Chroma collection query.
|
kwargs: Additional keyword arguments to pass to Chroma collection query.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
List of Documents most similar to the query vector.
|
List of Documents most similar to the query vector.
|
||||||
@ -512,7 +512,7 @@ class Chroma(VectorStore):
|
|||||||
filter: Filter by metadata. Defaults to None.
|
filter: Filter by metadata. Defaults to None.
|
||||||
where_document: dict used to filter by the documents.
|
where_document: dict used to filter by the documents.
|
||||||
E.g. {$contains: {"text": "hello"}}.
|
E.g. {$contains: {"text": "hello"}}.
|
||||||
**kwargs: Additional keyword arguments to pass to Chroma collection query.
|
kwargs: Additional keyword arguments to pass to Chroma collection query.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
List of documents most similar to the query text and relevance score
|
List of documents most similar to the query text and relevance score
|
||||||
@ -543,7 +543,7 @@ class Chroma(VectorStore):
|
|||||||
filter: Filter by metadata. Defaults to None.
|
filter: Filter by metadata. Defaults to None.
|
||||||
where_document: dict used to filter by the documents.
|
where_document: dict used to filter by the documents.
|
||||||
E.g. {$contains: {"text": "hello"}}.
|
E.g. {$contains: {"text": "hello"}}.
|
||||||
**kwargs: Additional keyword arguments to pass to Chroma collection query.
|
kwargs: Additional keyword arguments to pass to Chroma collection query.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
List of documents most similar to the query text and
|
List of documents most similar to the query text and
|
||||||
@ -722,7 +722,7 @@ class Chroma(VectorStore):
|
|||||||
filter: Filter by metadata. Defaults to None.
|
filter: Filter by metadata. Defaults to None.
|
||||||
where_document: dict used to filter by the documents.
|
where_document: dict used to filter by the documents.
|
||||||
E.g. {$contains: {"text": "hello"}}.
|
E.g. {$contains: {"text": "hello"}}.
|
||||||
**kwargs: Additional keyword arguments to pass to Chroma collection query.
|
kwargs: Additional keyword arguments to pass to Chroma collection query.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
List of Documents selected by maximal marginal relevance.
|
List of Documents selected by maximal marginal relevance.
|
||||||
@ -773,7 +773,7 @@ class Chroma(VectorStore):
|
|||||||
filter: Filter by metadata. Defaults to None.
|
filter: Filter by metadata. Defaults to None.
|
||||||
where_document: dict used to filter by the documents.
|
where_document: dict used to filter by the documents.
|
||||||
E.g. {$contains: {"text": "hello"}}.
|
E.g. {$contains: {"text": "hello"}}.
|
||||||
**kwargs: Additional keyword arguments to pass to Chroma collection query.
|
kwargs: Additional keyword arguments to pass to Chroma collection query.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
List of Documents selected by maximal marginal relevance.
|
List of Documents selected by maximal marginal relevance.
|
||||||
@ -935,7 +935,7 @@ class Chroma(VectorStore):
|
|||||||
https://docs.trychroma.com/reference/js-client#class:-chromaclient
|
https://docs.trychroma.com/reference/js-client#class:-chromaclient
|
||||||
collection_metadata: Collection configurations.
|
collection_metadata: Collection configurations.
|
||||||
Defaults to None.
|
Defaults to None.
|
||||||
**kwargs: Additional keyword arguments to initialize a Chroma client.
|
kwargs: Additional keyword arguments to initialize a Chroma client.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Chroma: Chroma vectorstore.
|
Chroma: Chroma vectorstore.
|
||||||
@ -1000,7 +1000,7 @@ class Chroma(VectorStore):
|
|||||||
https://docs.trychroma.com/reference/js-client#class:-chromaclient
|
https://docs.trychroma.com/reference/js-client#class:-chromaclient
|
||||||
collection_metadata: Collection configurations.
|
collection_metadata: Collection configurations.
|
||||||
Defaults to None.
|
Defaults to None.
|
||||||
**kwargs: Additional keyword arguments to initialize a Chroma client.
|
kwargs: Additional keyword arguments to initialize a Chroma client.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Chroma: Chroma vectorstore.
|
Chroma: Chroma vectorstore.
|
||||||
@ -1025,6 +1025,6 @@ class Chroma(VectorStore):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
ids: List of ids to delete.
|
ids: List of ids to delete.
|
||||||
**kwargs: Additional keyword arguments.
|
kwargs: Additional keyword arguments.
|
||||||
"""
|
"""
|
||||||
self._collection.delete(ids=ids)
|
self._collection.delete(ids=ids)
|
||||||
|
@ -34,7 +34,7 @@ class FastEmbedSparse(SparseEmbeddings):
|
|||||||
If `None`, don't use data-parallel processing,\
|
If `None`, don't use data-parallel processing,\
|
||||||
use default onnxruntime threading instead.\
|
use default onnxruntime threading instead.\
|
||||||
Defaults to None.
|
Defaults to None.
|
||||||
**kwargs: Additional options to pass to fastembed.SparseTextEmbedding
|
kwargs: Additional options to pass to fastembed.SparseTextEmbedding
|
||||||
Raises:
|
Raises:
|
||||||
ValueError: If the model_name is not supported in SparseTextEmbedding.
|
ValueError: If the model_name is not supported in SparseTextEmbedding.
|
||||||
"""
|
"""
|
||||||
|
@ -135,7 +135,7 @@ class Together(LLM):
|
|||||||
prompt: The prompt to pass into the model.
|
prompt: The prompt to pass into the model.
|
||||||
stop: Optional list of stop words to use when generating.
|
stop: Optional list of stop words to use when generating.
|
||||||
run_manager: The CallbackManager for LLM run, it's not used at the moment.
|
run_manager: The CallbackManager for LLM run, it's not used at the moment.
|
||||||
**kwargs: Additional parameters to pass to the model.
|
kwargs: Additional parameters to pass to the model.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
The string generated by the model..
|
The string generated by the model..
|
||||||
@ -185,7 +185,7 @@ class Together(LLM):
|
|||||||
prompt: The prompt to pass into the model.
|
prompt: The prompt to pass into the model.
|
||||||
stop: Optional list of stop words to use when generating.
|
stop: Optional list of stop words to use when generating.
|
||||||
run_manager: The CallbackManager for LLM run, it's not used at the moment.
|
run_manager: The CallbackManager for LLM run, it's not used at the moment.
|
||||||
**kwargs: Additional parameters to pass to the model.
|
kwargs: Additional parameters to pass to the model.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
The string generated by the model.
|
The string generated by the model.
|
||||||
|
Loading…
Reference in New Issue
Block a user