id stringlengths 14 16 | text stringlengths 13 2.7k | source stringlengths 57 178 |
|---|---|---|
427f1b438eda-1 | deep – set to True to make a deep copy of the model
Returns
new model instance
dict(*, 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, ex... | lang/api.python.langchain.com/en/latest/tools/langchain.tools.multion.close_session.CloseSessionSchema.html |
427f1b438eda-2 | classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶
classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) → unicode¶
classmethod update_forward_refs(**localns: Any) → None¶
Try to update ForwardRefs on... | lang/api.python.langchain.com/en/latest/tools/langchain.tools.multion.close_session.CloseSessionSchema.html |
1dab6f19daa6-0 | langchain_experimental.tools.python.tool.sanitize_input¶
langchain_experimental.tools.python.tool.sanitize_input(query: str) → str[source]¶
Sanitize input to the python REPL.
Remove whitespace, backtick & python (if llm mistakes python console as terminal)
Parameters
query – The query to sanitize
Returns
The sanitized ... | lang/api.python.langchain.com/en/latest/tools/langchain_experimental.tools.python.tool.sanitize_input.html |
bcdcad952c8a-0 | langchain.tools.searchapi.tool.SearchAPIRun¶
class langchain.tools.searchapi.tool.SearchAPIRun[source]¶
Bases: BaseTool
Tool that queries the SearchApi.io search API.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid... | lang/api.python.langchain.com/en/latest/tools/langchain.tools.searchapi.tool.SearchAPIRun.html |
bcdcad952c8a-1 | that after the tool is called, the AgentExecutor will stop looping.
param tags: Optional[List[str]] = None¶
Optional list of tags associated with the tool. Defaults to None
These tags will be associated with each call to this tool,
and passed as arguments to the handlers defined in callbacks.
You can use these to eg id... | lang/api.python.langchain.com/en/latest/tools/langchain.tools.searchapi.tool.SearchAPIRun.html |
bcdcad952c8a-2 | Subclasses should override this method if they can run asynchronously.
async arun(tool_input: Union[str, Dict], verbose: Optional[bool] = None, start_color: Optional[str] = 'green', color: Optional[str] = 'green', callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, *, tags: Optional[List[... | lang/api.python.langchain.com/en/latest/tools/langchain.tools.searchapi.tool.SearchAPIRun.html |
bcdcad952c8a-3 | The jsonpatch ops can be applied in order to construct state.
async atransform(input: AsyncIterator[Input], config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) → AsyncIterator[Output]¶
Default implementation of atransform, which buffers input and calls astream.
Subclasses should override this method if th... | lang/api.python.langchain.com/en/latest/tools/langchain.tools.searchapi.tool.SearchAPIRun.html |
bcdcad952c8a-4 | classmethod construct(_fields_set: Optional[SetStr] = None, **values: Any) → Model¶
Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data.
Default values are respected, but no other validation is performed.
Behaves as if Config.extra = ‘allow’ was set since it adds all passed values... | lang/api.python.langchain.com/en/latest/tools/langchain.tools.searchapi.tool.SearchAPIRun.html |
bcdcad952c8a-5 | Get the namespace of the langchain object.
For example, if the class is langchain.llms.openai.OpenAI, then the
namespace is [“langchain”, “llms”, “openai”]
get_output_schema(config: Optional[RunnableConfig] = None) → Type[BaseModel]¶
Get a pydantic model that can be used to validate output to the runnable.
Runnables th... | lang/api.python.langchain.com/en/latest/tools/langchain.tools.searchapi.tool.SearchAPIRun.html |
bcdcad952c8a-6 | 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... | lang/api.python.langchain.com/en/latest/tools/langchain.tools.searchapi.tool.SearchAPIRun.html |
bcdcad952c8a-7 | run(tool_input: Union[str, Dict], verbose: Optional[bool] = None, start_color: Optional[str] = 'green', color: Optional[str] = 'green', callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, *, tags: Optional[List[str]] = None, metadata: Optional[Dict[str, Any]] = None, run_name: Optional[st... | lang/api.python.langchain.com/en/latest/tools/langchain.tools.searchapi.tool.SearchAPIRun.html |
bcdcad952c8a-8 | Bind config to a Runnable, returning a new Runnable.
with_fallbacks(fallbacks: Sequence[Runnable[Input, Output]], *, exceptions_to_handle: Tuple[Type[BaseException], ...] = (<class 'Exception'>,)) → RunnableWithFallbacksT[Input, Output]¶
Add fallbacks to a runnable, returning a new Runnable.
Parameters
fallbacks – A se... | lang/api.python.langchain.com/en/latest/tools/langchain.tools.searchapi.tool.SearchAPIRun.html |
bcdcad952c8a-9 | between retries
stop_after_attempt – The maximum number of attempts to make before giving up
Returns
A new Runnable that retries the original runnable on exceptions.
with_types(*, input_type: Optional[Type[Input]] = None, output_type: Optional[Type[Output]] = None) → Runnable[Input, Output]¶
Bind input and output types... | lang/api.python.langchain.com/en/latest/tools/langchain.tools.searchapi.tool.SearchAPIRun.html |
077b2f0d982e-0 | langchain.indexes.vectorstore.VectorStoreIndexWrapper¶
class langchain.indexes.vectorstore.VectorStoreIndexWrapper[source]¶
Bases: BaseModel
Wrapper around a vectorstore for easy access.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be pa... | lang/api.python.langchain.com/en/latest/indexes/langchain.indexes.vectorstore.VectorStoreIndexWrapper.html |
077b2f0d982e-1 | deep – set to True to make a deep copy of the model
Returns
new model instance
dict(*, 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, ex... | lang/api.python.langchain.com/en/latest/indexes/langchain.indexes.vectorstore.VectorStoreIndexWrapper.html |
077b2f0d982e-2 | query(question: str, llm: Optional[BaseLanguageModel] = None, retriever_kwargs: Optional[Dict[str, Any]] = None, **kwargs: Any) → str[source]¶
Query the vectorstore.
query_with_sources(question: str, llm: Optional[BaseLanguageModel] = None, retriever_kwargs: Optional[Dict[str, Any]] = None, **kwargs: Any) → dict[source... | lang/api.python.langchain.com/en/latest/indexes/langchain.indexes.vectorstore.VectorStoreIndexWrapper.html |
d0fe60e8f9a4-0 | langchain.indexes.base.RecordManager¶
class langchain.indexes.base.RecordManager(namespace: str)[source]¶
An abstract base class representing the interface for a record manager.
Initialize the record manager.
Parameters
namespace (str) – The namespace for the record manager.
Methods
__init__(namespace)
Initialize the r... | lang/api.python.langchain.com/en/latest/indexes/langchain.indexes.base.RecordManager.html |
d0fe60e8f9a4-1 | Delete specified records from the database.
Parameters
keys – A list of keys to delete.
abstract async aexists(keys: Sequence[str]) → List[bool][source]¶
Check if the provided keys exist in the database.
Parameters
keys – A list of keys to check.
Returns
A list of boolean values indicating the existence of each key.
ab... | lang/api.python.langchain.com/en/latest/indexes/langchain.indexes.base.RecordManager.html |
d0fe60e8f9a4-2 | abstract create_schema() → None[source]¶
Create the database schema for the record manager.
abstract delete_keys(keys: Sequence[str]) → None[source]¶
Delete specified records from the database.
Parameters
keys – A list of keys to delete.
abstract exists(keys: Sequence[str]) → List[bool][source]¶
Check if the provided k... | lang/api.python.langchain.com/en/latest/indexes/langchain.indexes.base.RecordManager.html |
d0fe60e8f9a4-3 | updated_at field is at least this time.
Raises
ValueError – If the length of keys doesn’t match the length of group_ids. | lang/api.python.langchain.com/en/latest/indexes/langchain.indexes.base.RecordManager.html |
c8a5e51580e1-0 | langchain.indexes.vectorstore.VectorstoreIndexCreator¶
class langchain.indexes.vectorstore.VectorstoreIndexCreator[source]¶
Bases: BaseModel
Logic for creating indexes.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a val... | lang/api.python.langchain.com/en/latest/indexes/langchain.indexes.vectorstore.VectorstoreIndexCreator.html |
c8a5e51580e1-1 | deep – set to True to make a deep copy of the model
Returns
new model instance
dict(*, 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, ex... | lang/api.python.langchain.com/en/latest/indexes/langchain.indexes.vectorstore.VectorstoreIndexCreator.html |
c8a5e51580e1-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... | lang/api.python.langchain.com/en/latest/indexes/langchain.indexes.vectorstore.VectorstoreIndexCreator.html |
67206cfe33d7-0 | langchain.indexes.graph.GraphIndexCreator¶
class langchain.indexes.graph.GraphIndexCreator[source]¶
Bases: BaseModel
Functionality to create graph index.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
param... | lang/api.python.langchain.com/en/latest/indexes/langchain.indexes.graph.GraphIndexCreator.html |
67206cfe33d7-1 | param llm: Optional[langchain.schema.language_model.BaseLanguageModel] = None¶
async afrom_text(text: str, prompt: BasePromptTemplate = PromptTemplate(input_variables=['text'], template="You are a networked intelligence helping a human track knowledge triples about all relevant people, things, concepts, etc. and integr... | lang/api.python.langchain.com/en/latest/indexes/langchain.indexes.graph.GraphIndexCreator.html |
67206cfe33d7-2 | 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] = None, deep: bool = False) → Model¶
Duplicate a model, optionally... | lang/api.python.langchain.com/en/latest/indexes/langchain.indexes.graph.GraphIndexCreator.html |
67206cfe33d7-3 | classmethod from_orm(obj: Any) → Model¶
from_text(text: str, prompt: BasePromptTemplate = PromptTemplate(input_variables=['text'], template="You are a networked intelligence helping a human track knowledge triples about all relevant people, things, concepts, etc. and integrating them with your knowledge stored within y... | lang/api.python.langchain.com/en/latest/indexes/langchain.indexes.graph.GraphIndexCreator.html |
67206cfe33d7-4 | Create graph index from text.
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_none: bool ... | lang/api.python.langchain.com/en/latest/indexes/langchain.indexes.graph.GraphIndexCreator.html |
f1f758f021c4-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]¶ | lang/api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.get_result_from_sqldb.html |
1e6a5f11d020-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... | lang/api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLRetrieveAllOutputParser.html |
1e6a5f11d020-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... | lang/api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLRetrieveAllOutputParser.html |
1e6a5f11d020-2 | input is still being generated.
batch(inputs: List[Input], config: Optional[Union[RunnableConfig, List[RunnableConfig]]] = None, *, return_exceptions: bool = False, **kwargs: Optional[Any]) → List[Output]¶
Default implementation runs invoke in parallel using a thread pool executor.
The default implementation of batch w... | lang/api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLRetrieveAllOutputParser.html |
1e6a5f11d020-3 | 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] = None, deep: bool = False) → Model¶
Duplicate a model, optionally... | lang/api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLRetrieveAllOutputParser.html |
1e6a5f11d020-4 | Get the namespace of the langchain object.
For example, if the class is langchain.llms.openai.OpenAI, then the
namespace is [“langchain”, “llms”, “openai”]
get_output_schema(config: Optional[RunnableConfig] = None) → Type[BaseModel]¶
Get a pydantic model that can be used to validate output to the runnable.
Runnables th... | lang/api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLRetrieveAllOutputParser.html |
1e6a5f11d020-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... | lang/api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLRetrieveAllOutputParser.html |
1e6a5f11d020-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... | lang/api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLRetrieveAllOutputParser.html |
1e6a5f11d020-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... | lang/api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLRetrieveAllOutputParser.html |
1e6a5f11d020-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... | lang/api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLRetrieveAllOutputParser.html |
1e6a5f11d020-9 | property output_schema: Type[pydantic.main.BaseModel]¶
The type of output this runnable produces specified as a pydantic model. | lang/api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLRetrieveAllOutputParser.html |
5f24cde4db86-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... | lang/api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseSequentialChain.html |
5f24cde4db86-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... | lang/api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseSequentialChain.html |
5f24cde4db86-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 ... | lang/api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseSequentialChain.html |
5f24cde4db86-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.... | lang/api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseSequentialChain.html |
5f24cde4db86-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... | lang/api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseSequentialChain.html |
5f24cde4db86-5 | Subclasses should override this method if they support streaming output.
async astream_log(input: Any, config: Optional[RunnableConfig] = None, *, diff: bool = True, include_names: Optional[Sequence[str]] = None, include_types: Optional[Sequence[str]] = None, include_tags: Optional[Sequence[str]] = None, exclude_names:... | lang/api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseSequentialChain.html |
5f24cde4db86-6 | e.g., if the underlying runnable uses an API which supports a batch mode.
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 m... | lang/api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseSequentialChain.html |
5f24cde4db86-7 | 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... | lang/api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseSequentialChain.html |
5f24cde4db86-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... | lang/api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseSequentialChain.html |
5f24cde4db86-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... | lang/api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseSequentialChain.html |
5f24cde4db86-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?... | lang/api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseSequentialChain.html |
5f24cde4db86-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... | lang/api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseSequentialChain.html |
5f24cde4db86-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... | lang/api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseSequentialChain.html |
5f24cde4db86-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... | lang/api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseSequentialChain.html |
5f24cde4db86-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... | lang/api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseSequentialChain.html |
5f24cde4db86-15 | 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 example,{“openai_api_key”: “OPENAI_API_KEY”}
property output_schema: T... | lang/api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseSequentialChain.html |
46243848575f-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 ... | lang/api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLOutputParser.html |
46243848575f-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 ... | lang/api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLOutputParser.html |
46243848575f-2 | 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, **kwargs: Optional[Any]) → List[Output]¶
Default implementation runs invoke... | lang/api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLOutputParser.html |
46243848575f-3 | 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... | lang/api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLOutputParser.html |
46243848575f-4 | classmethod get_lc_namespace() → List[str]¶
Get the namespace of the langchain object.
For example, if the class is langchain.llms.openai.OpenAI, then the
namespace is [“langchain”, “llms”, “openai”]
get_output_schema(config: Optional[RunnableConfig] = None) → Type[BaseModel]¶
Get a pydantic model that can be used to v... | lang/api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLOutputParser.html |
46243848575f-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... | lang/api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLOutputParser.html |
46243848575f-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... | lang/api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLOutputParser.html |
46243848575f-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... | lang/api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLOutputParser.html |
46243848575f-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... | lang/api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLOutputParser.html |
46243848575f-9 | property output_schema: Type[pydantic.main.BaseModel]¶
The type of output this runnable produces specified as a pydantic model. | lang/api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLOutputParser.html |
9c5748df24ea-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... | lang/api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLDatabaseChain.html |
9c5748df24ea-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.
... | lang/api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLDatabaseChain.html |
9c5748df24ea-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 ... | lang/api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLDatabaseChain.html |
9c5748df24ea-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... | lang/api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLDatabaseChain.html |
9c5748df24ea-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... | lang/api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLDatabaseChain.html |
9c5748df24ea-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... | lang/api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLDatabaseChain.html |
9c5748df24ea-6 | Subclasses should override this method if they support streaming output.
async astream_log(input: Any, config: Optional[RunnableConfig] = None, *, diff: bool = True, include_names: Optional[Sequence[str]] = None, include_types: Optional[Sequence[str]] = None, include_tags: Optional[Sequence[str]] = None, exclude_names:... | lang/api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLDatabaseChain.html |
9c5748df24ea-7 | e.g., if the underlying runnable uses an API which supports a batch mode.
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 m... | lang/api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLDatabaseChain.html |
9c5748df24ea-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... | lang/api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLDatabaseChain.html |
9c5748df24ea-9 | 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 dynamic input schema that depends on which
configuration the runnable is invoked with.
This method allows to get an input schema for a specific confi... | lang/api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLDatabaseChain.html |
9c5748df24ea-10 | for more details.
Returns
The output of the runnable.
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[b... | lang/api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLDatabaseChain.html |
9c5748df24ea-11 | Validate and prepare chain inputs, including adding inputs from memory.
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, inc... | lang/api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLDatabaseChain.html |
9c5748df24ea-12 | 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, they can be passed in
directly as keyword arguments.
Returns
The chain output.
Example
# Suppose we have a single-input chain that takes a 'que... | lang/api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLDatabaseChain.html |
9c5748df24ea-13 | 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... | lang/api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLDatabaseChain.html |
9c5748df24ea-14 | 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... | lang/api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLDatabaseChain.html |
9c5748df24ea-15 | 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. | lang/api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLDatabaseChain.html |
eaa5aada98a7-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... | lang/api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseChain.html |
eaa5aada98a7-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... | lang/api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseChain.html |
eaa5aada98a7-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_... | lang/api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseChain.html |
eaa5aada98a7-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 ... | lang/api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseChain.html |
eaa5aada98a7-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... | lang/api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseChain.html |
eaa5aada98a7-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, ... | lang/api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseChain.html |
eaa5aada98a7-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... | lang/api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseChain.html |
eaa5aada98a7-7 | Returns
A pydantic model that can be used to validate config.
configurable_alternatives(which: ConfigurableField, default_key: str = 'default', **kwargs: Union[Runnable[Input, Output], Callable[[], Runnable[Input, Output]]]) → RunnableSerializable[Input, Output]¶
configurable_fields(**kwargs: Union[ConfigurableField, C... | lang/api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseChain.html |
eaa5aada98a7-8 | method.
Returns
A dictionary representation of the chain.
Example
chain.dict(exclude_unset=True)
# -> {"_type": "foo", "verbose": False, ...}
classmethod from_llm(llm: BaseLanguageModel, db: SQLDatabase, prompt: Optional[BasePromptTemplate] = None, **kwargs: Any) → SQLDatabaseChain[source]¶
Create a SQLDatabaseChain fr... | lang/api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseChain.html |
eaa5aada98a7-9 | namespace is [“langchain”, “llms”, “openai”]
get_output_schema(config: Optional[RunnableConfig] = None) → Type[BaseModel]¶
Get a pydantic model that can be used to validate output to the runnable.
Runnables that leverage the configurable_fields and configurable_alternatives
methods will have a dynamic output schema tha... | lang/api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseChain.html |
eaa5aada98a7-10 | Generate a JSON representation of the model, include and exclude arguments as per dict().
encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().
classmethod lc_id() → List[str]¶
A unique identifier for this class for serialization purposes.
The unique identifier is a ... | lang/api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseChain.html |
eaa5aada98a7-11 | memory.
outputs – Dictionary of initial chain outputs.
return_only_outputs – Whether to only return the chain outputs. If False,
inputs are also added to the final outputs.
Returns
A dict of the final chain outputs.
run(*args: Any, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, tags:... | lang/api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseChain.html |
eaa5aada98a7-12 | context = "Weather report for Boise, Idaho on 07/03/23..."
chain.run(question=question, context=context)
# -> "The temperature in Boise is..."
save(file_path: Union[Path, str]) → None¶
Save the chain.
Expects Chain._chain_type property to be implemented and for memory to benull.
Parameters
file_path – Path to file to s... | lang/api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseChain.html |
eaa5aada98a7-13 | Bind config to a Runnable, returning a new Runnable.
with_fallbacks(fallbacks: Sequence[Runnable[Input, Output]], *, exceptions_to_handle: Tuple[Type[BaseException], ...] = (<class 'Exception'>,)) → RunnableWithFallbacksT[Input, Output]¶
Add fallbacks to a runnable, returning a new Runnable.
Parameters
fallbacks – A se... | lang/api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseChain.html |
eaa5aada98a7-14 | between retries
stop_after_attempt – The maximum number of attempts to make before giving up
Returns
A new Runnable that retries the original runnable on exceptions.
with_types(*, input_type: Optional[Type[Input]] = None, output_type: Optional[Type[Output]] = None) → Runnable[Input, Output]¶
Bind input and output types... | lang/api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseChain.html |
6243b12ca803-0 | langchain_experimental.tot.thought_generation.ProposePromptStrategy¶
class langchain_experimental.tot.thought_generation.ProposePromptStrategy[source]¶
Bases: BaseThoughtGenerationStrategy
Propose thoughts sequentially using a “propose prompt”.
This strategy works better when the thought space is more constrained, such... | lang/api.python.langchain.com/en/latest/tot/langchain_experimental.tot.thought_generation.ProposePromptStrategy.html |
6243b12ca803-1 | Optional metadata associated with the chain. Defaults to None.
This metadata 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 output_key: str = 'text'¶
param output_pars... | lang/api.python.langchain.com/en/latest/tot/langchain_experimental.tot.thought_generation.ProposePromptStrategy.html |
6243b12ca803-2 | 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 tot_memory: Dict[Tuple[str, ...], List[str... | lang/api.python.langchain.com/en/latest/tot/langchain_experimental.tot.thought_generation.ProposePromptStrategy.html |
6243b12ca803-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... | lang/api.python.langchain.com/en/latest/tot/langchain_experimental.tot.thought_generation.ProposePromptStrategy.html |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.