id
stringlengths
14
15
text
stringlengths
13
2.7k
source
stringlengths
60
181
edf0b9e534d9-11
Return docs most similar to embedding vector and similarity score. Parameters embedding (List[float]) – Embedding to look up documents similar to. k (int) – Number of Documents to return. Defaults to 4. filter (Optional[Dict[str, str]]) – Filter by metadata. Defaults to None. Returns List of documents most similar to t...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.chroma.Chroma.html
edf0b9e534d9-12
Lower score represents more similarity. Return type List[Tuple[Document, float]] update_document(document_id: str, document: Document) → None[source]¶ Update a document in the collection. Parameters document_id (str) – ID of the document to update. document (Document) – Document to update. update_documents(ids: List[st...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.chroma.Chroma.html
eec47f0e734d-0
langchain_community.vectorstores.elasticsearch.SparseRetrievalStrategy¶ class langchain_community.vectorstores.elasticsearch.SparseRetrievalStrategy(model_id: Optional[str] = None)[source]¶ Sparse retrieval strategy using the text_expansion processor. Methods __init__([model_id]) before_index_setup(client, text_field, ...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.elasticsearch.SparseRetrievalStrategy.html
eec47f0e734d-1
Returns The Elasticsearch settings and mappings for the strategy. Return type Dict query(query_vector: Optional[List[float]], query: Optional[str], k: int, fetch_k: int, vector_query_field: str, text_field: str, filter: List[dict], similarity: Optional[DistanceStrategy]) → Dict[source]¶ Executes when a search is perfor...
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.elasticsearch.SparseRetrievalStrategy.html
204caab47e69-0
langchain.model_laboratory.ModelLaboratory¶ class langchain.model_laboratory.ModelLaboratory(chains: Sequence[Chain], names: Optional[List[str]] = None)[source]¶ Experiment with different models. Initialize with chains to experiment with. Parameters chains – list of chains to experiment with. Methods __init__(chains[, ...
https://api.python.langchain.com/en/latest/model_laboratory/langchain.model_laboratory.ModelLaboratory.html
0501cdffd359-0
langchain_experimental.graph_transformers.diffbot.format_property_key¶ langchain_experimental.graph_transformers.diffbot.format_property_key(s: str) → str[source]¶
https://api.python.langchain.com/en/latest/graph_transformers/langchain_experimental.graph_transformers.diffbot.format_property_key.html
6dd39c206280-0
langchain_experimental.graph_transformers.diffbot.SimplifiedSchema¶ class langchain_experimental.graph_transformers.diffbot.SimplifiedSchema[source]¶ Provides functionality for working with a simplified schema mapping. schema¶ A dictionary containing the mapping to simplified schema types. Type Dict Initializes the sch...
https://api.python.langchain.com/en/latest/graph_transformers/langchain_experimental.graph_transformers.diffbot.SimplifiedSchema.html
0f91e19c7287-0
langchain_experimental.graph_transformers.diffbot.DiffbotGraphTransformer¶ class langchain_experimental.graph_transformers.diffbot.DiffbotGraphTransformer(diffbot_api_key: Optional[str] = None, fact_confidence_threshold: float = 0.7, include_qualifiers: bool = True, include_evidence: bool = True, simplified_schema: boo...
https://api.python.langchain.com/en/latest/graph_transformers/langchain_experimental.graph_transformers.diffbot.DiffbotGraphTransformer.html
0f91e19c7287-1
nlp_request(text) Make an API request to the Diffbot NLP endpoint. process_response(payload, document) Transform the Diffbot NLP response into a GraphDocument. __init__(diffbot_api_key: Optional[str] = None, fact_confidence_threshold: float = 0.7, include_qualifiers: bool = True, include_evidence: bool = True, simplifi...
https://api.python.langchain.com/en/latest/graph_transformers/langchain_experimental.graph_transformers.diffbot.DiffbotGraphTransformer.html
0f91e19c7287-2
document (Document) – The original document. Returns The transformed document as a graph. Return type GraphDocument
https://api.python.langchain.com/en/latest/graph_transformers/langchain_experimental.graph_transformers.diffbot.DiffbotGraphTransformer.html
4e3312b12c48-0
langchain_experimental.graph_transformers.diffbot.NodesList¶ class langchain_experimental.graph_transformers.diffbot.NodesList[source]¶ Manages a list of nodes with associated properties. nodes¶ Stores nodes as keys and their properties as values. Each key is a tuple where the first element is the node ID and the secon...
https://api.python.langchain.com/en/latest/graph_transformers/langchain_experimental.graph_transformers.diffbot.NodesList.html
16d42e62a3c9-0
langchain_experimental.sql.base.SQLDatabaseChain¶ class langchain_experimental.sql.base.SQLDatabaseChain[source]¶ Bases: Chain Chain for interacting with SQL Database. Example from langchain_experimental.sql import SQLDatabaseChain from langchain.llms import OpenAI, SQLDatabase db = SQLDatabase(...) db_chain = SQLDatab...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseChain.html
16d42e62a3c9-1
param memory: Optional[BaseMemory] = None¶ Optional memory object. Defaults to None. Memory is a class that gets called at the start and at the end of every chain. At the start, memory loads variables and passes them along in the chain. At the end, it saves any returned variables. There are many different types of memo...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseChain.html
16d42e62a3c9-2
to fix the initial SQL from the LLM. param verbose: bool [Optional]¶ Whether or not run in verbose mode. In verbose mode, some intermediate logs will be printed to the console. Defaults to the global verbose value, accessible via langchain.globals.get_verbose(). __call__(inputs: Union[Dict[str, Any], Any], return_only_...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseChain.html
16d42e62a3c9-3
Returns A dict of named outputs. Should contain all outputs specified inChain.output_keys. async abatch(inputs: List[Input], config: Optional[Union[RunnableConfig, List[RunnableConfig]]] = None, *, return_exceptions: bool = False, **kwargs: Optional[Any]) → List[Output]¶ Default implementation runs ainvoke in parallel ...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseChain.html
16d42e62a3c9-4
addition to tags passed to the chain during construction, but only these runtime tags will propagate to calls to other objects. metadata – Optional metadata associated with the chain. Defaults to None include_run_info – Whether to include run info in the response. Defaults to False. Returns A dict of named outputs. Sho...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseChain.html
16d42e62a3c9-5
these runtime callbacks will propagate to calls to other objects. tags – List of string tags to pass to all callbacks. These will be passed in addition to tags passed to the chain during construction, but only these runtime tags will propagate to calls to other objects. **kwargs – If the chain expects multiple inputs, ...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseChain.html
16d42e62a3c9-6
Stream all output from a runnable, as reported to the callback system. This includes all inner runs of LLMs, Retrievers, Tools, etc. Output is streamed as Log objects, which include a list of jsonpatch ops that describe how the state of the run has changed in each step, and the final state of the run. The jsonpatch ops...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseChain.html
16d42e62a3c9-7
bind(**kwargs: Any) → Runnable[Input, Output]¶ Bind arguments to a Runnable, returning a new Runnable. config_schema(*, include: Optional[Sequence[str]] = None) → Type[BaseModel]¶ The type of config this runnable accepts specified as a pydantic model. To mark a field as configurable, see the configurable_fields and con...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseChain.html
16d42e62a3c9-8
exclude – fields to exclude from new model, as with values this takes precedence over include update – values to change/add in the new model. Note: the data is not validated before creating the new model: you should trust this data deep – set to True to make a deep copy of the model Returns new model instance dict(**kw...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseChain.html
16d42e62a3c9-9
Runnables that leverage the configurable_fields and configurable_alternatives methods will have a dynamic input schema that depends on which configuration the runnable is invoked with. This method allows to get an input schema for a specific configuration. Parameters config – A config to use when generating the schema....
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseChain.html
16d42e62a3c9-10
classmethod is_lc_serializable() → bool¶ Is this class serializable? json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defa...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseChain.html
16d42e62a3c9-11
Parameters inputs – Dictionary of raw inputs, or single input if chain expects only one param. Should contain all inputs specified in Chain.input_keys except for inputs that will be set by the chain’s memory. Returns A dictionary of all inputs, including those added by the chain’s memory. prep_outputs(inputs: Dict[str,...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseChain.html
16d42e62a3c9-12
these runtime tags will propagate to calls to other objects. **kwargs – If the chain expects multiple inputs, they can be passed in directly as keyword arguments. Returns The chain output. Example # Suppose we have a single-input chain that takes a 'question' string: chain.run("What's the temperature in Boise, Idaho?")...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseChain.html
16d42e62a3c9-13
Default implementation of transform, which buffers input and then calls stream. Subclasses should override this method if they can start producing output while input is still being generated. classmethod update_forward_refs(**localns: Any) → None¶ Try to update ForwardRefs on fields based on this Model, globalns and lo...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseChain.html
16d42e62a3c9-14
added to the run. with_retry(*, retry_if_exception_type: ~typing.Tuple[~typing.Type[BaseException], ...] = (<class 'Exception'>,), wait_exponential_jitter: bool = True, stop_after_attempt: int = 3) → Runnable[Input, Output]¶ Create a new Runnable that retries the original runnable on exceptions. Parameters retry_if_exc...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseChain.html
16d42e62a3c9-15
property output_schema: Type[pydantic.main.BaseModel]¶ The type of output this runnable produces specified as a pydantic model.
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseChain.html
61900984419a-0
langchain_experimental.sql.base.SQLDatabaseSequentialChain¶ class langchain_experimental.sql.base.SQLDatabaseSequentialChain[source]¶ Bases: Chain Chain for querying SQL database that is a sequential chain. The chain is as follows: 1. Based on the query, determine which tables to use. 2. Based on those tables, call the...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseSequentialChain.html
61900984419a-1
You can use these to eg identify a specific instance of a chain with its use case. param return_intermediate_steps: bool = False¶ param sql_chain: SQLDatabaseChain [Required]¶ param tags: Optional[List[str]] = None¶ Optional list of tags associated with the chain. Defaults to None. These tags will be associated with ea...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseSequentialChain.html
61900984419a-2
these runtime callbacks will propagate to calls to other objects. tags – List of string tags to pass to all callbacks. These will be passed in addition to tags passed to the chain during construction, but only these runtime tags will propagate to calls to other objects. metadata – Optional metadata associated with the ...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseSequentialChain.html
61900984419a-3
returned. If False, both input keys and new keys generated by this chain will be returned. Defaults to False. callbacks – Callbacks to use for this chain run. These will be called in addition to callbacks passed to the chain during construction, but only these runtime callbacks will propagate to calls to other objects....
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseSequentialChain.html
61900984419a-4
method expects inputs to be passed directly in as positional arguments or keyword arguments, whereas Chain.__call__ expects a single input dictionary with all the inputs Parameters *args – If the chain expects a single input, it can be passed in as the sole positional argument. callbacks – Callbacks to use for this cha...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseSequentialChain.html
61900984419a-5
Subclasses should override this method if they support streaming output. async astream_log(input: Any, config: Optional[RunnableConfig] = None, *, diff: bool = True, with_streamed_output_list: bool = True, include_names: Optional[Sequence[str]] = None, include_types: Optional[Sequence[str]] = None, include_tags: Option...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseSequentialChain.html
61900984419a-6
Default implementation of atransform, which buffers input and calls astream. Subclasses should override this method if they can start producing output while input is still being generated. batch(inputs: List[Input], config: Optional[Union[RunnableConfig, List[RunnableConfig]]] = None, *, return_exceptions: bool = False...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseSequentialChain.html
61900984419a-7
Default values are respected, but no other validation is performed. Behaves as if Config.extra = ‘allow’ was set since it adds all passed values copy(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, update: Optional[DictStrAny...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseSequentialChain.html
61900984419a-8
# -> {"_type": "foo", "verbose": False, ...} classmethod from_llm(llm: BaseLanguageModel, db: SQLDatabase, query_prompt: BasePromptTemplate = PromptTemplate(input_variables=['dialect', 'input', 'table_info', 'top_k'], template='Given an input question, first create a syntactically correct {dialect} query to run, then l...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseSequentialChain.html
61900984419a-9
Load the necessary chains. classmethod from_orm(obj: Any) → Model¶ get_input_schema(config: Optional[RunnableConfig] = None) → Type[BaseModel]¶ Get a pydantic model that can be used to validate input to the runnable. Runnables that leverage the configurable_fields and configurable_alternatives methods will have a dynam...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseSequentialChain.html
61900984419a-10
The config supports standard keys like ‘tags’, ‘metadata’ for tracing purposes, ‘max_concurrency’ for controlling how much work to do in parallel, and other keys. Please refer to the RunnableConfig for more details. Returns The output of the runnable. classmethod is_lc_serializable() → bool¶ Is this class serializable?...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseSequentialChain.html
61900984419a-11
classmethod parse_obj(obj: Any) → Model¶ classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) → Model¶ prep_inputs(inputs: Union[Dict[str, Any], Any]) → Dict[str, str]¶ Validate and prepare chain inputs, including ad...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseSequentialChain.html
61900984419a-12
sole positional argument. callbacks – Callbacks to use for this chain run. These will be called in addition to callbacks passed to the chain during construction, but only these runtime callbacks will propagate to calls to other objects. tags – List of string tags to pass to all callbacks. These will be passed in additi...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseSequentialChain.html
61900984419a-13
Default implementation of stream, which calls invoke. Subclasses should override this method if they support streaming output. to_json() → Union[SerializedConstructor, SerializedNotImplemented]¶ to_json_not_implemented() → SerializedNotImplemented¶ transform(input: Iterator[Input], config: Optional[RunnableConfig] = No...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseSequentialChain.html
61900984419a-14
on_start: Called before the runnable starts running, with the Run object. on_end: Called after the runnable finishes running, with the Run object. on_error: Called if the runnable throws an error, with the Run object. The Run object contains information about the run, including its id, type, input, output, error, start...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseSequentialChain.html
61900984419a-15
The type of input this runnable accepts specified as a pydantic model. property lc_attributes: Dict¶ List of attribute names that should be included in the serialized kwargs. These attributes must be accepted by the constructor. property lc_secrets: Dict[str, str]¶ A map of constructor argument names to secret ids. For...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseSequentialChain.html
cad9420c5294-0
langchain_experimental.sql.vector_sql.VectorSQLDatabaseChain¶ class langchain_experimental.sql.vector_sql.VectorSQLDatabaseChain[source]¶ Bases: SQLDatabaseChain Chain for interacting with Vector SQL Database. Example from langchain_experimental.sql import SQLDatabaseChain from langchain.llms import OpenAI, SQLDatabase...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLDatabaseChain.html
cad9420c5294-1
param llm_chain: LLMChain [Required]¶ param memory: Optional[BaseMemory] = None¶ Optional memory object. Defaults to None. Memory is a class that gets called at the start and at the end of every chain. At the start, memory loads variables and passes them along in the chain. At the end, it saves any returned variables. ...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLDatabaseChain.html
cad9420c5294-2
and passed as arguments to the handlers defined in callbacks. You can use these to eg identify a specific instance of a chain with its use case. param top_k: int = 5¶ Number of results to return from the query param use_query_checker: bool = False¶ Whether or not the query checker tool should be used to attempt to fix ...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLDatabaseChain.html
cad9420c5294-3
addition to tags passed to the chain during construction, but only these runtime tags will propagate to calls to other objects. metadata – Optional metadata associated with the chain. Defaults to None include_run_info – Whether to include run info in the response. Defaults to False. Returns A dict of named outputs. Sho...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLDatabaseChain.html
cad9420c5294-4
callbacks – Callbacks to use for this chain run. These will be called in addition to callbacks passed to the chain during construction, but only these runtime callbacks will propagate to calls to other objects. tags – List of string tags to pass to all callbacks. These will be passed in addition to tags passed to the c...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLDatabaseChain.html
cad9420c5294-5
with all the inputs Parameters *args – If the chain expects a single input, it can be passed in as the sole positional argument. callbacks – Callbacks to use for this chain run. These will be called in addition to callbacks passed to the chain during construction, but only these runtime callbacks will propagate to call...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLDatabaseChain.html
cad9420c5294-6
Subclasses should override this method if they support streaming output. async astream_log(input: Any, config: Optional[RunnableConfig] = None, *, diff: bool = True, with_streamed_output_list: bool = True, include_names: Optional[Sequence[str]] = None, include_types: Optional[Sequence[str]] = None, include_tags: Option...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLDatabaseChain.html
cad9420c5294-7
Default implementation of atransform, which buffers input and calls astream. Subclasses should override this method if they can start producing output while input is still being generated. batch(inputs: List[Input], config: Optional[Union[RunnableConfig, List[RunnableConfig]]] = None, *, return_exceptions: bool = False...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLDatabaseChain.html
cad9420c5294-8
Default values are respected, but no other validation is performed. Behaves as if Config.extra = ‘allow’ was set since it adds all passed values copy(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, update: Optional[DictStrAny...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLDatabaseChain.html
cad9420c5294-9
Failure to do so may result in data corruption or loss, since this chain may attempt commands like DROP TABLE or INSERT if appropriately prompted. The best way to guard against such negative outcomes is to (as appropriate) limit the permissions granted to the credentials used with this chain. This issue shows an exampl...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLDatabaseChain.html
cad9420c5294-10
Returns A pydantic model that can be used to validate output. invoke(input: Dict[str, Any], config: Optional[RunnableConfig] = None, **kwargs: Any) → Dict[str, Any]¶ Transform a single input into an output. Override to implement. Parameters input – The input to the runnable. config – A config to use when invoking the r...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLDatabaseChain.html
cad9420c5294-11
by calling invoke() with each input. classmethod parse_file(path: Union[str, Path], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) → Model¶ classmethod parse_obj(obj: Any) → Model¶ classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = No...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLDatabaseChain.html
cad9420c5294-12
The main difference between this method and Chain.__call__ is that this method expects inputs to be passed directly in as positional arguments or keyword arguments, whereas Chain.__call__ expects a single input dictionary with all the inputs Parameters *args – If the chain expects a single input, it can be passed in as...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLDatabaseChain.html
cad9420c5294-13
classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) → unicode¶ stream(input: Input, config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) → Iterator[Output]¶ Default implementation of stream, which calls invoke. Subclasses should override t...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLDatabaseChain.html
cad9420c5294-14
fallback in order, upon failures. with_listeners(*, on_start: Optional[Listener] = None, on_end: Optional[Listener] = None, on_error: Optional[Listener] = None) → Runnable[Input, Output]¶ Bind lifecycle listeners to a Runnable, returning a new Runnable. on_start: Called before the runnable starts running, with the Run ...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLDatabaseChain.html
cad9420c5294-15
property OutputType: Type[langchain_core.runnables.utils.Output]¶ The type of output this runnable produces specified as a type annotation. property config_specs: List[langchain_core.runnables.utils.ConfigurableFieldSpec]¶ List configurable fields for this runnable. property input_schema: Type[pydantic.main.BaseModel]¶...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLDatabaseChain.html
a4004c88c62b-0
langchain_experimental.sql.vector_sql.VectorSQLOutputParser¶ class langchain_experimental.sql.vector_sql.VectorSQLOutputParser[source]¶ Bases: BaseOutputParser[str] Output Parser for Vector SQL 1. finds for NeuralArray() and replace it with the embedding 2. finds for DISTANCE() and replace it with the distance name in ...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLOutputParser.html
a4004c88c62b-1
Parse a list of candidate model Generations into a specific format. The return value is parsed from only the first Generation in the result, whichis assumed to be the highest-likelihood Generation. Parameters result – A list of Generations to be parsed. The Generations are assumed to be different candidate outputs for ...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLOutputParser.html
a4004c88c62b-2
with_streamed_output_list – Whether to yield the streamed_output list. include_names – Only include logs with these names. include_types – Only include logs with these types. include_tags – Only include logs with these tags. exclude_names – Exclude logs with these names. exclude_types – Exclude logs with these types. e...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLOutputParser.html
a4004c88c62b-3
Returns A pydantic model that can be used to validate config. configurable_alternatives(which: ConfigurableField, *, default_key: str = 'default', prefix_keys: bool = False, **kwargs: Union[Runnable[Input, Output], Callable[[], Runnable[Input, Output]]]) → RunnableSerializable[Input, Output]¶ configurable_fields(**kwar...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLOutputParser.html
a4004c88c62b-4
classmethod from_orm(obj: Any) → Model¶ get_format_instructions() → str¶ Instructions on how the LLM output should be formatted. get_input_schema(config: Optional[RunnableConfig] = None) → Type[BaseModel]¶ Get a pydantic model that can be used to validate input to the runnable. Runnables that leverage the configurable_...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLOutputParser.html
a4004c88c62b-5
The config supports standard keys like ‘tags’, ‘metadata’ for tracing purposes, ‘max_concurrency’ for controlling how much work to do in parallel, and other keys. Please refer to the RunnableConfig for more details. Returns The output of the runnable. classmethod is_lc_serializable() → bool¶ Is this class serializable?...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLOutputParser.html
a4004c88c62b-6
classmethod parse_obj(obj: Any) → Model¶ classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) → Model¶ parse_result(result: List[Generation], *, partial: bool = False) → T¶ Parse a list of candidate model Generations...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLOutputParser.html
a4004c88c62b-7
to_json_not_implemented() → SerializedNotImplemented¶ transform(input: Iterator[Input], config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) → Iterator[Output]¶ Default implementation of transform, which buffers input and then calls stream. Subclasses should override this method if they can start producing...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLOutputParser.html
a4004c88c62b-8
The Run object contains information about the run, including its id, type, input, output, error, start_time, end_time, and any tags or metadata added to the run. with_retry(*, retry_if_exception_type: ~typing.Tuple[~typing.Type[BaseException], ...] = (<class 'Exception'>,), wait_exponential_jitter: bool = True, stop_af...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLOutputParser.html
a4004c88c62b-9
A map of constructor argument names to secret ids. For example,{“openai_api_key”: “OPENAI_API_KEY”} property output_schema: Type[pydantic.main.BaseModel]¶ The type of output this runnable produces specified as a pydantic model.
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLOutputParser.html
294558ddf9d4-0
langchain_experimental.sql.vector_sql.get_result_from_sqldb¶ langchain_experimental.sql.vector_sql.get_result_from_sqldb(db: SQLDatabase, cmd: str) → Sequence[Dict[str, Any]][source]¶
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.get_result_from_sqldb.html
4111ad1a02b9-0
langchain_experimental.sql.vector_sql.VectorSQLRetrieveAllOutputParser¶ class langchain_experimental.sql.vector_sql.VectorSQLRetrieveAllOutputParser[source]¶ Bases: VectorSQLOutputParser Based on VectorSQLOutputParser It also modify the SQL to get all columns param distance_func_name: str = 'distance'¶ Distance name fo...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLRetrieveAllOutputParser.html
4111ad1a02b9-1
Parameters result – A list of Generations to be parsed. The Generations are assumed to be different candidate outputs for a single model input. Returns Structured output. async astream(input: Input, config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) → AsyncIterator[Output]¶ Default implementation of astr...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLRetrieveAllOutputParser.html
4111ad1a02b9-2
include_tags – Only include logs with these tags. exclude_names – Exclude logs with these names. exclude_types – Exclude logs with these types. exclude_tags – Exclude logs with these tags. async atransform(input: AsyncIterator[Input], config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) → AsyncIterator[Out...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLRetrieveAllOutputParser.html
4111ad1a02b9-3
configurable_fields(**kwargs: Union[ConfigurableField, ConfigurableFieldSingleOption, ConfigurableFieldMultiOption]) → RunnableSerializable[Input, Output]¶ classmethod construct(_fields_set: Optional[SetStr] = None, **values: Any) → Model¶ Creates a new model setting __dict__ and __fields_set__ from trusted or pre-vali...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLRetrieveAllOutputParser.html
4111ad1a02b9-4
Runnables that leverage the configurable_fields and configurable_alternatives methods will have a dynamic input schema that depends on which configuration the runnable is invoked with. This method allows to get an input schema for a specific configuration. Parameters config – A config to use when generating the schema....
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLRetrieveAllOutputParser.html
4111ad1a02b9-5
classmethod is_lc_serializable() → bool¶ Is this class serializable? json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defa...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLRetrieveAllOutputParser.html
4111ad1a02b9-6
parse_result(result: List[Generation], *, partial: bool = False) → T¶ Parse a list of candidate model Generations into a specific format. The return value is parsed from only the first Generation in the result, whichis assumed to be the highest-likelihood Generation. Parameters result – A list of Generations to be pars...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLRetrieveAllOutputParser.html
4111ad1a02b9-7
input is still being generated. classmethod update_forward_refs(**localns: Any) → None¶ Try to update ForwardRefs on fields based on this Model, globalns and localns. classmethod validate(value: Any) → Model¶ with_config(config: Optional[RunnableConfig] = None, **kwargs: Any) → Runnable[Input, Output]¶ Bind config to a...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLRetrieveAllOutputParser.html
4111ad1a02b9-8
added to the run. with_retry(*, retry_if_exception_type: ~typing.Tuple[~typing.Type[BaseException], ...] = (<class 'Exception'>,), wait_exponential_jitter: bool = True, stop_after_attempt: int = 3) → Runnable[Input, Output]¶ Create a new Runnable that retries the original runnable on exceptions. Parameters retry_if_exc...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLRetrieveAllOutputParser.html
4111ad1a02b9-9
property output_schema: Type[pydantic.main.BaseModel]¶ The type of output this runnable produces specified as a pydantic model.
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLRetrieveAllOutputParser.html
e4fa29b0d5a7-0
langchain_core.example_selectors.base.BaseExampleSelector¶ class langchain_core.example_selectors.base.BaseExampleSelector[source]¶ Interface for selecting examples to include in prompts. Methods __init__() add_example(example) Add new example to store for a key. select_examples(input_variables) Select which examples t...
https://api.python.langchain.com/en/latest/example_selectors/langchain_core.example_selectors.base.BaseExampleSelector.html
9fa280e3e26d-0
langchain_core.example_selectors.semantic_similarity.MaxMarginalRelevanceExampleSelector¶ class langchain_core.example_selectors.semantic_similarity.MaxMarginalRelevanceExampleSelector[source]¶ Bases: SemanticSimilarityExampleSelector ExampleSelector that selects examples based on Max Marginal Relevance. This was shown...
https://api.python.langchain.com/en/latest/example_selectors/langchain_core.example_selectors.semantic_similarity.MaxMarginalRelevanceExampleSelector.html
9fa280e3e26d-1
Duplicate a model, optionally choose which fields to include, exclude and change. Parameters include – fields to include in new model exclude – fields to exclude from new model, as with values this takes precedence over include update – values to change/add in the new model. Note: the data is not validated before creat...
https://api.python.langchain.com/en/latest/example_selectors/langchain_core.example_selectors.semantic_similarity.MaxMarginalRelevanceExampleSelector.html
9fa280e3e26d-2
Returns The ExampleSelector instantiated, backed by a vector store. classmethod from_orm(obj: Any) → Model¶ json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, ex...
https://api.python.langchain.com/en/latest/example_selectors/langchain_core.example_selectors.semantic_similarity.MaxMarginalRelevanceExampleSelector.html
9fa280e3e26d-3
Try to update ForwardRefs on fields based on this Model, globalns and localns. classmethod validate(value: Any) → Model¶ Examples using MaxMarginalRelevanceExampleSelector¶ Select by maximal marginal relevance (MMR)
https://api.python.langchain.com/en/latest/example_selectors/langchain_core.example_selectors.semantic_similarity.MaxMarginalRelevanceExampleSelector.html
1731228bd831-0
langchain_core.example_selectors.length_based.LengthBasedExampleSelector¶ class langchain_core.example_selectors.length_based.LengthBasedExampleSelector[source]¶ Bases: BaseExampleSelector, BaseModel Select examples based on length. Create a new model by parsing and validating input data from keyword arguments. Raises ...
https://api.python.langchain.com/en/latest/example_selectors/langchain_core.example_selectors.length_based.LengthBasedExampleSelector.html
1731228bd831-1
exclude – fields to exclude from new model, as with values this takes precedence over include update – values to change/add in the new model. Note: the data is not validated before creating the new model: you should trust this data deep – set to True to make a deep copy of the model Returns new model instance dict(*, i...
https://api.python.langchain.com/en/latest/example_selectors/langchain_core.example_selectors.length_based.LengthBasedExampleSelector.html
1731228bd831-2
classmethod parse_obj(obj: Any) → Model¶ classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) → Model¶ classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶ classmet...
https://api.python.langchain.com/en/latest/example_selectors/langchain_core.example_selectors.length_based.LengthBasedExampleSelector.html
b11003712682-0
langchain_core.example_selectors.semantic_similarity.SemanticSimilarityExampleSelector¶ class langchain_core.example_selectors.semantic_similarity.SemanticSimilarityExampleSelector[source]¶ Bases: BaseExampleSelector, BaseModel Example selector that selects examples based on SemanticSimilarity. Create a new model by pa...
https://api.python.langchain.com/en/latest/example_selectors/langchain_core.example_selectors.semantic_similarity.SemanticSimilarityExampleSelector.html
b11003712682-1
exclude – fields to exclude from new model, as with values this takes precedence over include update – values to change/add in the new model. Note: the data is not validated before creating the new model: you should trust this data deep – set to True to make a deep copy of the model Returns new model instance dict(*, i...
https://api.python.langchain.com/en/latest/example_selectors/langchain_core.example_selectors.semantic_similarity.SemanticSimilarityExampleSelector.html
b11003712682-2
classmethod from_orm(obj: Any) → Model¶ json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_n...
https://api.python.langchain.com/en/latest/example_selectors/langchain_core.example_selectors.semantic_similarity.SemanticSimilarityExampleSelector.html
b11003712682-3
classmethod validate(value: Any) → Model¶ Examples using SemanticSimilarityExampleSelector¶ Select by maximal marginal relevance (MMR) Few-shot examples for chat models
https://api.python.langchain.com/en/latest/example_selectors/langchain_core.example_selectors.semantic_similarity.SemanticSimilarityExampleSelector.html
f444ac2e0f53-0
langchain_core.example_selectors.semantic_similarity.sorted_values¶ langchain_core.example_selectors.semantic_similarity.sorted_values(values: Dict[str, str]) → List[Any][source]¶ Return a list of values in dict sorted by key.
https://api.python.langchain.com/en/latest/example_selectors/langchain_core.example_selectors.semantic_similarity.sorted_values.html
0c8a9b66655d-0
langchain_experimental.autonomous_agents.hugginggpt.task_executor.Task¶ class langchain_experimental.autonomous_agents.hugginggpt.task_executor.Task(task: str, id: int, dep: List[int], args: Dict, tool: BaseTool)[source]¶ Methods __init__(task, id, dep, args, tool) completed() failed() pending() run() save_product() __...
https://api.python.langchain.com/en/latest/autonomous_agents/langchain_experimental.autonomous_agents.hugginggpt.task_executor.Task.html
eebb59e2d4b6-0
langchain_experimental.autonomous_agents.baby_agi.baby_agi.BabyAGI¶ class langchain_experimental.autonomous_agents.baby_agi.baby_agi.BabyAGI[source]¶ Bases: Chain, BaseModel Controller model for the BabyAGI agent. Create a new model by parsing and validating input data from keyword arguments. Raises ValidationError if ...
https://api.python.langchain.com/en/latest/autonomous_agents/langchain_experimental.autonomous_agents.baby_agi.baby_agi.BabyAGI.html
eebb59e2d4b6-1
Optional list of tags associated with the chain. Defaults to None. These tags will be associated with each call to this chain, and passed as arguments to the handlers defined in callbacks. You can use these to eg identify a specific instance of a chain with its use case. param task_creation_chain: langchain.chains.base...
https://api.python.langchain.com/en/latest/autonomous_agents/langchain_experimental.autonomous_agents.baby_agi.baby_agi.BabyAGI.html
eebb59e2d4b6-2
addition to callbacks passed to the chain during construction, but only these runtime callbacks will propagate to calls to other objects. tags – List of string tags to pass to all callbacks. These will be passed in addition to tags passed to the chain during construction, but only these runtime tags will propagate to c...
https://api.python.langchain.com/en/latest/autonomous_agents/langchain_experimental.autonomous_agents.baby_agi.baby_agi.BabyAGI.html
eebb59e2d4b6-3
response. If True, only new keys generated by this chain will be returned. If False, both input keys and new keys generated by this chain will be returned. Defaults to False. callbacks – Callbacks to use for this chain run. These will be called in addition to callbacks passed to the chain during construction, but only ...
https://api.python.langchain.com/en/latest/autonomous_agents/langchain_experimental.autonomous_agents.baby_agi.baby_agi.BabyAGI.html
eebb59e2d4b6-4
Convenience method for executing chain. The main difference between this method and Chain.__call__ is that this method expects inputs to be passed directly in as positional arguments or keyword arguments, whereas Chain.__call__ expects a single input dictionary with all the inputs Parameters *args – If the chain expect...
https://api.python.langchain.com/en/latest/autonomous_agents/langchain_experimental.autonomous_agents.baby_agi.baby_agi.BabyAGI.html
eebb59e2d4b6-5
Subclasses should override this method if they support streaming output. async astream_log(input: Any, config: Optional[RunnableConfig] = None, *, diff: bool = True, with_streamed_output_list: bool = True, include_names: Optional[Sequence[str]] = None, include_types: Optional[Sequence[str]] = None, include_tags: Option...
https://api.python.langchain.com/en/latest/autonomous_agents/langchain_experimental.autonomous_agents.baby_agi.baby_agi.BabyAGI.html