id stringlengths 14 15 | text stringlengths 44 2.47k | source stringlengths 61 181 |
|---|---|---|
537fc5ad4ccd-1 | 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/schema/langchain.schema.runnable.router.RouterRunnable.html |
537fc5ad4ccd-2 | 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/schema/langchain.schema.runnable.router.RouterRunnable.html |
537fc5ad4ccd-3 | namespace is [“langchain”, “llms”, “openai”]
invoke(input: RouterInput, config: Optional[RunnableConfig] = None) → Output[source]¶
classmethod is_lc_serializable() → bool[source]¶
Return whether this class is serializable.
json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[U... | https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.router.RouterRunnable.html |
537fc5ad4ccd-4 | 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¶
stream(input: RouterInput, config: Optional[RunnableConfig] = None, **kwargs: Option... | https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.router.RouterRunnable.html |
537fc5ad4ccd-5 | 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]¶
property InputType: Type[langchain.schema.runnable.utils.Input]¶
property OutputType: Type[langchain.schema.runna... | https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.router.RouterRunnable.html |
8b8b836d3b24-0 | langchain.schema.output_parser.BaseGenerationOutputParser¶
class langchain.schema.output_parser.BaseGenerationOutputParser[source]¶
Bases: BaseLLMOutputParser, Runnable[Union[str, BaseMessage], T]
Base class to parse the output of an LLM call.
Create a new model by parsing and validating input data from keyword argumen... | https://api.python.langchain.com/en/latest/schema/langchain.schema.output_parser.BaseGenerationOutputParser.html |
8b8b836d3b24-1 | 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/schema/langchain.schema.output_parser.BaseGenerationOutputParser.html |
8b8b836d3b24-2 | 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/schema/langchain.schema.output_parser.BaseGenerationOutputParser.html |
8b8b836d3b24-3 | namespace is [“langchain”, “llms”, “openai”]
invoke(input: Union[str, BaseMessage], config: Optional[RunnableConfig] = None) → T[source]¶
classmethod is_lc_serializable() → bool¶
Is this class serializable?
json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSet... | https://api.python.langchain.com/en/latest/schema/langchain.schema.output_parser.BaseGenerationOutputParser.html |
8b8b836d3b24-4 | abstract parse_result(result: List[Generation], *, partial: bool = False) → T¶
Parse a list of candidate model Generations into a specific format.
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.
cl... | https://api.python.langchain.com/en/latest/schema/langchain.schema.output_parser.BaseGenerationOutputParser.html |
8b8b836d3b24-5 | 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/schema/langchain.schema.output_parser.BaseGenerationOutputParser.html |
f7d53840bc00-0 | langchain.schema.runnable.base.RunnableWithFallbacks¶
class langchain.schema.runnable.base.RunnableWithFallbacks[source]¶
Bases: Serializable, Runnable[Input, Output]
A Runnable that can fallback to other Runnables if it fails.
Create a new model by parsing and validating input data from keyword arguments.
Raises Valid... | https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.base.RunnableWithFallbacks.html |
f7d53840bc00-1 | 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/schema/langchain.schema.runnable.base.RunnableWithFallbacks.html |
f7d53840bc00-2 | 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/schema/langchain.schema.runnable.base.RunnableWithFallbacks.html |
f7d53840bc00-3 | namespace is [“langchain”, “llms”, “openai”]
invoke(input: Input, config: Optional[RunnableConfig] = None, **kwargs: Any) → Output[source]¶
classmethod is_lc_serializable() → bool[source]¶
Is this class serializable?
json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[A... | https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.base.RunnableWithFallbacks.html |
f7d53840bc00-4 | 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¶
stream(input: Input, config: Optional[RunnableConfig] = None, **kwargs: Optional[Any... | https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.base.RunnableWithFallbacks.html |
f7d53840bc00-5 | 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]¶
property InputType: Type[langchain.schema.runnable.utils.Input]¶
property OutputType: Type[langchain.schema.runna... | https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.base.RunnableWithFallbacks.html |
dfb62fd96c25-0 | langchain.schema.runnable.base.RunnableEach¶
class langchain.schema.runnable.base.RunnableEach[source]¶
Bases: Serializable, Runnable[List[Input], List[Output]]
A runnable that delegates calls to another runnable
with each element of the input sequence.
Create a new model by parsing and validating input data from keywo... | https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.base.RunnableEach.html |
dfb62fd96c25-1 | 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/schema/langchain.schema.runnable.base.RunnableEach.html |
dfb62fd96c25-2 | 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/schema/langchain.schema.runnable.base.RunnableEach.html |
dfb62fd96c25-3 | namespace is [“langchain”, “llms”, “openai”]
invoke(input: List[Input], config: Optional[RunnableConfig] = None) → List[Output][source]¶
classmethod is_lc_serializable() → bool[source]¶
Is this class serializable?
json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[Abst... | https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.base.RunnableEach.html |
dfb62fd96c25-4 | 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¶
stream(input: Input, config: Optional[RunnableConfig] = None, **kwargs: Optional[Any... | https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.base.RunnableEach.html |
dfb62fd96c25-5 | 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]¶
property InputType: Any¶
property OutputType: type[List[Output]]¶
property input_schema: type[pydantic.main.BaseM... | https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.base.RunnableEach.html |
d9082537edbf-0 | langchain.schema.prompt_template.BasePromptTemplate¶
class langchain.schema.prompt_template.BasePromptTemplate[source]¶
Bases: Serializable, Runnable[Dict, PromptValue], ABC
Base class for all prompt templates, returning a prompt.
Create a new model by parsing and validating input data from keyword arguments.
Raises Va... | https://api.python.langchain.com/en/latest/schema/langchain.schema.prompt_template.BasePromptTemplate.html |
d9082537edbf-1 | 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/schema/langchain.schema.prompt_template.BasePromptTemplate.html |
d9082537edbf-2 | 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/schema/langchain.schema.prompt_template.BasePromptTemplate.html |
d9082537edbf-3 | namespace is [“langchain”, “llms”, “openai”]
invoke(input: Dict, config: langchain.schema.runnable.config.RunnableConfig | None = None) → PromptValue[source]¶
classmethod is_lc_serializable() → bool[source]¶
Return whether this class is serializable.
json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]]... | https://api.python.langchain.com/en/latest/schema/langchain.schema.prompt_template.BasePromptTemplate.html |
d9082537edbf-4 | partial(**kwargs: Union[str, Callable[[], str]]) → BasePromptTemplate[source]¶
Return a partial of the prompt template.
save(file_path: Union[Path, str]) → None[source]¶
Save the prompt.
Parameters
file_path – Path to directory to save prompt to.
Example:
.. code-block:: python
prompt.save(file_path=”path/prompt.yaml”)... | https://api.python.langchain.com/en/latest/schema/langchain.schema.prompt_template.BasePromptTemplate.html |
d9082537edbf-5 | 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/schema/langchain.schema.prompt_template.BasePromptTemplate.html |
6710ebdaa22b-0 | langchain.schema.vectorstore.VectorStore¶
class langchain.schema.vectorstore.VectorStore[source]¶
Interface for vector store.
Attributes
embeddings
Access the query embedding object if available.
Methods
__init__()
aadd_documents(documents, **kwargs)
Run more documents through the embeddings and add to the vectorstore.... | https://api.python.langchain.com/en/latest/schema/langchain.schema.vectorstore.VectorStore.html |
6710ebdaa22b-1 | from_texts(texts, embedding[, metadatas])
Return VectorStore initialized from texts and embeddings.
max_marginal_relevance_search(query[, k, ...])
Return docs selected using the maximal marginal relevance.
max_marginal_relevance_search_by_vector(...)
Return docs selected using the maximal marginal relevance.
search(que... | https://api.python.langchain.com/en/latest/schema/langchain.schema.vectorstore.VectorStore.html |
6710ebdaa22b-2 | Returns
List of IDs of the added texts.
Return type
List[str]
abstract add_texts(texts: Iterable[str], metadatas: Optional[List[dict]] = None, **kwargs: Any) → List[str][source]¶
Run more texts through the embeddings and add to the vectorstore.
Parameters
texts – Iterable of strings to add to the vectorstore.
metadatas... | https://api.python.langchain.com/en/latest/schema/langchain.schema.vectorstore.VectorStore.html |
6710ebdaa22b-3 | the Retriever should perform.
Can be “similarity” (default), “mmr”, or
“similarity_score_threshold”.
search_kwargs (Optional[Dict]) – Keyword arguments to pass to the
search function. Can include things like:
k: Amount of documents to return (Default: 4)
score_threshold: Minimum relevance threshold
for similarity_score... | https://api.python.langchain.com/en/latest/schema/langchain.schema.vectorstore.VectorStore.html |
6710ebdaa22b-4 | search_kwargs={'filter': {'paper_title':'GPT-4 Technical Report'}}
)
async asearch(query: str, search_type: str, **kwargs: Any) → List[Document][source]¶
Return docs most similar to query using specified search type.
async asimilarity_search(query: str, k: int = 4, **kwargs: Any) → List[Document][source]¶
Return docs m... | https://api.python.langchain.com/en/latest/schema/langchain.schema.vectorstore.VectorStore.html |
6710ebdaa22b-5 | Return VectorStore initialized from texts and embeddings.
max_marginal_relevance_search(query: str, k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, **kwargs: Any) → List[Document][source]¶
Return docs selected using the maximal marginal relevance.
Maximal marginal relevance optimizes for similarity to query AN... | https://api.python.langchain.com/en/latest/schema/langchain.schema.vectorstore.VectorStore.html |
6710ebdaa22b-6 | Return docs most similar to query using specified search type.
abstract similarity_search(query: str, k: int = 4, **kwargs: Any) → List[Document][source]¶
Return docs most similar to query.
similarity_search_by_vector(embedding: List[float], k: int = 4, **kwargs: Any) → List[Document][source]¶
Return docs most similar ... | https://api.python.langchain.com/en/latest/schema/langchain.schema.vectorstore.VectorStore.html |
355d8e742a37-0 | langchain.schema.agent.AgentActionMessageLog¶
class langchain.schema.agent.AgentActionMessageLog[source]¶
Bases: AgentAction
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 log: str [Required]¶
Additio... | https://api.python.langchain.com/en/latest/schema/langchain.schema.agent.AgentActionMessageLog.html |
355d8e742a37-1 | 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/schema/langchain.schema.agent.AgentActionMessageLog.html |
355d8e742a37-2 | Return whether or not the class is 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_defaults: bool = False, ... | https://api.python.langchain.com/en/latest/schema/langchain.schema.agent.AgentActionMessageLog.html |
355d8e742a37-3 | 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¶
property lc_attributes: Dict¶
List of attribute names that should be included in the serialized kwargs.
These attributes must be accepted by th... | https://api.python.langchain.com/en/latest/schema/langchain.schema.agent.AgentActionMessageLog.html |
1bfeb8b68146-0 | langchain.schema.runnable.base.RunnableBinding¶
class langchain.schema.runnable.base.RunnableBinding[source]¶
Bases: Serializable, Runnable[Input, Output]
A runnable that delegates calls to another runnable with a set of kwargs.
Create a new model by parsing and validating input data from keyword arguments.
Raises Vali... | https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.base.RunnableBinding.html |
1bfeb8b68146-1 | 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/schema/langchain.schema.runnable.base.RunnableBinding.html |
1bfeb8b68146-2 | 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/schema/langchain.schema.runnable.base.RunnableBinding.html |
1bfeb8b68146-3 | namespace is [“langchain”, “llms”, “openai”]
invoke(input: Input, config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) → Output[source]¶
classmethod is_lc_serializable() → bool[source]¶
Is this class serializable?
json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Option... | https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.base.RunnableBinding.html |
1bfeb8b68146-4 | 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¶
stream(input: Input, config: Optional[RunnableConfig] = None, **kwargs: Optional[Any... | https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.base.RunnableBinding.html |
1bfeb8b68146-5 | property InputType: type[Input]¶
property OutputType: type[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 accepted by the constructor.
property lc_secrets: Dict[str, str]¶
A m... | https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.base.RunnableBinding.html |
6c2f3c3bf329-0 | langchain.schema.runnable.config.acall_func_with_variable_args¶
async langchain.schema.runnable.config.acall_func_with_variable_args(func: Union[Callable[[Input], Awaitable[Output]], Callable[[Input, AsyncCallbackManagerForChainRun], Awaitable[Output]], Callable[[Input, AsyncCallbackManagerForChainRun, RunnableConfig],... | https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.config.acall_func_with_variable_args.html |
fb8993b99da7-0 | langchain.schema.runnable.retry.RunnableRetry¶
class langchain.schema.runnable.retry.RunnableRetry[source]¶
Bases: RunnableBinding[Input, Output]
Retry a Runnable if it fails.
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/schema/langchain.schema.runnable.retry.RunnableRetry.html |
fb8993b99da7-1 | 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/schema/langchain.schema.runnable.retry.RunnableRetry.html |
fb8993b99da7-2 | 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/schema/langchain.schema.runnable.retry.RunnableRetry.html |
fb8993b99da7-3 | namespace is [“langchain”, “llms”, “openai”]
invoke(input: Input, config: Optional[RunnableConfig] = None, **kwargs: Any) → Output[source]¶
classmethod is_lc_serializable() → bool¶
Is this class serializable?
json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractS... | https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.retry.RunnableRetry.html |
fb8993b99da7-4 | 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¶
stream(input: Input, config: Optional[RunnableConfig] = None, **kwargs: Optional[Any... | https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.retry.RunnableRetry.html |
fb8993b99da7-5 | property InputType: type[Input]¶
property OutputType: type[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 accepted by the constructor.
property lc_secrets: Dict[str, str]¶
A m... | https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.retry.RunnableRetry.html |
a506024a0134-0 | langchain.schema.runnable.utils.get_lambda_source¶
langchain.schema.runnable.utils.get_lambda_source(func: Callable) → Optional[str][source]¶
Get the source code of a lambda function.
Parameters
func – a callable that can be a lambda function
Returns
the source code of the lambda function
Return type
str | https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.utils.get_lambda_source.html |
b7b9318cfba8-0 | langchain.schema.runnable.utils.IsLocalDict¶
class langchain.schema.runnable.utils.IsLocalDict(name: str, keys: Set[str])[source]¶
Methods
__init__(name, keys)
generic_visit(node)
Called if no explicit visitor function exists for a node.
visit(node)
Visit a node.
visit_Call(node)
visit_Constant(node)
visit_Subscript(no... | https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.utils.IsLocalDict.html |
926bd74e735e-0 | langchain.schema.output_parser.BaseTransformOutputParser¶
class langchain.schema.output_parser.BaseTransformOutputParser[source]¶
Bases: BaseOutputParser[T]
Base class for an output parser that can handle streaming input.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationE... | https://api.python.langchain.com/en/latest/schema/langchain.schema.output_parser.BaseTransformOutputParser.html |
926bd74e735e-1 | Default implementation of astream, which calls ainvoke.
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[... | https://api.python.langchain.com/en/latest/schema/langchain.schema.output_parser.BaseTransformOutputParser.html |
926bd74e735e-2 | 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/schema/langchain.schema.output_parser.BaseTransformOutputParser.html |
926bd74e735e-3 | 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/schema/langchain.schema.output_parser.BaseTransformOutputParser.html |
926bd74e735e-4 | 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/schema/langchain.schema.output_parser.BaseTransformOutputParser.html |
926bd74e735e-5 | 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/schema/langchain.schema.output_parser.BaseTransformOutputParser.html |
dfab3b76e73a-0 | langchain.schema.output_parser.NoOpOutputParser¶
langchain.schema.output_parser.NoOpOutputParser¶
alias of StrOutputParser | https://api.python.langchain.com/en/latest/schema/langchain.schema.output_parser.NoOpOutputParser.html |
6021ff44d23a-0 | langchain.schema.runnable.config.get_config_list¶
langchain.schema.runnable.config.get_config_list(config: Optional[Union[RunnableConfig, List[RunnableConfig]]], length: int) → List[RunnableConfig][source]¶
Helper method to get a list of configs from a single config or a list of
configs, useful for subclasses overridin... | https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.config.get_config_list.html |
8d2d3c749279-0 | langchain.schema.messages.SystemMessageChunk¶
class langchain.schema.messages.SystemMessageChunk[source]¶
Bases: SystemMessage, BaseMessageChunk
A System Message chunk.
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... | https://api.python.langchain.com/en/latest/schema/langchain.schema.messages.SystemMessageChunk.html |
8d2d3c749279-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... | https://api.python.langchain.com/en/latest/schema/langchain.schema.messages.SystemMessageChunk.html |
8d2d3c749279-2 | The unique identifier is a list of strings that describes the path
to the object.
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: Uni... | https://api.python.langchain.com/en/latest/schema/langchain.schema.messages.SystemMessageChunk.html |
3bcebb2270c0-0 | langchain.schema.document.Document¶
class langchain.schema.document.Document[source]¶
Bases: Serializable
Class for storing a piece of text and associated metadata.
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 m... | https://api.python.langchain.com/en/latest/schema/langchain.schema.document.Document.html |
3bcebb2270c0-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... | https://api.python.langchain.com/en/latest/schema/langchain.schema.document.Document.html |
3bcebb2270c0-2 | The unique identifier is a list of strings that describes the path
to the object.
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: Uni... | https://api.python.langchain.com/en/latest/schema/langchain.schema.document.Document.html |
3bcebb2270c0-3 | OpenAI Functions Metadata Tagger
Doctran Extract Properties
Doctran Interrogate Documents
Doctran Translate Documents
TensorFlow Datasets
Airbyte Salesforce
Airbyte CDK
Airbyte Stripe
Copy Paste
Airbyte Typeform
Apify Dataset
Docugami
Airbyte Hubspot
Airbyte Gong
Airbyte Shopify
Airbyte Zendesk Support
SageMakerEndpoin... | https://api.python.langchain.com/en/latest/schema/langchain.schema.document.Document.html |
434a68a7f438-0 | langchain.schema.messages.messages_from_dict¶
langchain.schema.messages.messages_from_dict(messages: List[dict]) → List[BaseMessage][source]¶
Convert a sequence of messages from dicts to Message objects.
Parameters
messages – Sequence of messages (as dicts) to convert.
Returns
List of messages (BaseMessages). | https://api.python.langchain.com/en/latest/schema/langchain.schema.messages.messages_from_dict.html |
39d144789c5d-0 | langchain.schema.messages.ChatMessage¶
class langchain.schema.messages.ChatMessage[source]¶
Bases: BaseMessage
A Message that can be assigned an arbitrary speaker (i.e. role).
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/schema/langchain.schema.messages.ChatMessage.html |
39d144789c5d-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... | https://api.python.langchain.com/en/latest/schema/langchain.schema.messages.ChatMessage.html |
39d144789c5d-2 | The unique identifier is a list of strings that describes the path
to the object.
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: Uni... | https://api.python.langchain.com/en/latest/schema/langchain.schema.messages.ChatMessage.html |
88aec9476d46-0 | langchain.schema.messages.messages_to_dict¶
langchain.schema.messages.messages_to_dict(messages: Sequence[BaseMessage]) → List[dict][source]¶
Convert a sequence of Messages to a list of dictionaries.
Parameters
messages – Sequence of messages (as BaseMessages) to convert.
Returns
List of messages as dicts. | https://api.python.langchain.com/en/latest/schema/langchain.schema.messages.messages_to_dict.html |
328f37116bfd-0 | langchain.schema.document.BaseDocumentTransformer¶
class langchain.schema.document.BaseDocumentTransformer[source]¶
Abstract base class for document transformation systems.
A document transformation system takes a sequence of Documents and returns a
sequence of transformed Documents.
Example
class EmbeddingsRedundantFi... | https://api.python.langchain.com/en/latest/schema/langchain.schema.document.BaseDocumentTransformer.html |
328f37116bfd-1 | Parameters
documents – A sequence of Documents to be transformed.
Returns
A list of transformed Documents. | https://api.python.langchain.com/en/latest/schema/langchain.schema.document.BaseDocumentTransformer.html |
cf191c798c8e-0 | langchain.schema.runnable.utils.IsFunctionArgDict¶
class langchain.schema.runnable.utils.IsFunctionArgDict[source]¶
Methods
__init__()
generic_visit(node)
Called if no explicit visitor function exists for a node.
visit(node)
Visit a node.
visit_AsyncFunctionDef(node)
visit_Constant(node)
visit_FunctionDef(node)
visit_L... | https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.utils.IsFunctionArgDict.html |
9f73b43eacee-0 | langchain.schema.embeddings.Embeddings¶
class langchain.schema.embeddings.Embeddings[source]¶
Interface for embedding models.
Methods
__init__()
aembed_documents(texts)
Asynchronous Embed search docs.
aembed_query(text)
Asynchronous Embed query text.
embed_documents(texts)
Embed search docs.
embed_query(text)
Embed que... | https://api.python.langchain.com/en/latest/schema/langchain.schema.embeddings.Embeddings.html |
f2cc82c06cad-0 | langchain.schema.runnable.utils.get_function_first_arg_dict_keys¶
langchain.schema.runnable.utils.get_function_first_arg_dict_keys(func: Callable) → Optional[List[str]][source]¶ | https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.utils.get_function_first_arg_dict_keys.html |
1a2fd8dcbe34-0 | langchain.schema.cache.BaseCache¶
class langchain.schema.cache.BaseCache[source]¶
Base interface for cache.
Methods
__init__()
clear(**kwargs)
Clear cache that can take additional keyword arguments.
lookup(prompt, llm_string)
Look up based on prompt and llm_string.
update(prompt, llm_string, return_val)
Update cache ba... | https://api.python.langchain.com/en/latest/schema/langchain.schema.cache.BaseCache.html |
c985167feb0f-0 | langchain.schema.runnable.base.Runnable¶
class langchain.schema.runnable.base.Runnable[source]¶
A Runnable is a unit of work that can be invoked, batched, streamed, or
transformed.
Attributes
InputType
OutputType
input_schema
output_schema
Methods
__init__()
abatch(inputs[, config, return_exceptions])
Default implement... | https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.base.Runnable.html |
c985167feb0f-1 | with_retry(*[, retry_if_exception_type, ...])
__init__()¶
async abatch(inputs: List[Input], config: Optional[Union[RunnableConfig, List[RunnableConfig]]] = None, *, return_exceptions: bool = False, **kwargs: Optional[Any]) → List[Output][source]¶
Default implementation of abatch, which calls ainvoke N times.
Subclasses... | https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.base.Runnable.html |
c985167feb0f-2 | step, and the final state of the run.
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][source]¶
Default implementation of atransform, which buffers input and calls astream... | https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.base.Runnable.html |
c985167feb0f-3 | input is still being generated.
with_config(config: Optional[RunnableConfig] = None, **kwargs: Any) → Runnable[Input, Output][source]¶
Bind config to a Runnable, returning a new Runnable.
with_fallbacks(fallbacks: ~typing.Sequence[~langchain.schema.runnable.base.Runnable[~langchain.schema.runnable.utils.Input, ~langcha... | https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.base.Runnable.html |
f1c41f496de7-0 | langchain.schema.runnable.config.RunnableConfig¶
class langchain.schema.runnable.config.RunnableConfig[source]¶
Configuration for a Runnable.
Attributes
tags
Tags for this call and any sub-calls (eg.
metadata
Metadata for this call and any sub-calls (eg.
callbacks
Callbacks for this call and any sub-calls (eg.
run_name... | https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.config.RunnableConfig.html |
f1c41f496de7-1 | copy() → a shallow copy of D¶
fromkeys(value=None, /)¶
Create a new dictionary with keys from iterable and values set to value.
get(key, default=None, /)¶
Return the value for key if key is in the dictionary, else default.
items() → a set-like object providing a view on D's items¶
keys() → a set-like object providing a... | https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.config.RunnableConfig.html |
7e9e8870e7e0-0 | langchain.schema.runnable.config.patch_config¶
langchain.schema.runnable.config.patch_config(config: Optional[RunnableConfig], *, copy_locals: bool = False, callbacks: Optional[BaseCallbackManager] = None, recursion_limit: Optional[int] = None, max_concurrency: Optional[int] = None, run_name: Optional[str] = None) → Ru... | https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.config.patch_config.html |
d84f95e5582c-0 | langchain.schema.runnable.utils.gated_coro¶
async langchain.schema.runnable.utils.gated_coro(semaphore: Semaphore, coro: Coroutine) → Any[source]¶ | https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.utils.gated_coro.html |
9a1baf9b9fd8-0 | langchain.schema.runnable.utils.accepts_config¶
langchain.schema.runnable.utils.accepts_config(callable: Callable[[...], Any]) → bool[source]¶ | https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.utils.accepts_config.html |
4dde085b6f42-0 | langchain.schema.memory.BaseMemory¶
class langchain.schema.memory.BaseMemory[source]¶
Bases: Serializable, ABC
Abstract base class for memory in Chains.
Memory refers to state in Chains. Memory can be used to store information aboutpast executions of a Chain and inject that information into the inputs of
future executi... | https://api.python.langchain.com/en/latest/schema/langchain.schema.memory.BaseMemory.html |
4dde085b6f42-1 | 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/schema/langchain.schema.memory.BaseMemory.html |
4dde085b6f42-2 | 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/schema/langchain.schema.memory.BaseMemory.html |
4dde085b6f42-3 | classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) → unicode¶
to_json() → Union[SerializedConstructor, SerializedNotImplemented]¶
to_json_not_implemented() → SerializedNotImplemented¶
classmethod update_forward_refs(**localns: Any) → None¶
Try to upda... | https://api.python.langchain.com/en/latest/schema/langchain.schema.memory.BaseMemory.html |
f43f08380705-0 | langchain.schema.output_parser.BaseCumulativeTransformOutputParser¶
class langchain.schema.output_parser.BaseCumulativeTransformOutputParser[source]¶
Bases: BaseTransformOutputParser[T]
Base class for an output parser that can handle streaming input.
Create a new model by parsing and validating input data from keyword ... | https://api.python.langchain.com/en/latest/schema/langchain.schema.output_parser.BaseCumulativeTransformOutputParser.html |
f43f08380705-1 | 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 astream, which calls ainvoke.
Subclasses should override this method if they support str... | https://api.python.langchain.com/en/latest/schema/langchain.schema.output_parser.BaseCumulativeTransformOutputParser.html |
f43f08380705-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/schema/langchain.schema.output_parser.BaseCumulativeTransformOutputParser.html |
f43f08380705-3 | 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(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, ... | https://api.python.langchain.com/en/latest/schema/langchain.schema.output_parser.BaseCumulativeTransformOutputParser.html |
f43f08380705-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/schema/langchain.schema.output_parser.BaseCumulativeTransformOutputParser.html |
f43f08380705-5 | to_json_not_implemented() → SerializedNotImplemented¶
transform(input: Iterator[Union[str, BaseMessage]], config: Optional[RunnableConfig] = None, **kwargs: Any) → Iterator[T]¶
Default implementation of transform, which buffers input and then calls stream.
Subclasses should override this method if they can start produc... | https://api.python.langchain.com/en/latest/schema/langchain.schema.output_parser.BaseCumulativeTransformOutputParser.html |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.