id stringlengths 14 16 | text stringlengths 13 2.7k | source stringlengths 57 178 |
|---|---|---|
c2ce2a5d4738-3 | information. (containing content and other) –
on_llm_start(serialized: Dict[str, Any], prompts: List[str], *, run_id: UUID, parent_run_id: Optional[UUID] = None, tags: Optional[List[str]] = None, metadata: Optional[Dict[str, Any]] = None, **kwargs: Any) → Any¶
Run when LLM starts running.
on_retriever_end(documents: S... | lang/api.python.langchain.com/en/latest/schema/langchain.schema.callbacks.base.BaseCallbackHandler.html |
c2ce2a5d4738-4 | Run when tool ends running.
on_tool_error(error: BaseException, *, run_id: UUID, parent_run_id: Optional[UUID] = None, **kwargs: Any) → Any¶
Run when tool errors.
on_tool_start(serialized: Dict[str, Any], input_str: str, *, run_id: UUID, parent_run_id: Optional[UUID] = None, tags: Optional[List[str]] = None, metadata: ... | lang/api.python.langchain.com/en/latest/schema/langchain.schema.callbacks.base.BaseCallbackHandler.html |
0e58252a72f4-0 | langchain.schema.runnable.utils.ConfigurableField¶
class langchain.schema.runnable.utils.ConfigurableField(id: str, name: Optional[str] = None, description: Optional[str] = None, annotation: Optional[Any] = None)[source]¶
A field that can be configured by the user.
Create new instance of ConfigurableField(id, name, des... | lang/api.python.langchain.com/en/latest/schema/langchain.schema.runnable.utils.ConfigurableField.html |
ff24b8906c64-0 | langchain.schema.callbacks.tracers.root_listeners.RootListenersTracer¶
class langchain.schema.callbacks.tracers.root_listeners.RootListenersTracer(*, config: RunnableConfig, on_start: Optional[Union[Callable[[Run], None], Callable[[Run, RunnableConfig], None]]], on_end: Optional[Union[Callable[[Run], None], Callable[[R... | lang/api.python.langchain.com/en/latest/schema/langchain.schema.callbacks.tracers.root_listeners.RootListenersTracer.html |
ff24b8906c64-1 | Handle an error for an LLM run.
on_llm_new_token(token, *[, chunk, ...])
Run on new LLM token.
on_llm_start(serialized, prompts, *, run_id)
Start a trace for an LLM run.
on_retriever_end(documents, *, run_id, **kwargs)
Run when Retriever ends running.
on_retriever_error(error, *, run_id, **kwargs)
Run when Retriever er... | lang/api.python.langchain.com/en/latest/schema/langchain.schema.callbacks.tracers.root_listeners.RootListenersTracer.html |
ff24b8906c64-2 | Run on agent action.
on_agent_finish(finish: AgentFinish, *, run_id: UUID, parent_run_id: Optional[UUID] = None, **kwargs: Any) → Any¶
Run on agent end.
on_chain_end(outputs: Dict[str, Any], *, run_id: UUID, inputs: Optional[Dict[str, Any]] = None, **kwargs: Any) → Run¶
End a trace for a chain run.
on_chain_error(error... | lang/api.python.langchain.com/en/latest/schema/langchain.schema.callbacks.tracers.root_listeners.RootListenersTracer.html |
ff24b8906c64-3 | Handle an error for an LLM run.
on_llm_new_token(token: str, *, chunk: Optional[Union[GenerationChunk, ChatGenerationChunk]] = None, run_id: UUID, parent_run_id: Optional[UUID] = None, **kwargs: Any) → Run¶
Run on new LLM token. Only available when streaming is enabled.
on_llm_start(serialized: Dict[str, Any], prompts:... | lang/api.python.langchain.com/en/latest/schema/langchain.schema.callbacks.tracers.root_listeners.RootListenersTracer.html |
ff24b8906c64-4 | End a trace for a tool run.
on_tool_error(error: BaseException, *, run_id: UUID, **kwargs: Any) → Run¶
Handle an error for a tool run.
on_tool_start(serialized: Dict[str, Any], input_str: str, *, run_id: UUID, tags: Optional[List[str]] = None, parent_run_id: Optional[UUID] = None, metadata: Optional[Dict[str, Any]] = N... | lang/api.python.langchain.com/en/latest/schema/langchain.schema.callbacks.tracers.root_listeners.RootListenersTracer.html |
a2692859ae3c-0 | langchain.schema.runnable.base.RunnableBindingBase¶
class langchain.schema.runnable.base.RunnableBindingBase[source]¶
Bases: RunnableSerializable[Input, Output]
A runnable that delegates calls to another runnable with a set of kwargs.
Use only if creating a new RunnableBinding subclass with different __init__ args.
Cre... | lang/api.python.langchain.com/en/latest/schema/langchain.schema.runnable.base.RunnableBindingBase.html |
a2692859ae3c-1 | the runnable did not implement a native async version of invoke.
Subclasses should override this method if they can run asynchronously.
async astream(input: Input, config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) → AsyncIterator[Output][source]¶
Default implementation of astream, which calls ainvoke.
S... | lang/api.python.langchain.com/en/latest/schema/langchain.schema.runnable.base.RunnableBindingBase.html |
a2692859ae3c-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][source]¶
Default implementation runs invoke in parallel using a thread pool executor.
The default implementation of... | lang/api.python.langchain.com/en/latest/schema/langchain.schema.runnable.base.RunnableBindingBase.html |
a2692859ae3c-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/schema/langchain.schema.runnable.base.RunnableBindingBase.html |
a2692859ae3c-4 | Parameters
config – A config to use when generating the schema.
Returns
A pydantic model that can be used to validate input.
classmethod get_lc_namespace() → List[str][source]¶
Get the namespace of the langchain object.
For example, if the class is langchain.llms.openai.OpenAI, then the
namespace is [“langchain”, “llms... | lang/api.python.langchain.com/en/latest/schema/langchain.schema.runnable.base.RunnableBindingBase.html |
a2692859ae3c-5 | classmethod is_lc_serializable() → bool[source]¶
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, excl... | lang/api.python.langchain.com/en/latest/schema/langchain.schema.runnable.base.RunnableBindingBase.html |
a2692859ae3c-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][source]¶
Default implementation of stream, which calls invoke.
Subclasses should ov... | lang/api.python.langchain.com/en/latest/schema/langchain.schema.runnable.base.RunnableBindingBase.html |
a2692859ae3c-7 | fallback in order, upon failures.
with_listeners(*, on_start: Optional[Listener] = None, on_end: Optional[Listener] = None, on_error: Optional[Listener] = None) → Runnable[Input, Output]¶
Bind lifecycle listeners to a Runnable, returning a new Runnable.
on_start: Called before the runnable starts running, with the Run ... | lang/api.python.langchain.com/en/latest/schema/langchain.schema.runnable.base.RunnableBindingBase.html |
a2692859ae3c-8 | The type of output this runnable produces specified as a type annotation.
property config_specs: List[langchain.schema.runnable.utils.ConfigurableFieldSpec]¶
List configurable fields for this runnable.
property input_schema: Type[pydantic.main.BaseModel]¶
The type of input this runnable accepts specified as a pydantic ... | lang/api.python.langchain.com/en/latest/schema/langchain.schema.runnable.base.RunnableBindingBase.html |
32585d5b92fa-0 | langchain.schema.callbacks.tracers.schemas.TracerSession¶
class langchain.schema.callbacks.tracers.schemas.TracerSession[source]¶
Bases: TracerSessionBase
TracerSessionV1 schema for the V2 API.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data canno... | lang/api.python.langchain.com/en/latest/schema/langchain.schema.callbacks.tracers.schemas.TracerSession.html |
32585d5b92fa-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/schema/langchain.schema.callbacks.tracers.schemas.TracerSession.html |
32585d5b92fa-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/schema/langchain.schema.callbacks.tracers.schemas.TracerSession.html |
97b2dc44420f-0 | langchain.schema.callbacks.manager.CallbackManagerForToolRun¶
class langchain.schema.callbacks.manager.CallbackManagerForToolRun(*, run_id: UUID, handlers: List[BaseCallbackHandler], inheritable_handlers: List[BaseCallbackHandler], parent_run_id: Optional[UUID] = None, tags: Optional[List[str]] = None, inheritable_tags... | lang/api.python.langchain.com/en/latest/schema/langchain.schema.callbacks.manager.CallbackManagerForToolRun.html |
97b2dc44420f-1 | on_tool_error(error, **kwargs)
Run when tool errors.
__init__(*, run_id: UUID, handlers: List[BaseCallbackHandler], inheritable_handlers: List[BaseCallbackHandler], parent_run_id: Optional[UUID] = None, tags: Optional[List[str]] = None, inheritable_tags: Optional[List[str]] = None, metadata: Optional[Dict[str, Any]] = ... | lang/api.python.langchain.com/en/latest/schema/langchain.schema.callbacks.manager.CallbackManagerForToolRun.html |
97b2dc44420f-2 | Parameters
text (str) – The received text.
Returns
The result of the callback.
Return type
Any
on_tool_end(output: str, **kwargs: Any) → None[source]¶
Run when tool ends running.
Parameters
output (str) – The output of the tool.
on_tool_error(error: BaseException, **kwargs: Any) → None[source]¶
Run when tool errors.
Pa... | lang/api.python.langchain.com/en/latest/schema/langchain.schema.callbacks.manager.CallbackManagerForToolRun.html |
f81b10bbaf77-0 | langchain.schema.callbacks.tracers.stdout.elapsed¶
langchain.schema.callbacks.tracers.stdout.elapsed(run: Any) → str[source]¶
Get the elapsed time of a run.
Parameters
run – any object with a start_time and end_time attribute.
Returns
A string with the elapsed time in seconds ormilliseconds if time is less than a secon... | lang/api.python.langchain.com/en/latest/schema/langchain.schema.callbacks.tracers.stdout.elapsed.html |
30a27caa4509-0 | langchain.schema.runnable.passthrough.aidentity¶
async langchain.schema.runnable.passthrough.aidentity(x: Other) → Other[source]¶
An async identity function | lang/api.python.langchain.com/en/latest/schema/langchain.schema.runnable.passthrough.aidentity.html |
b355b3d2debf-0 | langchain.schema.callbacks.manager.register_configure_hook¶
langchain.schema.callbacks.manager.register_configure_hook(context_var: ContextVar[Optional[Any]], inheritable: bool, handle_class: Optional[Type[BaseCallbackHandler]] = None, env_var: Optional[str] = None) → None[source]¶ | lang/api.python.langchain.com/en/latest/schema/langchain.schema.callbacks.manager.register_configure_hook.html |
898c686070f0-0 | langchain.schema.callbacks.tracers.schemas.RunTypeEnum¶
langchain.schema.callbacks.tracers.schemas.RunTypeEnum() → Type[RunTypeEnum][source]¶
RunTypeEnum. | lang/api.python.langchain.com/en/latest/schema/langchain.schema.callbacks.tracers.schemas.RunTypeEnum.html |
8309aefcf681-0 | langchain.schema.messages.HumanMessageChunk¶
class langchain.schema.messages.HumanMessageChunk[source]¶
Bases: HumanMessage, BaseMessageChunk
A Human 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 valid m... | lang/api.python.langchain.com/en/latest/schema/langchain.schema.messages.HumanMessageChunk.html |
8309aefcf681-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/schema/langchain.schema.messages.HumanMessageChunk.html |
8309aefcf681-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... | lang/api.python.langchain.com/en/latest/schema/langchain.schema.messages.HumanMessageChunk.html |
6aee00a28c67-0 | langchain.schema.callbacks.base.ChainManagerMixin¶
class langchain.schema.callbacks.base.ChainManagerMixin[source]¶
Mixin for chain callbacks.
Methods
__init__()
on_agent_action(action, *, run_id[, ...])
Run on agent action.
on_agent_finish(finish, *, run_id[, ...])
Run on agent end.
on_chain_end(outputs, *, run_id[, p... | lang/api.python.langchain.com/en/latest/schema/langchain.schema.callbacks.base.ChainManagerMixin.html |
fa8df3b787e1-0 | langchain.schema.output.Generation¶
class langchain.schema.output.Generation[source]¶
Bases: Serializable
A single text generation output.
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 generation_inf... | lang/api.python.langchain.com/en/latest/schema/langchain.schema.output.Generation.html |
fa8df3b787e1-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/schema/langchain.schema.output.Generation.html |
fa8df3b787e1-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... | lang/api.python.langchain.com/en/latest/schema/langchain.schema.output.Generation.html |
b28ec5a1711c-0 | langchain.schema.agent.AgentFinish¶
class langchain.schema.agent.AgentFinish[source]¶
Bases: Serializable
The final return value of an ActionAgent.
Override init to support instantiation by position for backward compat.
param log: str [Required]¶
Additional information to log about the return value.
This is used to pas... | lang/api.python.langchain.com/en/latest/schema/langchain.schema.agent.AgentFinish.html |
b28ec5a1711c-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/schema/langchain.schema.agent.AgentFinish.html |
b28ec5a1711c-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... | lang/api.python.langchain.com/en/latest/schema/langchain.schema.agent.AgentFinish.html |
cd8c9f253aea-0 | langchain.schema.callbacks.tracers.schemas.ChainRun¶
class langchain.schema.callbacks.tracers.schemas.ChainRun[source]¶
Bases: BaseRun
Class for ChainRun.
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.
para... | lang/api.python.langchain.com/en/latest/schema/langchain.schema.callbacks.tracers.schemas.ChainRun.html |
cd8c9f253aea-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... | lang/api.python.langchain.com/en/latest/schema/langchain.schema.callbacks.tracers.schemas.ChainRun.html |
cd8c9f253aea-2 | classmethod from_orm(obj: Any) → Model¶
json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_n... | lang/api.python.langchain.com/en/latest/schema/langchain.schema.callbacks.tracers.schemas.ChainRun.html |
442fcab0706a-0 | langchain.schema.callbacks.manager.CallbackManagerForChainGroup¶
class langchain.schema.callbacks.manager.CallbackManagerForChainGroup(handlers: List[BaseCallbackHandler], inheritable_handlers: Optional[List[BaseCallbackHandler]] = None, parent_run_id: Optional[UUID] = None, *, parent_run_manager: CallbackManagerForCha... | lang/api.python.langchain.com/en/latest/schema/langchain.schema.callbacks.manager.CallbackManagerForChainGroup.html |
442fcab0706a-1 | Set handlers as the only handlers on the callback manager.
__init__(handlers: List[BaseCallbackHandler], inheritable_handlers: Optional[List[BaseCallbackHandler]] = None, parent_run_id: Optional[UUID] = None, *, parent_run_manager: CallbackManagerForChainRun, **kwargs: Any) → None[source]¶
Initialize callback manager.
... | lang/api.python.langchain.com/en/latest/schema/langchain.schema.callbacks.manager.CallbackManagerForChainGroup.html |
442fcab0706a-2 | Defaults to None.
Returns
The configured callback manager.
Return type
CallbackManager
copy() → CallbackManagerForChainGroup[source]¶
Copy the callback manager.
on_chain_end(outputs: Union[Dict[str, Any], Any], **kwargs: Any) → None[source]¶
Run when traced chain group ends.
Parameters
outputs (Union[Dict[str, Any], An... | lang/api.python.langchain.com/en/latest/schema/langchain.schema.callbacks.manager.CallbackManagerForChainGroup.html |
442fcab0706a-3 | Return type
List[CallbackManagerForLLMRun]
on_llm_start(serialized: Dict[str, Any], prompts: List[str], **kwargs: Any) → List[CallbackManagerForLLMRun]¶
Run when LLM starts running.
Parameters
serialized (Dict[str, Any]) – The serialized LLM.
prompts (List[str]) – The list of prompts.
run_id (UUID, optional) – The ID o... | lang/api.python.langchain.com/en/latest/schema/langchain.schema.callbacks.manager.CallbackManagerForChainGroup.html |
442fcab0706a-4 | set_handler(handler: BaseCallbackHandler, inherit: bool = True) → None¶
Set handler as the only handler on the callback manager.
set_handlers(handlers: List[BaseCallbackHandler], inherit: bool = True) → None¶
Set handlers as the only handlers on the callback manager. | lang/api.python.langchain.com/en/latest/schema/langchain.schema.callbacks.manager.CallbackManagerForChainGroup.html |
75a9888927ba-0 | langchain.schema.messages.HumanMessage¶
class langchain.schema.messages.HumanMessage[source]¶
Bases: BaseMessage
A Message from a human.
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 additional_kwarg... | lang/api.python.langchain.com/en/latest/schema/langchain.schema.messages.HumanMessage.html |
75a9888927ba-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/schema/langchain.schema.messages.HumanMessage.html |
75a9888927ba-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... | lang/api.python.langchain.com/en/latest/schema/langchain.schema.messages.HumanMessage.html |
75a9888927ba-3 | ERNIE-Bot Chat
PromptLayer ChatOpenAI
Anyscale
Anthropic Functions
LLMonitor
Context
Label Studio
PromptLayer
Log10
MLflow AI Gateway
Flyte
Arthur
Set env var OPENAI_API_KEY or load from a .env file:
Structure answers with OpenAI functions
CAMEL Role-Playing Autonomous Cooperative Agents
Multi-Agent Simulated Environme... | lang/api.python.langchain.com/en/latest/schema/langchain.schema.messages.HumanMessage.html |
2bb59a6e1512-0 | langchain.schema.exceptions.LangChainException¶
class langchain.schema.exceptions.LangChainException[source]¶
General LangChain exception. | lang/api.python.langchain.com/en/latest/schema/langchain.schema.exceptions.LangChainException.html |
2054847c72c7-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.... | lang/api.python.langchain.com/en/latest/schema/langchain.schema.vectorstore.VectorStore.html |
2054847c72c7-1 | Run similarity search with distance asynchronously.
delete([ids])
Delete by vector ID or other criteria.
from_documents(documents, embedding, **kwargs)
Return VectorStore initialized from documents and embeddings.
from_texts(texts, embedding[, metadatas])
Return VectorStore initialized from texts and embeddings.
max_ma... | lang/api.python.langchain.com/en/latest/schema/langchain.schema.vectorstore.VectorStore.html |
2054847c72c7-2 | Run more documents through the embeddings and add to the vectorstore.
Parameters
(List[Document] (documents) – Documents to add to the vectorstore.
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][so... | lang/api.python.langchain.com/en/latest/schema/langchain.schema.vectorstore.VectorStore.html |
2054847c72c7-3 | Return docs selected using the maximal marginal relevance.
async amax_marginal_relevance_search_by_vector(embedding: List[float], 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.
as_retriever(**kwargs: Any) → Vec... | lang/api.python.langchain.com/en/latest/schema/langchain.schema.vectorstore.VectorStore.html |
2054847c72c7-4 | search_kwargs={'k': 5, 'fetch_k': 50}
)
# Only retrieve documents that have a relevance score
# Above a certain threshold
docsearch.as_retriever(
search_type="similarity_score_threshold",
search_kwargs={'score_threshold': 0.8}
)
# Only get the single most similar document from the dataset
docsearch.as_retriever... | lang/api.python.langchain.com/en/latest/schema/langchain.schema.vectorstore.VectorStore.html |
2054847c72c7-5 | Returns
List of Tuples of (doc, similarity_score)
async asimilarity_search_with_score(*args: Any, **kwargs: Any) → List[Tuple[Document, float]][source]¶
Run similarity search with distance asynchronously.
delete(ids: Optional[List[str]] = None, **kwargs: Any) → Optional[bool][source]¶
Delete by vector ID or other crite... | lang/api.python.langchain.com/en/latest/schema/langchain.schema.vectorstore.VectorStore.html |
2054847c72c7-6 | Defaults to 0.5.
Returns
List of Documents selected by maximal marginal relevance.
max_marginal_relevance_search_by_vector(embedding: List[float], 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... | lang/api.python.langchain.com/en/latest/schema/langchain.schema.vectorstore.VectorStore.html |
2054847c72c7-7 | Return docs and relevance scores in the range [0, 1].
0 is dissimilar, 1 is most similar.
Parameters
query – input text
k – Number of Documents to return. Defaults to 4.
**kwargs – kwargs to be passed to similarity search. Should include:
score_threshold: Optional, a floating point value between 0 to 1 to
filter the re... | lang/api.python.langchain.com/en/latest/schema/langchain.schema.vectorstore.VectorStore.html |
f1a8fd16af41-0 | langchain.schema.callbacks.base.CallbackManagerMixin¶
class langchain.schema.callbacks.base.CallbackManagerMixin[source]¶
Mixin for callback manager.
Methods
__init__()
on_chain_start(serialized, inputs, *, run_id)
Run when chain starts running.
on_chat_model_start(serialized, messages, *, ...)
Run when a chat model st... | lang/api.python.langchain.com/en/latest/schema/langchain.schema.callbacks.base.CallbackManagerMixin.html |
f1a8fd16af41-1 | Run when LLM starts running.
on_retriever_start(serialized: Dict[str, Any], query: str, *, run_id: UUID, parent_run_id: Optional[UUID] = None, tags: Optional[List[str]] = None, metadata: Optional[Dict[str, Any]] = None, **kwargs: Any) → Any[source]¶
Run when Retriever starts running.
on_tool_start(serialized: Dict[str,... | lang/api.python.langchain.com/en/latest/schema/langchain.schema.callbacks.base.CallbackManagerMixin.html |
0eb2135728c3-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. | lang/api.python.langchain.com/en/latest/schema/langchain.schema.messages.messages_to_dict.html |
a99f075858b1-0 | langchain.schema.output_parser.NoOpOutputParser¶
langchain.schema.output_parser.NoOpOutputParser¶
alias of StrOutputParser | lang/api.python.langchain.com/en/latest/schema/langchain.schema.output_parser.NoOpOutputParser.html |
7a551cfc5944-0 | langchain.schema.callbacks.manager.atrace_as_chain_group¶
langchain.schema.callbacks.manager.atrace_as_chain_group(group_name: str, callback_manager: Optional[AsyncCallbackManager] = None, *, inputs: Optional[Dict[str, Any]] = None, project_name: Optional[str] = None, example_id: Optional[Union[str, UUID]] = None, run_... | lang/api.python.langchain.com/en/latest/schema/langchain.schema.callbacks.manager.atrace_as_chain_group.html |
780ee3a3fdb2-0 | langchain.schema.output.ChatResult¶
class langchain.schema.output.ChatResult[source]¶
Bases: BaseModel
Class that contains all results for a single chat model call.
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... | lang/api.python.langchain.com/en/latest/schema/langchain.schema.output.ChatResult.html |
780ee3a3fdb2-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/schema/langchain.schema.output.ChatResult.html |
780ee3a3fdb2-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/schema/langchain.schema.output.ChatResult.html |
8405d655de0b-0 | langchain.schema.output_parser.BaseOutputParser¶
class langchain.schema.output_parser.BaseOutputParser[source]¶
Bases: BaseLLMOutputParser, RunnableSerializable[Union[str, BaseMessage], T]
Base class to parse the output of an LLM call.
Output parsers help structure language model responses.
Example
class BooleanOutputP... | lang/api.python.langchain.com/en/latest/schema/langchain.schema.output_parser.BaseOutputParser.html |
8405d655de0b-1 | The default implementation allows usage of async code even if
the runnable did not implement a native async version of invoke.
Subclasses should override this method if they can run asynchronously.
async aparse(text: str) → T[source]¶
Parse a single string model output into some structure.
Parameters
text – String outp... | lang/api.python.langchain.com/en/latest/schema/langchain.schema.output_parser.BaseOutputParser.html |
8405d655de0b-2 | 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: AsyncIterator[Input], config: Optional[RunnableConfig] = None, *... | lang/api.python.langchain.com/en/latest/schema/langchain.schema.output_parser.BaseOutputParser.html |
8405d655de0b-3 | configurable_fields(**kwargs: Union[ConfigurableField, ConfigurableFieldSingleOption, ConfigurableFieldMultiOption]) → RunnableSerializable[Input, Output]¶
classmethod construct(_fields_set: Optional[SetStr] = None, **values: Any) → Model¶
Creates a new model setting __dict__ and __fields_set__ from trusted or pre-vali... | lang/api.python.langchain.com/en/latest/schema/langchain.schema.output_parser.BaseOutputParser.html |
8405d655de0b-4 | methods will have a dynamic input schema that depends on which
configuration the runnable is invoked with.
This method allows to get an input schema for a specific configuration.
Parameters
config – A config to use when generating the schema.
Returns
A pydantic model that can be used to validate input.
classmethod get_... | lang/api.python.langchain.com/en/latest/schema/langchain.schema.output_parser.BaseOutputParser.html |
8405d655de0b-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/schema/langchain.schema.output_parser.BaseOutputParser.html |
8405d655de0b-6 | parse_result(result: List[Generation], *, partial: bool = False) → T[source]¶
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... | lang/api.python.langchain.com/en/latest/schema/langchain.schema.output_parser.BaseOutputParser.html |
8405d655de0b-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/schema/langchain.schema.output_parser.BaseOutputParser.html |
8405d655de0b-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/schema/langchain.schema.output_parser.BaseOutputParser.html |
8405d655de0b-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/schema/langchain.schema.output_parser.BaseOutputParser.html |
bbd8aed39e98-0 | langchain.schema.callbacks.tracers.schemas.LLMRun¶
class langchain.schema.callbacks.tracers.schemas.LLMRun[source]¶
Bases: BaseRun
Class for LLMRun.
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 chil... | lang/api.python.langchain.com/en/latest/schema/langchain.schema.callbacks.tracers.schemas.LLMRun.html |
bbd8aed39e98-1 | exclude – fields to exclude from new model, as with values this takes precedence over include
update – values to change/add in the new model. Note: the data is not validated before creating
the new model: you should trust this data
deep – set to True to make a deep copy of the model
Returns
new model instance
dict(*, i... | lang/api.python.langchain.com/en/latest/schema/langchain.schema.callbacks.tracers.schemas.LLMRun.html |
bbd8aed39e98-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/schema/langchain.schema.callbacks.tracers.schemas.LLMRun.html |
c6045c57fe7d-0 | langchain.schema.output.RunInfo¶
class langchain.schema.output.RunInfo[source]¶
Bases: BaseModel
Class that contains metadata for a single execution of a Chain or model.
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 va... | lang/api.python.langchain.com/en/latest/schema/langchain.schema.output.RunInfo.html |
c6045c57fe7d-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/schema/langchain.schema.output.RunInfo.html |
c6045c57fe7d-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/schema/langchain.schema.output.RunInfo.html |
f9f9777e4b1c-0 | langchain.schema.messages.merge_content¶
langchain.schema.messages.merge_content(first_content: Union[str, List[Union[str, Dict]]], second_content: Union[str, List[Union[str, Dict]]]) → Union[str, List[Union[str, Dict]]][source]¶ | lang/api.python.langchain.com/en/latest/schema/langchain.schema.messages.merge_content.html |
8395adadeacb-0 | langchain.schema.runnable.utils.GetLambdaSource¶
class langchain.schema.runnable.utils.GetLambdaSource[source]¶
Get the source code of a lambda function.
Initialize the visitor.
Methods
__init__()
Initialize the visitor.
generic_visit(node)
Called if no explicit visitor function exists for a node.
visit(node)
Visit a n... | lang/api.python.langchain.com/en/latest/schema/langchain.schema.runnable.utils.GetLambdaSource.html |
5e693f824335-0 | langchain.schema.callbacks.manager.AsyncCallbackManager¶
class langchain.schema.callbacks.manager.AsyncCallbackManager(handlers: List[BaseCallbackHandler], inheritable_handlers: Optional[List[BaseCallbackHandler]] = None, parent_run_id: Optional[UUID] = None, *, tags: Optional[List[str]] = None, inheritable_tags: Optio... | lang/api.python.langchain.com/en/latest/schema/langchain.schema.callbacks.manager.AsyncCallbackManager.html |
5e693f824335-1 | Set handlers as the only handlers on the callback manager.
__init__(handlers: List[BaseCallbackHandler], inheritable_handlers: Optional[List[BaseCallbackHandler]] = None, parent_run_id: Optional[UUID] = None, *, tags: Optional[List[str]] = None, inheritable_tags: Optional[List[str]] = None, metadata: Optional[Dict[str,... | lang/api.python.langchain.com/en/latest/schema/langchain.schema.callbacks.manager.AsyncCallbackManager.html |
5e693f824335-2 | inheritable_metadata (Optional[Dict[str, Any]], optional) – The inheritable
metadata. Defaults to None.
local_metadata (Optional[Dict[str, Any]], optional) – The local metadata.
Defaults to None.
Returns
The configured async callback manager.
Return type
AsyncCallbackManager
copy() → T¶
Copy the callback manager.
async... | lang/api.python.langchain.com/en/latest/schema/langchain.schema.callbacks.manager.AsyncCallbackManager.html |
5e693f824335-3 | Run when LLM starts running.
Parameters
serialized (Dict[str, Any]) – The serialized LLM.
prompts (List[str]) – The list of prompts.
run_id (UUID, optional) – The ID of the run. Defaults to None.
Returns
The list of asynccallback managers, one for each LLM Run corresponding
to each prompt.
Return type
List[AsyncCallbac... | lang/api.python.langchain.com/en/latest/schema/langchain.schema.callbacks.manager.AsyncCallbackManager.html |
5e693f824335-4 | Set handler as the only handler on the callback manager.
set_handlers(handlers: List[BaseCallbackHandler], inherit: bool = True) → None¶
Set handlers as the only handlers on the callback manager. | lang/api.python.langchain.com/en/latest/schema/langchain.schema.callbacks.manager.AsyncCallbackManager.html |
6f2a7a6feb14-0 | langchain.schema.runnable.passthrough.RunnableAssign¶
class langchain.schema.runnable.passthrough.RunnableAssign[source]¶
Bases: RunnableSerializable[Dict[str, Any], Dict[str, Any]]
A runnable that assigns key-value pairs to Dict[str, Any] inputs.
Create a new model by parsing and validating input data from keyword arg... | lang/api.python.langchain.com/en/latest/schema/langchain.schema.runnable.passthrough.RunnableAssign.html |
6f2a7a6feb14-1 | 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/schema/langchain.schema.runnable.passthrough.RunnableAssign.html |
6f2a7a6feb14-2 | 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/schema/langchain.schema.runnable.passthrough.RunnableAssign.html |
6f2a7a6feb14-3 | exclude – fields to exclude from new model, as with values this takes precedence over include
update – values to change/add in the new model. Note: the data is not validated before creating
the new model: you should trust this data
deep – set to True to make a deep copy of the model
Returns
new model instance
dict(*, i... | lang/api.python.langchain.com/en/latest/schema/langchain.schema.runnable.passthrough.RunnableAssign.html |
6f2a7a6feb14-4 | 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 that depends on which
configuration the runnable is invoked with.
This method allows to get an output schema for a specific co... | lang/api.python.langchain.com/en/latest/schema/langchain.schema.runnable.passthrough.RunnableAssign.html |
6f2a7a6feb14-5 | 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... | lang/api.python.langchain.com/en/latest/schema/langchain.schema.runnable.passthrough.RunnableAssign.html |
6f2a7a6feb14-6 | 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/schema/langchain.schema.runnable.passthrough.RunnableAssign.html |
6f2a7a6feb14-7 | 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/schema/langchain.schema.runnable.passthrough.RunnableAssign.html |
6f2a7a6feb14-8 | 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/schema/langchain.schema.runnable.passthrough.RunnableAssign.html |
2f9898eef758-0 | langchain.schema.runnable.base.RunnableGenerator¶
class langchain.schema.runnable.base.RunnableGenerator(transform: Union[Callable[[Iterator[Input]], Iterator[Output]], Callable[[AsyncIterator[Input]], AsyncIterator[Output]]], atransform: Optional[Callable[[AsyncIterator[Input]], AsyncIterator[Output]]] = None)[source]... | lang/api.python.langchain.com/en/latest/schema/langchain.schema.runnable.base.RunnableGenerator.html |
2f9898eef758-1 | get_output_schema([config])
Get a pydantic model that can be used to validate output to the runnable.
invoke(input[, config])
Transform a single input into an output.
map()
Return a new Runnable that maps a list of inputs to a list of outputs, by calling invoke() with each input.
stream(input[, config])
Default impleme... | lang/api.python.langchain.com/en/latest/schema/langchain.schema.runnable.base.RunnableGenerator.html |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.