id stringlengths 14 15 | text stringlengths 49 2.47k | source stringlengths 61 166 |
|---|---|---|
d1c0b8c72256-8 | to the model provider API call.
Returns
Top model prediction as a string.
predict_messages(messages: List[BaseMessage], *, stop: Optional[Sequence[str]] = None, **kwargs: Any) → BaseMessage¶
Pass a message sequence to the model and return a message prediction.
Use this method when passing in chat messages. If you want ... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.self_hosted_hugging_face.SelfHostedHuggingFaceInstructEmbeddings.html |
d1c0b8c72256-9 | classmethod validate(value: Any) → Model¶
with_fallbacks(fallbacks: ~typing.Sequence[~langchain.schema.runnable.Runnable[~langchain.schema.runnable.Input, ~langchain.schema.runnable.Output]], *, exceptions_to_handle: ~typing.Tuple[~typing.Type[BaseException]] = (<class 'Exception'>,)) → RunnableWithFallbacks[Input, Out... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.self_hosted_hugging_face.SelfHostedHuggingFaceInstructEmbeddings.html |
34802e90bdd1-0 | langchain.embeddings.gpt4all.GPT4AllEmbeddings¶
class langchain.embeddings.gpt4all.GPT4AllEmbeddings[source]¶
Bases: BaseModel, Embeddings
GPT4All embedding models.
To use, you should have the gpt4all python package installed
Example
from langchain.embeddings import GPT4AllEmbeddings
embeddings = GPT4AllEmbeddings()
Cr... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.gpt4all.GPT4AllEmbeddings.html |
34802e90bdd1-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/embeddings/langchain.embeddings.gpt4all.GPT4AllEmbeddings.html |
34802e90bdd1-2 | classmethod parse_file(path: Union[str, Path], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) → Model¶
classmethod parse_obj(obj: Any) → Model¶
classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.gpt4all.GPT4AllEmbeddings.html |
796080494f3c-0 | langchain.embeddings.aleph_alpha.AlephAlphaSymmetricSemanticEmbedding¶
class langchain.embeddings.aleph_alpha.AlephAlphaSymmetricSemanticEmbedding[source]¶
Bases: AlephAlphaAsymmetricSemanticEmbedding
The symmetric version of the Aleph Alpha’s semantic embeddings.
The main difference is that here, both the documents an... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.aleph_alpha.AlephAlphaSymmetricSemanticEmbedding.html |
796080494f3c-1 | Determines in which datacenters the request may be processed.
You can either set the parameter to “aleph-alpha” or omit it (defaulting to None).
Not setting this value, or setting it to None, gives us maximal flexibility
in processing your request in our
own datacenters and on servers hosted with other providers.
Choos... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.aleph_alpha.AlephAlphaSymmetricSemanticEmbedding.html |
796080494f3c-2 | Asynchronous Embed query text.
classmethod construct(_fields_set: Optional[SetStr] = None, **values: Any) → Model¶
Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data.
Default values are respected, but no other validation is performed.
Behaves as if Config.extra = ‘allow’ was set ... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.aleph_alpha.AlephAlphaSymmetricSemanticEmbedding.html |
796080494f3c-3 | Returns
List of embeddings, one for each text.
embed_query(text: str) → List[float][source]¶
Call out to Aleph Alpha’s asymmetric, query embedding endpoint
:param text: The text to embed.
Returns
Embeddings for the text.
classmethod from_orm(obj: Any) → Model¶
json(*, include: Optional[Union[AbstractSetIntStr, MappingI... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.aleph_alpha.AlephAlphaSymmetricSemanticEmbedding.html |
796080494f3c-4 | 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¶
Examples using AlephAlphaSymmetricSemanticEmbedding¶
Aleph Alpha | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.aleph_alpha.AlephAlphaSymmetricSemanticEmbedding.html |
043b951974a2-0 | langchain.embeddings.google_palm.GooglePalmEmbeddings¶
class langchain.embeddings.google_palm.GooglePalmEmbeddings[source]¶
Bases: BaseModel, Embeddings
Google’s PaLM Embeddings APIs.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parse... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.google_palm.GooglePalmEmbeddings.html |
043b951974a2-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/embeddings/langchain.embeddings.google_palm.GooglePalmEmbeddings.html |
043b951974a2-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... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.google_palm.GooglePalmEmbeddings.html |
b89621b96b64-0 | langchain.embeddings.spacy_embeddings.SpacyEmbeddings¶
class langchain.embeddings.spacy_embeddings.SpacyEmbeddings[source]¶
Bases: BaseModel, Embeddings
Embeddings by SpaCy models.
It only supports the ‘en_core_web_sm’ model.
nlp¶
The Spacy model loaded into memory.
Type
Any
embed_documents(texts
List[str]) -> List[Lis... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.spacy_embeddings.SpacyEmbeddings.html |
b89621b96b64-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/embeddings/langchain.embeddings.spacy_embeddings.SpacyEmbeddings.html |
b89621b96b64-2 | The embedding for the text.
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_defau... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.spacy_embeddings.SpacyEmbeddings.html |
19fd0f103197-0 | langchain.embeddings.fake.FakeEmbeddings¶
class langchain.embeddings.fake.FakeEmbeddings[source]¶
Bases: Embeddings, BaseModel
Fake embedding 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 valid model.
param size... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.fake.FakeEmbeddings.html |
19fd0f103197-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/embeddings/langchain.embeddings.fake.FakeEmbeddings.html |
19fd0f103197-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... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.fake.FakeEmbeddings.html |
3da5110e5524-0 | langchain.embeddings.jina.JinaEmbeddings¶
class langchain.embeddings.jina.JinaEmbeddings[source]¶
Bases: BaseModel, Embeddings
Jina embedding models.
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 jin... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.jina.JinaEmbeddings.html |
3da5110e5524-1 | 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(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[boo... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.jina.JinaEmbeddings.html |
3da5110e5524-2 | classmethod parse_file(path: Union[str, Path], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) → Model¶
classmethod parse_obj(obj: Any) → Model¶
classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.jina.JinaEmbeddings.html |
e008049c5b78-0 | langchain.embeddings.openai.async_embed_with_retry¶
async langchain.embeddings.openai.async_embed_with_retry(embeddings: OpenAIEmbeddings, **kwargs: Any) → Any[source]¶
Use tenacity to retry the embedding call. | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.openai.async_embed_with_retry.html |
efc01afd050d-0 | langchain.embeddings.huggingface_hub.HuggingFaceHubEmbeddings¶
class langchain.embeddings.huggingface_hub.HuggingFaceHubEmbeddings[source]¶
Bases: BaseModel, Embeddings
HuggingFaceHub embedding models.
To use, you should have the huggingface_hub python package installed, and the
environment variable HUGGINGFACEHUB_API_... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.huggingface_hub.HuggingFaceHubEmbeddings.html |
efc01afd050d-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/embeddings/langchain.embeddings.huggingface_hub.HuggingFaceHubEmbeddings.html |
efc01afd050d-2 | Parameters
text – The text to embed.
Returns
Embeddings for the text.
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, ... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.huggingface_hub.HuggingFaceHubEmbeddings.html |
b5b5e3368abe-0 | langchain.embeddings.fake.DeterministicFakeEmbedding¶
class langchain.embeddings.fake.DeterministicFakeEmbedding[source]¶
Bases: Embeddings, BaseModel
Fake embedding model that always returns
the same embedding vector for the same text.
Create a new model by parsing and validating input data from keyword arguments.
Rai... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.fake.DeterministicFakeEmbedding.html |
b5b5e3368abe-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/embeddings/langchain.embeddings.fake.DeterministicFakeEmbedding.html |
b5b5e3368abe-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... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.fake.DeterministicFakeEmbedding.html |
0e2582edb1cd-0 | langchain.schema.output.ChatGenerationChunk¶
class langchain.schema.output.ChatGenerationChunk[source]¶
Bases: ChatGeneration
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_info: Optional[D... | https://api.python.langchain.com/en/latest/schema/langchain.schema.output.ChatGenerationChunk.html |
0e2582edb1cd-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 |
0e2582edb1cd-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¶
to_json() → Union[SerializedConstructor, SerializedNotImplemented]¶
to_json_not_impl... | https://api.python.langchain.com/en/latest/schema/langchain.schema.output.ChatGenerationChunk.html |
aa53c7a2c41b-0 | langchain.schema.language_model.BaseLanguageModel¶
class langchain.schema.language_model.BaseLanguageModel[source]¶
Bases: Serializable, Runnable[Union[PromptValue, str, List[BaseMessage]], LanguageModelOutput], ABC
Abstract base class for interfacing with language models.
All language model wrappers inherit from BaseL... | https://api.python.langchain.com/en/latest/schema/langchain.schema.language_model.BaseLanguageModel.html |
aa53c7a2c41b-1 | Parameters
prompts – List of PromptValues. A PromptValue is an object that can be
converted to match the format of any language model (string for pure
text generation models and BaseMessages for chat models).
stop – Stop words to use when generating. Model output is cut off at the
first occurrence of any of these subst... | https://api.python.langchain.com/en/latest/schema/langchain.schema.language_model.BaseLanguageModel.html |
aa53c7a2c41b-2 | Parameters
messages – A sequence of chat messages corresponding to a single model input.
stop – Stop words to use when generating. Model output is cut off at the
first occurrence of any of these substrings.
**kwargs – Arbitrary additional keyword arguments. These are usually passed
to the model provider API call.
Retur... | https://api.python.langchain.com/en/latest/schema/langchain.schema.language_model.BaseLanguageModel.html |
aa53c7a2c41b-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.language_model.BaseLanguageModel.html |
aa53c7a2c41b-4 | to the model provider API call.
Returns
An LLMResult, which contains a list of candidate Generations for each inputprompt and additional model provider-specific output.
get_num_tokens(text: str) → int[source]¶
Get the number of tokens present in the text.
Useful for checking if an input will fit in a model’s context wi... | https://api.python.langchain.com/en/latest/schema/langchain.schema.language_model.BaseLanguageModel.html |
aa53c7a2c41b-5 | classmethod parse_file(path: Union[str, Path], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) → Model¶
classmethod parse_obj(obj: Any) → Model¶
classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto... | https://api.python.langchain.com/en/latest/schema/langchain.schema.language_model.BaseLanguageModel.html |
aa53c7a2c41b-6 | to the model provider API call.
Returns
Top model prediction as a message.
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(in... | https://api.python.langchain.com/en/latest/schema/langchain.schema.language_model.BaseLanguageModel.html |
654486d9529e-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 |
654486d9529e-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 |
765459d9af90-0 | langchain.schema.output_parser.StrOutputParser¶
class langchain.schema.output_parser.StrOutputParser[source]¶
Bases: BaseOutputParser[str]
OutputParser that parses LLMResult into the top likely string..
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input d... | https://api.python.langchain.com/en/latest/schema/langchain.schema.output_parser.StrOutputParser.html |
765459d9af90-1 | 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.StrOutputParser.html |
765459d9af90-2 | json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, encoder: Optional[Cal... | https://api.python.langchain.com/en/latest/schema/langchain.schema.output_parser.StrOutputParser.html |
765459d9af90-3 | The prompt is largely provided in the event the OutputParser wants
to retry or fix the output in some way, and needs information from
the prompt to do so.
Parameters
completion – String output of a language model.
prompt – Input PromptValue.
Returns
Structured output
classmethod schema(by_alias: bool = True, ref_templa... | https://api.python.langchain.com/en/latest/schema/langchain.schema.output_parser.StrOutputParser.html |
765459d9af90-4 | eg. {“openai_api_key”: “OPENAI_API_KEY”}
property lc_serializable: bool¶
Whether the class LangChain serializable. | https://api.python.langchain.com/en/latest/schema/langchain.schema.output_parser.StrOutputParser.html |
eb33ce5224da-0 | langchain.schema.messages.BaseMessageChunk¶
class langchain.schema.messages.BaseMessageChunk[source]¶
Bases: BaseMessage
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_kwargs: dict [Optiona... | https://api.python.langchain.com/en/latest/schema/langchain.schema.messages.BaseMessageChunk.html |
eb33ce5224da-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 |
eb33ce5224da-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¶
to_json() → Union[SerializedConstructor, SerializedNotImplemented]¶
to_json_not_impl... | https://api.python.langchain.com/en/latest/schema/langchain.schema.messages.BaseMessageChunk.html |
6f8ada9031a7-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 |
6f8ada9031a7-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 |
6f8ada9031a7-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 |
4e1f3efdcea7-0 | langchain.schema.runnable.RunnableLambda¶
class langchain.schema.runnable.RunnableLambda(func: Callable[[Input], Output])[source]¶
Methods
__init__(func)
abatch(inputs[, config, max_concurrency])
ainvoke(input[, config])
astream(input[, config])
batch(inputs[, config, max_concurrency])
bind(**kwargs)
Bind arguments to ... | https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.RunnableLambda.html |
4e1f3efdcea7-1 | with_fallbacks(fallbacks: ~typing.Sequence[~langchain.schema.runnable.Runnable[~langchain.schema.runnable.Input, ~langchain.schema.runnable.Output]], *, exceptions_to_handle: ~typing.Tuple[~typing.Type[BaseException]] = (<class 'Exception'>,)) → RunnableWithFallbacks[Input, Output]¶ | https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.RunnableLambda.html |
f5c54a36ad6c-0 | langchain.schema.exceptions.LangChainException¶
class langchain.schema.exceptions.LangChainException[source]¶
General LangChain exception. | https://api.python.langchain.com/en/latest/schema/langchain.schema.exceptions.LangChainException.html |
505c36db9aa3-0 | langchain.schema.output.LLMResult¶
class langchain.schema.output.LLMResult[source]¶
Bases: BaseModel
Class that contains all results for a batched LLM 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 model.
pa... | https://api.python.langchain.com/en/latest/schema/langchain.schema.output.LLMResult.html |
505c36db9aa3-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.LLMResult.html |
505c36db9aa3-2 | classmethod parse_file(path: Union[str, Path], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) → Model¶
classmethod parse_obj(obj: Any) → Model¶
classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto... | https://api.python.langchain.com/en/latest/schema/langchain.schema.output.LLMResult.html |
cd2eec626897-0 | langchain.schema.runnable.RouterInput¶
class langchain.schema.runnable.RouterInput[source]¶
key: str¶
input: Any¶ | https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.RouterInput.html |
1fee8941db80-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 |
1fee8941db80-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 |
1fee8941db80-2 | abstract parse_result(result: List[Generation]) → T[source]¶
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.
classmethod schema(b... | https://api.python.langchain.com/en/latest/schema/langchain.schema.output_parser.BaseLLMOutputParser.html |
224268407a87-0 | langchain.schema.runnable.RouterRunnable¶
class langchain.schema.runnable.RouterRunnable[source]¶
Bases: Serializable, Generic[Input, Output], Runnable[RouterInput, 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... | https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.RouterRunnable.html |
224268407a87-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.runnable.RouterRunnable.html |
224268407a87-2 | json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, encoder: Optional[Cal... | https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.RouterRunnable.html |
224268407a87-3 | Try to update ForwardRefs on fields based on this Model, globalns and localns.
classmethod validate(value: Any) → Model¶
with_fallbacks(fallbacks: ~typing.Sequence[~langchain.schema.runnable.Runnable[~langchain.schema.runnable.Input, ~langchain.schema.runnable.Output]], *, exceptions_to_handle: ~typing.Tuple[~typing.Ty... | https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.RouterRunnable.html |
2afb40cc965c-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 |
2afb40cc965c-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.prompt_template.BasePromptTemplate.html |
2afb40cc965c-2 | json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, encoder: Optional[Cal... | https://api.python.langchain.com/en/latest/schema/langchain.schema.prompt_template.BasePromptTemplate.html |
2afb40cc965c-3 | stream(input: Input, config: Optional[RunnableConfig] = None) → Iterator[Output]¶
to_json() → Union[SerializedConstructor, SerializedNotImplemented]¶
to_json_not_implemented() → SerializedNotImplemented¶
classmethod update_forward_refs(**localns: Any) → None¶
Try to update ForwardRefs on fields based on this Model, glo... | https://api.python.langchain.com/en/latest/schema/langchain.schema.prompt_template.BasePromptTemplate.html |
987f17ac31b9-0 | langchain.schema.messages.SystemMessage¶
class langchain.schema.messages.SystemMessage[source]¶
Bases: BaseMessage
A Message for priming AI behavior, usually passed in as the first of a sequence
of input messages.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if ... | https://api.python.langchain.com/en/latest/schema/langchain.schema.messages.SystemMessage.html |
987f17ac31b9-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.SystemMessage.html |
987f17ac31b9-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¶
to_json() → Union[SerializedConstructor, SerializedNotImplemented]¶
to_json_not_impl... | https://api.python.langchain.com/en/latest/schema/langchain.schema.messages.SystemMessage.html |
987f17ac31b9-3 | Use ToolKits with OpenAI Functions
Prompt Pipelining
Using OpenAI functions
Retrieval QA using OpenAI functions | https://api.python.langchain.com/en/latest/schema/langchain.schema.messages.SystemMessage.html |
d32a6970b530-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 |
df3bf190c1a4-0 | langchain.schema.retriever.BaseRetriever¶
class langchain.schema.retriever.BaseRetriever[source]¶
Bases: Serializable, Runnable[str, List[Document]], ABC
Abstract base class for a Document retrieval system.
A retrieval system is defined as something that can take string queries and returnthe most ‘relevant’ Documents f... | https://api.python.langchain.com/en/latest/schema/langchain.schema.retriever.BaseRetriever.html |
df3bf190c1a4-1 | These tags will be associated with each call to this retriever,
and passed as arguments to the handlers defined in callbacks.
You can use these to eg identify a specific instance of a retriever with its
use case.
async abatch(inputs: List[Input], config: Optional[Union[RunnableConfig, List[RunnableConfig]]] = None, *, ... | https://api.python.langchain.com/en/latest/schema/langchain.schema.retriever.BaseRetriever.html |
df3bf190c1a4-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.retriever.BaseRetriever.html |
df3bf190c1a4-3 | classmethod from_orm(obj: Any) → Model¶
get_relevant_documents(query: str, *, callbacks: Callbacks = None, tags: Optional[List[str]] = None, metadata: Optional[Dict[str, Any]] = None, **kwargs: Any) → List[Document][source]¶
Retrieve documents relevant to a query.
:param query: string to find relevant documents for
:pa... | https://api.python.langchain.com/en/latest/schema/langchain.schema.retriever.BaseRetriever.html |
df3bf190c1a4-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¶
classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶
classmet... | https://api.python.langchain.com/en/latest/schema/langchain.schema.retriever.BaseRetriever.html |
df3bf190c1a4-5 | property lc_serializable: bool¶
Return whether or not the class is serializable.
Examples using BaseRetriever¶
Retrieve as you generate with FLARE
FLARE | https://api.python.langchain.com/en/latest/schema/langchain.schema.retriever.BaseRetriever.html |
a39684c93846-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... | https://api.python.langchain.com/en/latest/schema/langchain.schema.output.ChatResult.html |
a39684c93846-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.ChatResult.html |
a39684c93846-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.ChatResult.html |
12bc8cc898c0-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 |
a5c044c110ee-0 | langchain.schema.messages.get_buffer_string¶
langchain.schema.messages.get_buffer_string(messages: Sequence[BaseMessage], human_prefix: str = 'Human', ai_prefix: str = 'AI') → str[source]¶
Convert sequence of Messages to strings and concatenate them into one string.
Args:messages: Messages to be converted to strings.
h... | https://api.python.langchain.com/en/latest/schema/langchain.schema.messages.get_buffer_string.html |
23f143971f87-0 | langchain.schema.messages.BaseMessage¶
class langchain.schema.messages.BaseMessage[source]¶
Bases: Serializable
The base abstract Message class.
Messages are the inputs and outputs of ChatModels.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data can... | https://api.python.langchain.com/en/latest/schema/langchain.schema.messages.BaseMessage.html |
23f143971f87-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.BaseMessage.html |
23f143971f87-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¶
to_json() → Union[SerializedConstructor, SerializedNotImplemented]¶
to_json_not_impl... | https://api.python.langchain.com/en/latest/schema/langchain.schema.messages.BaseMessage.html |
01c170ff6e11-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 |
01c170ff6e11-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 |
01c170ff6e11-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¶
to_json() → Union[SerializedConstructor, SerializedNotImplemented]¶
to_json_not_impl... | https://api.python.langchain.com/en/latest/schema/langchain.schema.output.ChatGeneration.html |
50cfe8d754a0-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 |
2754a23b741e-0 | langchain.schema.messages.HumanMessageChunk¶
class langchain.schema.messages.HumanMessageChunk[source]¶
Bases: HumanMessage, BaseMessageChunk
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_... | https://api.python.langchain.com/en/latest/schema/langchain.schema.messages.HumanMessageChunk.html |
2754a23b741e-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 |
2754a23b741e-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¶
to_json() → Union[SerializedConstructor, SerializedNotImplemented]¶
to_json_not_impl... | https://api.python.langchain.com/en/latest/schema/langchain.schema.messages.HumanMessageChunk.html |
6582e7b8a9ac-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 |
6582e7b8a9ac-1 | Structured output.
async aparse_result(result: List[Generation]) → 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... | https://api.python.langchain.com/en/latest/schema/langchain.schema.output_parser.BaseOutputParser.html |
6582e7b8a9ac-2 | 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 |
6582e7b8a9ac-3 | 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]) → T[source]¶
Parse a list of candidate model Generations into a specific f... | https://api.python.langchain.com/en/latest/schema/langchain.schema.output_parser.BaseOutputParser.html |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.