id stringlengths 14 15 | text stringlengths 44 2.47k | source stringlengths 61 181 |
|---|---|---|
27ccb1b9e8fe-4 | 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/llms/langchain.llms.ctransformers.CTransformers.html |
27ccb1b9e8fe-5 | 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... | https://api.python.langchain.com/en/latest/llms/langchain.llms.ctransformers.CTransformers.html |
27ccb1b9e8fe-6 | Pass a sequence of prompts to the model and return model generations.
This method should make use of batched calls for models that expose a batched
API.
Use this method when you want to:
take advantage of batched calls,
need more output from the model than just the top generated value,
are building chains that are agno... | https://api.python.langchain.com/en/latest/llms/langchain.llms.ctransformers.CTransformers.html |
27ccb1b9e8fe-7 | Useful for checking if an input will fit in a model’s context window.
Parameters
messages – The message inputs to tokenize.
Returns
The sum of the number of tokens across the messages.
get_token_ids(text: str) → List[int]¶
Return the ordered ids of the tokens in a text.
Parameters
text – The string input to tokenize.
R... | https://api.python.langchain.com/en/latest/llms/langchain.llms.ctransformers.CTransformers.html |
27ccb1b9e8fe-8 | 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/llms/langchain.llms.ctransformers.CTransformers.html |
27ccb1b9e8fe-9 | save(file_path: Union[Path, str]) → None¶
Save the LLM.
Parameters
file_path – Path to file to save the LLM to.
Example:
.. code-block:: python
llm.save(file_path=”path/llm.yaml”)
classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶
classmethod schema_json(*, by_alias... | https://api.python.langchain.com/en/latest/llms/langchain.llms.ctransformers.CTransformers.html |
27ccb1b9e8fe-10 | Bind config to a Runnable, returning a new Runnable.
with_fallbacks(fallbacks: ~typing.Sequence[~langchain.schema.runnable.base.Runnable[~langchain.schema.runnable.utils.Input, ~langchain.schema.runnable.utils.Output]], *, exceptions_to_handle: ~typing.Tuple[~typing.Type[BaseException], ...] = (<class 'Exception'>,)) →... | https://api.python.langchain.com/en/latest/llms/langchain.llms.ctransformers.CTransformers.html |
ad14690fc5bc-0 | langchain.llms.symblai_nebula.Nebula¶
class langchain.llms.symblai_nebula.Nebula[source]¶
Bases: LLM
Nebula Service models.
To use, you should have the environment variable NEBULA_SERVICE_URL,
NEBULA_SERVICE_PATH and NEBULA_API_KEY set with your Nebula
Service, or pass it as a named parameter to the constructor.
Exampl... | https://api.python.langchain.com/en/latest/llms/langchain.llms.symblai_nebula.Nebula.html |
ad14690fc5bc-1 | param tags: Optional[List[str]] = None¶
Tags to add to the run trace.
param temperature: Optional[float] = 0.6¶
param top_k: Optional[int] = 0¶
param top_p: Optional[float] = 0.95¶
param verbose: bool [Optional]¶
Whether to print out response text.
__call__(prompt: str, stop: Optional[List[str]] = None, callbacks: Opti... | https://api.python.langchain.com/en/latest/llms/langchain.llms.symblai_nebula.Nebula.html |
ad14690fc5bc-2 | Run the LLM on the given prompt and input.
async agenerate_prompt(prompts: List[PromptValue], stop: Optional[List[str]] = None, callbacks: Union[List[BaseCallbackHandler], BaseCallbackManager, None, List[Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]]]] = None, **kwargs: Any) → LLMResult¶
Asynchronously... | https://api.python.langchain.com/en/latest/llms/langchain.llms.symblai_nebula.Nebula.html |
ad14690fc5bc-3 | Subclasses should override this method if they can run asynchronously.
async apredict(text: str, *, stop: Optional[Sequence[str]] = None, **kwargs: Any) → str¶
Asynchronously pass a string to the model and return a string prediction.
Use this method when calling pure text generation models and only the topcandidate gen... | https://api.python.langchain.com/en/latest/llms/langchain.llms.symblai_nebula.Nebula.html |
ad14690fc5bc-4 | Subclasses should override this method if they support streaming output.
async astream_log(input: Any, config: Optional[RunnableConfig] = None, *, include_names: Optional[Sequence[str]] = None, include_types: Optional[Sequence[str]] = None, include_tags: Optional[Sequence[str]] = None, exclude_names: Optional[Sequence[... | https://api.python.langchain.com/en/latest/llms/langchain.llms.symblai_nebula.Nebula.html |
ad14690fc5bc-5 | Bind arguments to a Runnable, returning a new Runnable.
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... | https://api.python.langchain.com/en/latest/llms/langchain.llms.symblai_nebula.Nebula.html |
ad14690fc5bc-6 | Run the LLM on the given prompt and input.
generate_prompt(prompts: List[PromptValue], stop: Optional[List[str]] = None, callbacks: Union[List[BaseCallbackHandler], BaseCallbackManager, None, List[Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]]]] = None, **kwargs: Any) → LLMResult¶
Pass a sequence of pr... | https://api.python.langchain.com/en/latest/llms/langchain.llms.symblai_nebula.Nebula.html |
ad14690fc5bc-7 | Get the number of tokens present in the text.
Useful for checking if an input will fit in a model’s context window.
Parameters
text – The string input to tokenize.
Returns
The integer number of tokens in the text.
get_num_tokens_from_messages(messages: List[BaseMessage]) → int¶
Get the number of tokens in the messages.... | https://api.python.langchain.com/en/latest/llms/langchain.llms.symblai_nebula.Nebula.html |
ad14690fc5bc-8 | classmethod lc_id() → List[str]¶
A unique identifier for this class for serialization purposes.
The unique identifier is a list of strings that describes the path
to the object.
map() → Runnable[List[Input], List[Output]]¶
Return a new Runnable that maps a list of inputs to a list of outputs,
by calling invoke() with e... | https://api.python.langchain.com/en/latest/llms/langchain.llms.symblai_nebula.Nebula.html |
ad14690fc5bc-9 | Parameters
messages – A sequence of chat messages corresponding to a single model input.
stop – Stop words to use when generating. Model output is cut off at the
first occurrence of any of these substrings.
**kwargs – Arbitrary additional keyword arguments. These are usually passed
to the model provider API call.
Retur... | https://api.python.langchain.com/en/latest/llms/langchain.llms.symblai_nebula.Nebula.html |
ad14690fc5bc-10 | classmethod validate(value: Any) → Model¶
with_config(config: Optional[RunnableConfig] = None, **kwargs: Any) → Runnable[Input, Output]¶
Bind config to a Runnable, returning a new Runnable.
with_fallbacks(fallbacks: ~typing.Sequence[~langchain.schema.runnable.base.Runnable[~langchain.schema.runnable.utils.Input, ~langc... | https://api.python.langchain.com/en/latest/llms/langchain.llms.symblai_nebula.Nebula.html |
3a2e04c25d5f-0 | langchain.chat_loaders.utils.merge_chat_runs¶
langchain.chat_loaders.utils.merge_chat_runs(chat_sessions: Iterable[ChatSession]) → Iterator[ChatSession][source]¶
Merge chat runs together.
A chat run is a sequence of messages from the same sender.
Parameters
chat_sessions – A list of chat sessions.
Returns
A list of cha... | https://api.python.langchain.com/en/latest/chat_loaders/langchain.chat_loaders.utils.merge_chat_runs.html |
dad28348d550-0 | langchain.chat_loaders.utils.map_ai_messages¶
langchain.chat_loaders.utils.map_ai_messages(chat_sessions: Iterable[ChatSession], sender: str) → Iterator[ChatSession][source]¶
Convert messages from the specified ‘sender’ to AI messages.
This is useful for fine-tuning the AI to adapt to your voice.
Examples using map_ai_... | https://api.python.langchain.com/en/latest/chat_loaders/langchain.chat_loaders.utils.map_ai_messages.html |
3df04add02a6-0 | langchain.chat_loaders.gmail.GMailLoader¶
class langchain.chat_loaders.gmail.GMailLoader(creds: Any, n: int = 100, raise_error: bool = False)[source]¶
Load data from GMail.
There are many ways you could want to load data from GMail.
This loader is currently fairly opinionated in how to do so.
The way it does it is it f... | https://api.python.langchain.com/en/latest/chat_loaders/langchain.chat_loaders.gmail.GMailLoader.html |
5717ae9cdc09-0 | langchain.chat_loaders.telegram.TelegramChatLoader¶
class langchain.chat_loaders.telegram.TelegramChatLoader(path: Union[str, Path])[source]¶
Load telegram conversations to LangChain chat messages.
To export, use the Telegram Desktop app from
https://desktop.telegram.org/, select a conversation, click the three dots
in... | https://api.python.langchain.com/en/latest/chat_loaders/langchain.chat_loaders.telegram.TelegramChatLoader.html |
a72a9a144951-0 | langchain.chat_loaders.facebook_messenger.FolderFacebookMessengerChatLoader¶
class langchain.chat_loaders.facebook_messenger.FolderFacebookMessengerChatLoader(path: Union[str, Path])[source]¶
Load Facebook Messenger chat data from a folder.
Parameters
path (Union[str, Path]) – The path to the directory
containing the c... | https://api.python.langchain.com/en/latest/chat_loaders/langchain.chat_loaders.facebook_messenger.FolderFacebookMessengerChatLoader.html |
243394a4cd41-0 | langchain.chat_loaders.imessage.IMessageChatLoader¶
class langchain.chat_loaders.imessage.IMessageChatLoader(path: Optional[Union[str, Path]] = None)[source]¶
Load chat sessions from the iMessage chat.db SQLite file.
It only works on macOS when you have iMessage enabled and have the chat.db file.
The chat.db file is li... | https://api.python.langchain.com/en/latest/chat_loaders/langchain.chat_loaders.imessage.IMessageChatLoader.html |
008744855d21-0 | langchain.chat_loaders.facebook_messenger.SingleFileFacebookMessengerChatLoader¶
class langchain.chat_loaders.facebook_messenger.SingleFileFacebookMessengerChatLoader(path: Union[Path, str])[source]¶
Load Facebook Messenger chat data from a single file.
Parameters
path (Union[Path, str]) – The path to the chat file.
pa... | https://api.python.langchain.com/en/latest/chat_loaders/langchain.chat_loaders.facebook_messenger.SingleFileFacebookMessengerChatLoader.html |
1eca22bbb6fa-0 | langchain.chat_loaders.slack.SlackChatLoader¶
class langchain.chat_loaders.slack.SlackChatLoader(path: Union[str, Path])[source]¶
Load Slack conversations from a dump zip file.
Initialize the chat loader with the path to the exported Slack dump zip file.
Parameters
path – Path to the exported Slack dump zip file.
Metho... | https://api.python.langchain.com/en/latest/chat_loaders/langchain.chat_loaders.slack.SlackChatLoader.html |
3724fd1db3bb-0 | langchain.chat_loaders.utils.merge_chat_runs_in_session¶
langchain.chat_loaders.utils.merge_chat_runs_in_session(chat_session: ChatSession, delimiter: str = '\n\n') → ChatSession[source]¶
Merge chat runs together in a chat session.
A chat run is a sequence of messages from the same sender.
Parameters
chat_session – A c... | https://api.python.langchain.com/en/latest/chat_loaders/langchain.chat_loaders.utils.merge_chat_runs_in_session.html |
94d1013ac321-0 | langchain.chat_loaders.utils.map_ai_messages_in_session¶
langchain.chat_loaders.utils.map_ai_messages_in_session(chat_sessions: ChatSession, sender: str) → ChatSession[source]¶
Convert messages from the specified ‘sender’ to AI messages.
This is useful for fine-tuning the AI to adapt to your voice. | https://api.python.langchain.com/en/latest/chat_loaders/langchain.chat_loaders.utils.map_ai_messages_in_session.html |
818738555250-0 | langchain.chat_loaders.whatsapp.WhatsAppChatLoader¶
class langchain.chat_loaders.whatsapp.WhatsAppChatLoader(path: str)[source]¶
Load WhatsApp conversations from a dump zip file or directory.
Initialize the WhatsAppChatLoader.
Parameters
path (str) – Path to the exported WhatsApp chat
zip directory, folder, or file.
To... | https://api.python.langchain.com/en/latest/chat_loaders/langchain.chat_loaders.whatsapp.WhatsAppChatLoader.html |
e154e1e4b053-0 | langchain.chat_loaders.base.BaseChatLoader¶
class langchain.chat_loaders.base.BaseChatLoader[source]¶
Base class for chat loaders.
Methods
__init__()
lazy_load()
Lazy load the chat sessions.
load()
Eagerly load the chat sessions into memory.
__init__()¶
abstract lazy_load() → Iterator[ChatSession][source]¶
Lazy load th... | https://api.python.langchain.com/en/latest/chat_loaders/langchain.chat_loaders.base.BaseChatLoader.html |
9ecdce275af5-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 |
9ecdce275af5-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 |
9ecdce275af5-2 | 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 chain. Defaults to None
include_run_info – Whether to include run ... | https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseSequentialChain.html |
9ecdce275af5-3 | 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/sql/langchain_experimental.sql.base.SQLDatabaseSequentialChain.html |
9ecdce275af5-4 | 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/sql/langchain_experimental.sql.base.SQLDatabaseSequentialChain.html |
9ecdce275af5-5 | 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.SQLDatabaseSequentialChain.html |
9ecdce275af5-6 | 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/sql/langchain_experimental.sql.base.SQLDatabaseSequentialChain.html |
9ecdce275af5-7 | # -> {"_type": "foo", "verbose": False, ...}
classmethod from_llm(llm: BaseLanguageModel, db: SQLDatabase, query_prompt: BasePromptTemplate = PromptTemplate(input_variables=['input', 'table_info', 'dialect', '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 |
9ecdce275af5-8 | 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”]
invoke(input: Dict[str, Any], config: Optional[RunnableConfig] = None, **kwargs: Any) → Dict[str, Any]¶
classmethod is_l... | https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseSequentialChain.html |
9ecdce275af5-9 | 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 |
9ecdce275af5-10 | 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 |
9ecdce275af5-11 | 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 |
9ecdce275af5-12 | 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... | https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseSequentialChain.html |
2d375386e502-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
Create a new model by parsing and validating input data from... | https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLRetrieveAllOutputParser.html |
2d375386e502-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 |
2d375386e502-2 | Default implementation of batch, which calls invoke N times.
Subclasses should override this method if they can batch more efficiently.
bind(**kwargs: Any) → Runnable[Input, Output]¶
Bind arguments to a Runnable, returning a new Runnable.
classmethod construct(_fields_set: Optional[SetStr] = None, **values: Any) → Mode... | https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLRetrieveAllOutputParser.html |
2d375386e502-3 | Get the namespace of the langchain object.
For example, if the class is langchain.llms.openai.OpenAI, then the
namespace is [“langchain”, “llms”, “openai”]
invoke(input: Union[str, BaseMessage], config: Optional[RunnableConfig] = None) → T¶
classmethod is_lc_serializable() → bool¶
Is this class serializable?
json(*, in... | https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLRetrieveAllOutputParser.html |
2d375386e502-4 | 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.VectorSQLRetrieveAllOutputParser.html |
2d375386e502-5 | 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.VectorSQLRetrieveAllOutputParser.html |
2d375386e502-6 | For example,{“openai_api_key”: “OPENAI_API_KEY”}
property output_schema: Type[pydantic.main.BaseModel]¶ | https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLRetrieveAllOutputParser.html |
50473a025eff-0 | langchain_experimental.sql.vector_sql.get_result_from_sqldb¶
langchain_experimental.sql.vector_sql.get_result_from_sqldb(db: SQLDatabase, cmd: str) → Union[str, List[Dict[str, Any]], Dict[str, Any]][source]¶ | https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.get_result_from_sqldb.html |
d8ea7a5117b9-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 |
d8ea7a5117b9-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 |
d8ea7a5117b9-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 langchain.verbose value.
__call__(inputs: Union[Dict[str, Any], Any], return_only_outputs: bool = False, callbacks: Optional[Union[... | https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseChain.html |
d8ea7a5117b9-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 of abatch, which calls ai... | https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseChain.html |
d8ea7a5117b9-4 | include_run_info – Whether to include run info in the response. Defaults
to False.
Returns
A dict of named outputs. Should contain all outputs specified inChain.output_keys.
async ainvoke(input: Dict[str, Any], config: Optional[RunnableConfig] = None, **kwargs: Any) → Dict[str, Any]¶
Default implementation of ainvoke, ... | https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseChain.html |
d8ea7a5117b9-5 | directly as keyword arguments.
Returns
The chain output.
Example
# Suppose we have a single-input chain that takes a 'question' string:
await chain.arun("What's the temperature in Boise, Idaho?")
# -> "The temperature in Boise is..."
# Suppose we have a multi-input chain that takes a 'question' string
# and 'context' s... | https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseChain.html |
d8ea7a5117b9-6 | 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... | https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseChain.html |
d8ea7a5117b9-7 | 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(**kwargs: Any) → Dict¶
Dictionary representation of chain.
Expects Chain._chain_type property to be implemented and for memory to benull.
Parameters
**kwargs – Keyword arguments passed to defaul... | https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseChain.html |
d8ea7a5117b9-8 | 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 |
d8ea7a5117b9-9 | 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 |
d8ea7a5117b9-10 | 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 |
d8ea7a5117b9-11 | 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 |
480c823700f4-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 |
480c823700f4-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 |
480c823700f4-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 |
480c823700f4-3 | 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. Should contain all outputs specified inChain.output_keys.
async abatch... | https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLDatabaseChain.html |
480c823700f4-4 | 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 chain. Defaults to None
include_run_info – Whether to include run ... | https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLDatabaseChain.html |
480c823700f4-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.vector_sql.VectorSQLDatabaseChain.html |
480c823700f4-6 | 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 can be applied in order to construct state.
async atransform(input: As... | https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLDatabaseChain.html |
480c823700f4-7 | 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/sql/langchain_experimental.sql.vector_sql.VectorSQLDatabaseChain.html |
480c823700f4-8 | 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”]
invoke(input: Dict[str, Any], config: Optional[RunnableConfig] = None, **kwargs: Any) → Dict[str, Any]¶
classmethod is_l... | https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLDatabaseChain.html |
480c823700f4-9 | 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.vector_sql.VectorSQLDatabaseChain.html |
480c823700f4-10 | 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.vector_sql.VectorSQLDatabaseChain.html |
480c823700f4-11 | 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.vector_sql.VectorSQLDatabaseChain.html |
480c823700f4-12 | 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... | https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLDatabaseChain.html |
86d44a37cd61-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 |
86d44a37cd61-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.VectorSQLOutputParser.html |
86d44a37cd61-2 | Default implementation of batch, which calls invoke N times.
Subclasses should override this method if they can batch more efficiently.
bind(**kwargs: Any) → Runnable[Input, Output]¶
Bind arguments to a Runnable, returning a new Runnable.
classmethod construct(_fields_set: Optional[SetStr] = None, **values: Any) → Mode... | https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLOutputParser.html |
86d44a37cd61-3 | Get the namespace of the langchain object.
For example, if the class is langchain.llms.openai.OpenAI, then the
namespace is [“langchain”, “llms”, “openai”]
invoke(input: Union[str, BaseMessage], config: Optional[RunnableConfig] = None) → T¶
classmethod is_lc_serializable() → bool¶
Is this class serializable?
json(*, in... | https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLOutputParser.html |
86d44a37cd61-4 | 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 |
86d44a37cd61-5 | 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 |
86d44a37cd61-6 | For example,{“openai_api_key”: “OPENAI_API_KEY”}
property output_schema: Type[pydantic.main.BaseModel]¶ | https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.vector_sql.VectorSQLOutputParser.html |
e37344b54c22-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 |
d3790b1cb0c2-0 | langchain.retrievers.web_research.WebResearchRetriever¶
class langchain.retrievers.web_research.WebResearchRetriever[source]¶
Bases: BaseRetriever
Google Search API retriever.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to for... | https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.web_research.WebResearchRetriever.html |
d3790b1cb0c2-1 | Vector store for storing web pages
async abatch(inputs: List[Input], config: Optional[Union[RunnableConfig, List[RunnableConfig]]] = None, *, return_exceptions: bool = False, **kwargs: Optional[Any]) → List[Output]¶
Default implementation of abatch, which calls ainvoke N times.
Subclasses should override this method if... | https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.web_research.WebResearchRetriever.html |
d3790b1cb0c2-2 | Subclasses should override this method if they support streaming output.
async astream_log(input: Any, config: Optional[RunnableConfig] = None, *, include_names: Optional[Sequence[str]] = None, include_types: Optional[Sequence[str]] = None, include_tags: Optional[Sequence[str]] = None, exclude_names: Optional[Sequence[... | https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.web_research.WebResearchRetriever.html |
d3790b1cb0c2-3 | clean_search_query(query: str) → str[source]¶
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 = ‘... | https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.web_research.WebResearchRetriever.html |
d3790b1cb0c2-4 | Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.
classmethod from_llm(vectorstore: ~langchain.schema.vectorstore.VectorStore, llm: ~langchain.llms.base.BaseLLM, search: ~langchain.utilities.google_search.GoogleSearchAPIWrapper, prompt: ~typing.Optional[~langch... | https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.web_research.WebResearchRetriever.html |
d3790b1cb0c2-5 | These tags will be associated with each call to this retriever,
and passed as arguments to the handlers defined in callbacks.
Parameters
metadata – Optional metadata associated with the retriever. Defaults to None
This metadata will be associated with each call to this retriever,
and passed as arguments to the handlers... | https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.web_research.WebResearchRetriever.html |
d3790b1cb0c2-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¶
classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶
classmet... | https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.web_research.WebResearchRetriever.html |
d3790b1cb0c2-7 | Bind config to a Runnable, returning a new Runnable.
with_fallbacks(fallbacks: ~typing.Sequence[~langchain.schema.runnable.base.Runnable[~langchain.schema.runnable.utils.Input, ~langchain.schema.runnable.utils.Output]], *, exceptions_to_handle: ~typing.Tuple[~typing.Type[BaseException], ...] = (<class 'Exception'>,)) →... | https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.web_research.WebResearchRetriever.html |
ca6fe5e1d2b8-0 | langchain.retrievers.kay.KayAiRetriever¶
class langchain.retrievers.kay.KayAiRetriever[source]¶
Bases: BaseRetriever
Retriever for Kay.ai datasets.
To work properly, expects you to have KAY_API_KEY env variable set.
You can get one for free at https://kay.ai/.
Create a new model by parsing and validating input data fro... | https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.kay.KayAiRetriever.html |
ca6fe5e1d2b8-1 | Subclasses should override this method if they can batch more efficiently.
async aget_relevant_documents(query: str, *, callbacks: Callbacks = None, tags: Optional[List[str]] = None, metadata: Optional[Dict[str, Any]] = None, run_name: Optional[str] = None, **kwargs: Any) → List[Document]¶
Asynchronously get documents ... | https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.kay.KayAiRetriever.html |
ca6fe5e1d2b8-2 | Subclasses should override this method if they support streaming output.
async astream_log(input: Any, config: Optional[RunnableConfig] = None, *, include_names: Optional[Sequence[str]] = None, include_types: Optional[Sequence[str]] = None, include_tags: Optional[Sequence[str]] = None, exclude_names: Optional[Sequence[... | https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.kay.KayAiRetriever.html |
ca6fe5e1d2b8-3 | 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
copy(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclu... | https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.kay.KayAiRetriever.html |
ca6fe5e1d2b8-4 | Defaults to 6.
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, exclude_defaults: bool = False, exclude_none: bool = False) → Dict... | https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.kay.KayAiRetriever.html |
ca6fe5e1d2b8-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/retrievers/langchain.retrievers.kay.KayAiRetriever.html |
ca6fe5e1d2b8-6 | 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/retrievers/langchain.retrievers.kay.KayAiRetriever.html |
ca6fe5e1d2b8-7 | property InputType: Type[langchain.schema.runnable.utils.Input]¶
property OutputType: Type[langchain.schema.runnable.utils.Output]¶
property input_schema: Type[pydantic.main.BaseModel]¶
property lc_attributes: Dict¶
List of attribute names that should be included in the serialized kwargs.
These attributes must be accep... | https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.kay.KayAiRetriever.html |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.