id stringlengths 14 15 | text stringlengths 44 2.47k | source stringlengths 61 181 |
|---|---|---|
f43f08380705-6 | For example,{“openai_api_key”: “OPENAI_API_KEY”}
property output_schema: Type[pydantic.main.BaseModel]¶ | https://api.python.langchain.com/en/latest/schema/langchain.schema.output_parser.BaseCumulativeTransformOutputParser.html |
8362e3a4c40f-0 | langchain.schema.agent.AgentFinish¶
class langchain.schema.agent.AgentFinish[source]¶
Bases: Serializable
The final return value of an ActionAgent.
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: ... | https://api.python.langchain.com/en/latest/schema/langchain.schema.agent.AgentFinish.html |
8362e3a4c40f-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.agent.AgentFinish.html |
8362e3a4c40f-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.agent.AgentFinish.html |
c810963e9dee-0 | langchain.schema.messages.BaseMessageChunk¶
class langchain.schema.messages.BaseMessageChunk[source]¶
Bases: BaseMessage
A Message chunk, which can be concatenated with other Message chunks.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot b... | https://api.python.langchain.com/en/latest/schema/langchain.schema.messages.BaseMessageChunk.html |
c810963e9dee-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.BaseMessageChunk.html |
c810963e9dee-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.BaseMessageChunk.html |
ebc1fa164791-0 | langchain.schema.runnable.base.RunnableMap¶
class langchain.schema.runnable.base.RunnableMap[source]¶
Bases: Serializable, Runnable[Input, Dict[str, Any]]
A runnable that runs a mapping of runnables in parallel,
and returns a mapping of their outputs.
Create a new model by parsing and validating input data from keyword... | https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.base.RunnableMap.html |
ebc1fa164791-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.RunnableMap.html |
ebc1fa164791-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.RunnableMap.html |
ebc1fa164791-3 | namespace is [“langchain”, “llms”, “openai”]
invoke(input: Input, config: Optional[RunnableConfig] = None) → Dict[str, Any][source]¶
classmethod is_lc_serializable() → bool[source]¶
Is this class serializable?
json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[Abstract... | https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.base.RunnableMap.html |
ebc1fa164791-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.RunnableMap.html |
ebc1fa164791-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[langchain.schema.runnable.utils.Output]¶
property input_schema... | https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.base.RunnableMap.html |
e856c2f9631e-0 | langchain.schema.runnable.passthrough.aidentity¶
async langchain.schema.runnable.passthrough.aidentity(x: Input) → Input[source]¶ | https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.passthrough.aidentity.html |
57d40ba17fdd-0 | langchain.schema.runnable.utils.indent_lines_after_first¶
langchain.schema.runnable.utils.indent_lines_after_first(text: str, prefix: str) → str[source]¶
Indent all lines of text after the first line.
Parameters
text – The text to indent
prefix – Used to determine the number of spaces to indent
Returns
The indented tex... | https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.utils.indent_lines_after_first.html |
41cf5252616f-0 | langchain.schema.output_parser.BaseOutputParser¶
class langchain.schema.output_parser.BaseOutputParser[source]¶
Bases: BaseLLMOutputParser, Runnable[Union[str, BaseMessage], T]
Base class to parse the output of an LLM call.
Output parsers help structure language model responses.
Example
class BooleanOutputParser(BaseOu... | https://api.python.langchain.com/en/latest/schema/langchain.schema.output_parser.BaseOutputParser.html |
41cf5252616f-1 | Default implementation of ainvoke, which calls invoke in a thread pool.
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 output of a language model.
Returns
Structured output.
asyn... | https://api.python.langchain.com/en/latest/schema/langchain.schema.output_parser.BaseOutputParser.html |
41cf5252616f-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]¶
Default implementation of atransform, which buffers input and calls astream.
Subcla... | https://api.python.langchain.com/en/latest/schema/langchain.schema.output_parser.BaseOutputParser.html |
41cf5252616f-3 | 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[source]¶
Return dictionary representation of output parser.
classmethod from_orm(obj: Any) → Model¶
get_format_instructions() → str[source]¶
Instructions on how the LLM out... | https://api.python.langchain.com/en/latest/schema/langchain.schema.output_parser.BaseOutputParser.html |
41cf5252616f-4 | 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 each input.
abstract parse(text: str) → T[source]¶
Parse a single string model output into some structure.
Parameters
text – String output of a language model.
Retu... | https://api.python.langchain.com/en/latest/schema/langchain.schema.output_parser.BaseOutputParser.html |
41cf5252616f-5 | 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/schema/langchain.schema.output_parser.BaseOutputParser.html |
41cf5252616f-6 | property InputType: Any¶
property OutputType: type[T]¶
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 map of constru... | https://api.python.langchain.com/en/latest/schema/langchain.schema.output_parser.BaseOutputParser.html |
a8c90524085b-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... | https://api.python.langchain.com/en/latest/schema/langchain.schema.messages.HumanMessageChunk.html |
a8c90524085b-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.HumanMessageChunk.html |
a8c90524085b-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.HumanMessageChunk.html |
4d3661673cc2-0 | langchain.schema.runnable.utils.gather_with_concurrency¶
async langchain.schema.runnable.utils.gather_with_concurrency(n: Optional[int], *coros: Coroutine) → list[source]¶ | https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.utils.gather_with_concurrency.html |
ade74af141e8-0 | langchain.schema.chat_history.BaseChatMessageHistory¶
class langchain.schema.chat_history.BaseChatMessageHistory[source]¶
Abstract base class for storing chat message history.
See ChatMessageHistory for default implementation.
Example
class FileChatMessageHistory(BaseChatMessageHistory):
storage_path: str
sess... | https://api.python.langchain.com/en/latest/schema/langchain.schema.chat_history.BaseChatMessageHistory.html |
ade74af141e8-1 | Convenience method for adding a human message string to the store.
Parameters
message – The string contents of a human message.
abstract clear() → None[source]¶
Remove all messages from the store | https://api.python.langchain.com/en/latest/schema/langchain.schema.chat_history.BaseChatMessageHistory.html |
e8702df5b269-0 | langchain.schema.runnable.base.RunnableBranch¶
class langchain.schema.runnable.base.RunnableBranch[source]¶
Bases: Serializable, Runnable[Input, Output]
A Runnable that selects which branch to run based on a condition.
The runnable is initialized with a list of (condition, runnable) pairs and
a default branch.
When ope... | https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.base.RunnableBranch.html |
e8702df5b269-1 | Default implementation of abatch, which calls ainvoke N times.
Subclasses should override this method if they can batch more efficiently.
async ainvoke(input: Input, config: Optional[RunnableConfig] = None, **kwargs: Any) → Output[source]¶
Async version of invoke.
async astream(input: Input, config: Optional[RunnableCo... | https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.base.RunnableBranch.html |
e8702df5b269-2 | input is still being generated.
batch(inputs: List[Input], config: Optional[Union[RunnableConfig, List[RunnableConfig]]] = None, *, return_exceptions: bool = False, **kwargs: Optional[Any]) → List[Output]¶
Default implementation of batch, which calls invoke N times.
Subclasses should override this method if they can ba... | https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.base.RunnableBranch.html |
e8702df5b269-3 | 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.runnable.base.RunnableBranch.html |
e8702df5b269-4 | 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 each input.
classmethod parse_file... | https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.base.RunnableBranch.html |
e8702df5b269-5 | 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 Runnable, returning a new Runna... | https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.base.RunnableBranch.html |
e51a9a8b3f6e-0 | langchain.schema.prompt.PromptValue¶
class langchain.schema.prompt.PromptValue[source]¶
Bases: Serializable, ABC
Base abstract class for inputs to any language model.
PromptValues can be converted to both LLM (pure text-generation) inputs andChatModel inputs.
Create a new model by parsing and validating input data from... | https://api.python.langchain.com/en/latest/schema/langchain.schema.prompt.PromptValue.html |
e51a9a8b3f6e-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.prompt.PromptValue.html |
e51a9a8b3f6e-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.prompt.PromptValue.html |
d0a742abd57b-0 | langchain.schema.runnable.utils.AddableDict¶
class langchain.schema.runnable.utils.AddableDict[source]¶
Dictionary that can be added to another dictionary.
Methods
__init__(*args, **kwargs)
clear()
copy()
fromkeys([value])
Create a new dictionary with keys from iterable and values set to value.
get(key[, default])
Retu... | https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.utils.AddableDict.html |
d0a742abd57b-1 | pop(k[, d]) → v, remove specified key and return the corresponding value.¶
If the key is not found, return the default if given; otherwise,
raise a KeyError.
popitem()¶
Remove and return a (key, value) pair as a 2-tuple.
Pairs are returned in LIFO (last-in, first-out) order.
Raises KeyError if the dict is empty.
setdef... | https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.utils.AddableDict.html |
423f244a3aa4-0 | langchain.schema.runnable.utils.accepts_run_manager¶
langchain.schema.runnable.utils.accepts_run_manager(callable: Callable[[...], Any]) → bool[source]¶ | https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.utils.accepts_run_manager.html |
48591e0fc083-0 | langchain.schema.storage.BaseStore¶
class langchain.schema.storage.BaseStore[source]¶
Abstract interface for a key-value store.
Methods
__init__()
mdelete(keys)
Delete the given keys and their associated values.
mget(keys)
Get the values associated with the given keys.
mset(key_value_pairs)
Set the values for the given... | https://api.python.langchain.com/en/latest/schema/langchain.schema.storage.BaseStore.html |
ab67c493f34b-0 | langchain.schema.output.ChatGeneration¶
class langchain.schema.output.ChatGeneration[source]¶
Bases: Generation
A single chat 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 generati... | https://api.python.langchain.com/en/latest/schema/langchain.schema.output.ChatGeneration.html |
ab67c493f34b-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.output.ChatGeneration.html |
ab67c493f34b-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.output.ChatGeneration.html |
be1ac099ee43-0 | langchain.schema.runnable.passthrough.RunnablePassthrough¶
class langchain.schema.runnable.passthrough.RunnablePassthrough[source]¶
Bases: Serializable, Runnable[Input, Input]
A runnable that passes through the input.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError... | https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.passthrough.RunnablePassthrough.html |
be1ac099ee43-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.passthrough.RunnablePassthrough.html |
be1ac099ee43-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.passthrough.RunnablePassthrough.html |
be1ac099ee43-3 | namespace is [“langchain”, “llms”, “openai”]
invoke(input: Input, config: Optional[RunnableConfig] = None) → Input[source]¶
classmethod is_lc_serializable() → bool[source]¶
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.runnable.passthrough.RunnablePassthrough.html |
be1ac099ee43-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.passthrough.RunnablePassthrough.html |
be1ac099ee43-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: Any¶
property input_schema: Type[pydantic.main.BaseModel]¶
property... | https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.passthrough.RunnablePassthrough.html |
b98b3951e96d-0 | langchain.schema.output_parser.OutputParserException¶
class langchain.schema.output_parser.OutputParserException(error: Any, observation: Optional[str] = None, llm_output: Optional[str] = None, send_to_llm: bool = False)[source]¶
Exception that output parsers should raise to signify a parsing error.
This exists to diff... | https://api.python.langchain.com/en/latest/schema/langchain.schema.output_parser.OutputParserException.html |
fdc739e8226d-0 | langchain.schema.runnable.config.get_callback_manager_for_config¶
langchain.schema.runnable.config.get_callback_manager_for_config(config: RunnableConfig) → CallbackManager[source]¶ | https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.config.get_callback_manager_for_config.html |
5a72ac75d97e-0 | langchain.schema.prompt_template.format_document¶
langchain.schema.prompt_template.format_document(doc: Document, prompt: BasePromptTemplate) → str[source]¶
Format a document into a string based on a prompt template.
First, this pulls information from the document from two sources:
page_content:This takes the informati... | https://api.python.langchain.com/en/latest/schema/langchain.schema.prompt_template.format_document.html |
44c1d0f250fb-0 | langchain.schema.runnable.utils.add¶
langchain.schema.runnable.utils.add(addables: Iterable[Addable]) → Optional[Addable][source]¶ | https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.utils.add.html |
d840915eb9ae-0 | langchain.schema.runnable.base.RunnableSequence¶
class langchain.schema.runnable.base.RunnableSequence[source]¶
Bases: Serializable, Runnable[Input, Output]
A sequence of runnables, where the output of each is the input of the next.
Create a new model by parsing and validating input data from keyword arguments.
Raises ... | https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.base.RunnableSequence.html |
d840915eb9ae-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.RunnableSequence.html |
d840915eb9ae-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.RunnableSequence.html |
d840915eb9ae-3 | namespace is [“langchain”, “llms”, “openai”]
invoke(input: Input, config: Optional[RunnableConfig] = None) → Output[source]¶
classmethod is_lc_serializable() → bool[source]¶
Is this class serializable?
json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntSt... | https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.base.RunnableSequence.html |
d840915eb9ae-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.RunnableSequence.html |
d840915eb9ae-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.RunnableSequence.html |
24fe18b8b3e3-0 | langchain.schema.runnable.router.RouterInput¶
class langchain.schema.runnable.router.RouterInput[source]¶
A Router input.
key¶
The key to route on.
Type
str
input¶
The input to pass to the selected runnable.
Type
Any
Attributes
key
input
Methods
__init__(*args, **kwargs)
clear()
copy()
fromkeys([value])
Create a new di... | https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.router.RouterInput.html |
24fe18b8b3e3-1 | items() → a set-like object providing a view on D's items¶
keys() → a set-like object providing a view on D's keys¶
pop(k[, d]) → v, remove specified key and return the corresponding value.¶
If the key is not found, return the default if given; otherwise,
raise a KeyError.
popitem()¶
Remove and return a (key, value) pa... | https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.router.RouterInput.html |
e470933c8fb3-0 | langchain.schema.output.ChatGenerationChunk¶
class langchain.schema.output.ChatGenerationChunk[source]¶
Bases: ChatGeneration
A ChatGeneration chunk, which can be concatenated with otherChatGeneration chunks.
message¶
The message chunk output by the chat model.
Create a new model by parsing and validating input data fr... | https://api.python.langchain.com/en/latest/schema/langchain.schema.output.ChatGenerationChunk.html |
e470933c8fb3-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.output.ChatGenerationChunk.html |
e470933c8fb3-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.output.ChatGenerationChunk.html |
77b12384e277-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... | https://api.python.langchain.com/en/latest/schema/langchain.schema.messages.HumanMessage.html |
77b12384e277-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.HumanMessage.html |
77b12384e277-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.HumanMessage.html |
77b12384e277-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... | https://api.python.langchain.com/en/latest/schema/langchain.schema.messages.HumanMessage.html |
008bd1a2c560-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... | https://api.python.langchain.com/en/latest/schema/langchain.schema.output.RunInfo.html |
008bd1a2c560-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.output.RunInfo.html |
008bd1a2c560-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... | https://api.python.langchain.com/en/latest/schema/langchain.schema.output.RunInfo.html |
a2950abec147-0 | langchain.schema.runnable.base.coerce_to_runnable¶
langchain.schema.runnable.base.coerce_to_runnable(thing: Union[Runnable[Input, Output], Callable[[Input], Output], Callable[[Input], Awaitable[Output]], Callable[[Iterator[Input]], Iterator[Output]], Callable[[AsyncIterator[Input]], AsyncIterator[Output]], Mapping[str,... | https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.base.coerce_to_runnable.html |
2a866f1ef9eb-0 | langchain.schema.output_parser.BaseLLMOutputParser¶
class langchain.schema.output_parser.BaseLLMOutputParser[source]¶
Bases: Serializable, Generic[T], ABC
Abstract base class for parsing the outputs of a model.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the... | https://api.python.langchain.com/en/latest/schema/langchain.schema.output_parser.BaseLLMOutputParser.html |
2a866f1ef9eb-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.output_parser.BaseLLMOutputParser.html |
2a866f1ef9eb-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.output_parser.BaseLLMOutputParser.html |
f558c3515c66-0 | langchain.schema.runnable.passthrough.RunnableAssign¶
class langchain.schema.runnable.passthrough.RunnableAssign[source]¶
Bases: Serializable, Runnable[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 a... | https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.passthrough.RunnableAssign.html |
f558c3515c66-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.passthrough.RunnableAssign.html |
f558c3515c66-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.passthrough.RunnableAssign.html |
f558c3515c66-3 | namespace is [“langchain”, “llms”, “openai”]
invoke(input: Dict[str, Any], config: Optional[RunnableConfig] = None, **kwargs: Any) → Dict[str, Any][source]¶
classmethod is_lc_serializable() → bool[source]¶
Is this class serializable?
json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude:... | https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.passthrough.RunnableAssign.html |
f558c3515c66-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: Dict[str, Any], config: Optional[RunnableConfig] = None, **kwargs: Any... | https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.passthrough.RunnableAssign.html |
f558c3515c66-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.passthrough.RunnableAssign.html |
e3f4eb0d8d04-0 | langchain.schema.runnable.config.get_executor_for_config¶
langchain.schema.runnable.config.get_executor_for_config(config: RunnableConfig) → Generator[Executor, None, None][source]¶ | https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.config.get_executor_for_config.html |
0b4f35b35d11-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... | https://api.python.langchain.com/en/latest/schema/langchain.schema.output.Generation.html |
0b4f35b35d11-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.output.Generation.html |
0b4f35b35d11-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.output.Generation.html |
094183158783-0 | langchain.schema.messages.ChatMessageChunk¶
class langchain.schema.messages.ChatMessageChunk[source]¶
Bases: ChatMessage, BaseMessageChunk
A Chat 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 model... | https://api.python.langchain.com/en/latest/schema/langchain.schema.messages.ChatMessageChunk.html |
094183158783-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.ChatMessageChunk.html |
094183158783-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.ChatMessageChunk.html |
bcc8f6a1aafd-0 | langchain.schema.messages.FunctionMessage¶
class langchain.schema.messages.FunctionMessage[source]¶
Bases: BaseMessage
A Message for passing the result of executing a function back to a model.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot... | https://api.python.langchain.com/en/latest/schema/langchain.schema.messages.FunctionMessage.html |
bcc8f6a1aafd-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.FunctionMessage.html |
bcc8f6a1aafd-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.FunctionMessage.html |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.