id
stringlengths
14
15
text
stringlengths
49
2.47k
source
stringlengths
61
166
d03c862ff44c-4
Duplicate a model, optionally choose which fields to include, exclude and change. Parameters include – fields to include in new model exclude – fields to exclude from new model, as with values this takes precedence over include update – values to change/add in the new model. Note: the data is not validated before creat...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.google_palm.ChatGooglePalm.html
d03c862ff44c-5
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 substrings. callbacks – Callbacks to pass through. Used for executing additional functionality, such as logging or streaming, throughout generation. **kwarg...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.google_palm.ChatGooglePalm.html
d03c862ff44c-6
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/chat_models/langchain.chat_models.google_palm.ChatGooglePalm.html
d03c862ff44c-7
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/chat_models/langchain.chat_models.google_palm.ChatGooglePalm.html
d03c862ff44c-8
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/chat_models/langchain.chat_models.google_palm.ChatGooglePalm.html
031c27bf4827-0
langchain.chat_models.jinachat.acompletion_with_retry¶ async langchain.chat_models.jinachat.acompletion_with_retry(llm: JinaChat, **kwargs: Any) → Any[source]¶ Use tenacity to retry the async completion call.
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.jinachat.acompletion_with_retry.html
d752bcb65967-0
langchain.chat_models.google_palm.ChatGooglePalmError¶ class langchain.chat_models.google_palm.ChatGooglePalmError[source]¶ Error raised when there is an issue with the Google PaLM API.
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.google_palm.ChatGooglePalmError.html
999875cc2b0f-0
langchain.chat_models.google_palm.achat_with_retry¶ async langchain.chat_models.google_palm.achat_with_retry(llm: ChatGooglePalm, **kwargs: Any) → Any[source]¶ Use tenacity to retry the async completion call.
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.google_palm.achat_with_retry.html
cef6a513b67b-0
langchain.chat_models.mlflow_ai_gateway.ChatMLflowAIGateway¶ class langchain.chat_models.mlflow_ai_gateway.ChatMLflowAIGateway[source]¶ Bases: BaseChatModel Wrapper around chat LLMs in the MLflow AI Gateway. To use, you should have the mlflow[gateway] python package installed. For more information, see https://mlflow.o...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.mlflow_ai_gateway.ChatMLflowAIGateway.html
cef6a513b67b-1
param verbose: bool [Optional]¶ Whether to print out response text. __call__(messages: List[BaseMessage], stop: Optional[List[str]] = None, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, **kwargs: Any) → BaseMessage¶ Call self as a function. async abatch(inputs: List[Input], config: ...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.mlflow_ai_gateway.ChatMLflowAIGateway.html
cef6a513b67b-2
stop – Stop words to use when generating. Model output is cut off at the first occurrence of any of these substrings. callbacks – Callbacks to pass through. Used for executing additional functionality, such as logging or streaming, throughout generation. **kwargs – Arbitrary additional keyword arguments. These are usua...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.mlflow_ai_gateway.ChatMLflowAIGateway.html
cef6a513b67b-3
first occurrence of any of these substrings. **kwargs – Arbitrary additional keyword arguments. These are usually passed to the model provider API call. Returns Top model prediction as a message. async astream(input: Union[PromptValue, str, List[BaseMessage]], config: Optional[RunnableConfig] = None, *, stop: Optional[...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.mlflow_ai_gateway.ChatMLflowAIGateway.html
cef6a513b67b-4
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¶ Return a dictionary of the LLM. classmethod from_orm(obj: Any) → Model¶ generate(messages: List[List[BaseMessage]], stop: Optional[List[str]] = None, callbacks: Optional[U...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.mlflow_ai_gateway.ChatMLflowAIGateway.html
cef6a513b67b-5
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¶ Get the number of tokens present in the text. Useful for checking if an input will fit in a model’s context window. Pa...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.mlflow_ai_gateway.ChatMLflowAIGateway.html
cef6a513b67b-6
Generate a JSON representation of the model, include and exclude arguments as per dict(). encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps(). classmethod parse_file(path: Union[str, Path], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.mlflow_ai_gateway.ChatMLflowAIGateway.html
cef6a513b67b-7
**kwargs – Arbitrary additional keyword arguments. These are usually passed 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: ...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.mlflow_ai_gateway.ChatMLflowAIGateway.html
cef6a513b67b-8
eg. {“openai_api_key”: “OPENAI_API_KEY”} property lc_serializable: bool¶ Return whether or not the class is serializable. Examples using ChatMLflowAIGateway¶ MLflow AI Gateway
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.mlflow_ai_gateway.ChatMLflowAIGateway.html
c16f1d93ffaa-0
langchain.chat_models.jinachat.JinaChat¶ class langchain.chat_models.jinachat.JinaChat[source]¶ Bases: BaseChatModel Wrapper for Jina AI’s LLM service, providing cost-effective image chat capabilities. To use, you should have the openai python package installed, and the environment variable JINACHAT_API_KEY set to your...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.jinachat.JinaChat.html
c16f1d93ffaa-1
Timeout for requests to JinaChat completion API. Default is 600 seconds. param streaming: bool = False¶ Whether to stream the results or not. param tags: Optional[List[str]] = None¶ Tags to add to the run trace. param temperature: float = 0.7¶ What sampling temperature to use. param verbose: bool [Optional]¶ Whether to...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.jinachat.JinaChat.html
c16f1d93ffaa-2
need more output from the model than just the top generated value, are building chains that are agnostic to the underlying language modeltype (e.g., pure text completion models vs chat models). Parameters prompts – List of PromptValues. A PromptValue is an object that can be converted to match the format of any languag...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.jinachat.JinaChat.html
c16f1d93ffaa-3
Asynchronously pass messages to the model and return a message prediction. Use this method when calling chat models and only the topcandidate generation is needed. 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 a...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.jinachat.JinaChat.html
c16f1d93ffaa-4
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/chat_models/langchain.chat_models.jinachat.JinaChat.html
c16f1d93ffaa-5
need more output from the model than just the top generated value, are building chains that are agnostic to the underlying language modeltype (e.g., pure text completion models vs chat models). Parameters prompts – List of PromptValues. A PromptValue is an object that can be converted to match the format of any languag...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.jinachat.JinaChat.html
c16f1d93ffaa-6
invoke(input: Union[PromptValue, str, List[BaseMessage]], config: Optional[RunnableConfig] = None, *, stop: Optional[List[str]] = None, **kwargs: Any) → BaseMessageChunk¶ json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, b...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.jinachat.JinaChat.html
c16f1d93ffaa-7
first occurrence of any of these substrings. **kwargs – Arbitrary additional keyword arguments. These are usually passed 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 m...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.jinachat.JinaChat.html
c16f1d93ffaa-8
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/chat_models/langchain.chat_models.jinachat.JinaChat.html
2aae6a1fae6a-0
langchain.chat_models.base.BaseChatModel¶ class langchain.chat_models.base.BaseChatModel[source]¶ Bases: BaseLanguageModel[BaseMessageChunk], ABC 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 cache: ...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.base.BaseChatModel.html
2aae6a1fae6a-1
Top Level call async agenerate_prompt(prompts: List[PromptValue], stop: Optional[List[str]] = None, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, **kwargs: Any) → LLMResult[source]¶ Asynchronously pass a sequence of prompts and return model generations. This method should make use o...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.base.BaseChatModel.html
2aae6a1fae6a-2
Asynchronously pass a string to the model and return a string prediction. Use this method when calling pure text generation models and only the topcandidate generation is needed. Parameters text – String input to pass to the model. stop – Stop words to use when generating. Model output is cut off at the first occurrenc...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.base.BaseChatModel.html
2aae6a1fae6a-3
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 since it adds all passed values...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.base.BaseChatModel.html
2aae6a1fae6a-4
Pass a sequence of prompts to the model and return model generations. This method should make use of batched calls for models that expose a batched API. Use this method when you want to: take advantage of batched calls, need more output from the model than just the top generated value, are building chains that are agno...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.base.BaseChatModel.html
2aae6a1fae6a-5
Return the ordered ids of the tokens in a text. Parameters text – The string input to tokenize. Returns A list of ids corresponding to the tokens in the text, in order they occurin the text. invoke(input: Union[PromptValue, str, List[BaseMessage]], config: Optional[RunnableConfig] = None, *, stop: Optional[List[str]] =...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.base.BaseChatModel.html
2aae6a1fae6a-6
Pass a single string input to the model and return a string prediction. Use this method when passing in raw text. If you want to pass in specifictypes of chat messages, use predict_messages. Parameters text – String input to pass to the model. stop – Stop words to use when generating. Model output is cut off at the fir...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.base.BaseChatModel.html
2aae6a1fae6a-7
to_json_not_implemented() → SerializedNotImplemented¶ 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_fallbacks(fallbacks: ~typing.Sequence[~langchain.schema.runnable.Runnable[~langchain...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.base.BaseChatModel.html
c39398cab3f3-0
langchain.chat_models.azureml_endpoint.AzureMLChatOnlineEndpoint¶ class langchain.chat_models.azureml_endpoint.AzureMLChatOnlineEndpoint[source]¶ Bases: SimpleChatModel Azure ML Chat Online Endpoint models. Example azure_chat = AzureMLChatOnlineEndpoint( endpoint_url="https://<your-endpoint>.<your_region>.inference...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.azureml_endpoint.AzureMLChatOnlineEndpoint.html
c39398cab3f3-1
param verbose: bool [Optional]¶ Whether to print out response text. __call__(messages: List[BaseMessage], stop: Optional[List[str]] = None, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, **kwargs: Any) → BaseMessage¶ Call self as a function. async abatch(inputs: List[Input], config: ...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.azureml_endpoint.AzureMLChatOnlineEndpoint.html
c39398cab3f3-2
stop – Stop words to use when generating. Model output is cut off at the first occurrence of any of these substrings. callbacks – Callbacks to pass through. Used for executing additional functionality, such as logging or streaming, throughout generation. **kwargs – Arbitrary additional keyword arguments. These are usua...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.azureml_endpoint.AzureMLChatOnlineEndpoint.html
c39398cab3f3-3
first occurrence of any of these substrings. **kwargs – Arbitrary additional keyword arguments. These are usually passed to the model provider API call. Returns Top model prediction as a message. async astream(input: Union[PromptValue, str, List[BaseMessage]], config: Optional[RunnableConfig] = None, *, stop: Optional[...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.azureml_endpoint.AzureMLChatOnlineEndpoint.html
c39398cab3f3-4
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¶ Return a dictionary of the LLM. classmethod from_orm(obj: Any) → Model¶ generate(messages: List[List[BaseMessage]], stop: Optional[List[str]] = None, callbacks: Optional[U...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.azureml_endpoint.AzureMLChatOnlineEndpoint.html
c39398cab3f3-5
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¶ Get the number of tokens present in the text. Useful for checking if an input will fit in a model’s context window. Pa...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.azureml_endpoint.AzureMLChatOnlineEndpoint.html
c39398cab3f3-6
Generate a JSON representation of the model, include and exclude arguments as per dict(). encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps(). classmethod parse_file(path: Union[str, Path], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.azureml_endpoint.AzureMLChatOnlineEndpoint.html
c39398cab3f3-7
**kwargs – Arbitrary additional keyword arguments. These are usually passed 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: ...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.azureml_endpoint.AzureMLChatOnlineEndpoint.html
c39398cab3f3-8
eg. {“openai_api_key”: “OPENAI_API_KEY”} property lc_serializable: bool¶ Return whether or not the class is serializable.
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.azureml_endpoint.AzureMLChatOnlineEndpoint.html
cc28e421339a-0
langchain.chat_models.openai.ChatOpenAI¶ class langchain.chat_models.openai.ChatOpenAI[source]¶ Bases: BaseChatModel Wrapper around OpenAI Chat large language models. To use, you should have the openai python package installed, and the environment variable OPENAI_API_KEY set with your API key. Any parameters that are v...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.openai.ChatOpenAI.html
cc28e421339a-1
Base URL path for API requests, leave blank if not using a proxy or service emulator. param openai_organization: Optional[str] = None¶ param openai_proxy: Optional[str] = None¶ param request_timeout: Optional[Union[float, Tuple[float, float]]] = None¶ Timeout for requests to OpenAI completion API. Default is 600 second...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.openai.ChatOpenAI.html
cc28e421339a-2
Call self as a function. async abatch(inputs: List[Input], config: Optional[Union[RunnableConfig, List[RunnableConfig]]] = None, *, max_concurrency: Optional[int] = None) → List[Output]¶ async agenerate(messages: List[List[BaseMessage]], stop: Optional[List[str]] = None, callbacks: Optional[Union[List[BaseCallbackHandl...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.openai.ChatOpenAI.html
cc28e421339a-3
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. async ainvoke(input: Union[PromptValue, str, List[BaseMessage]], config: Optional[RunnableConfig] = None, *, stop: Optional[List[str]] = None, **kwargs...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.openai.ChatOpenAI.html
cc28e421339a-4
to the model provider API call. Returns Top model prediction as a message. async astream(input: Union[PromptValue, str, List[BaseMessage]], config: Optional[RunnableConfig] = None, *, stop: Optional[List[str]] = None, **kwargs: Any) → AsyncIterator[BaseMessageChunk]¶ batch(inputs: List[Input], config: Optional[Union[Ru...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.openai.ChatOpenAI.html
cc28e421339a-5
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(**kw...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.openai.ChatOpenAI.html
cc28e421339a-6
callbacks – Callbacks to pass through. Used for executing additional functionality, such as logging or streaming, throughout generation. **kwargs – Arbitrary additional keyword arguments. These are usually passed to the model provider API call. Returns An LLMResult, which contains a list of candidate Generations for ea...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.openai.ChatOpenAI.html
cc28e421339a-7
Generate a JSON representation of the model, include and exclude arguments as per dict(). encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps(). classmethod parse_file(path: Union[str, Path], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.openai.ChatOpenAI.html
cc28e421339a-8
**kwargs – Arbitrary additional keyword arguments. These are usually passed 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: ...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.openai.ChatOpenAI.html
cc28e421339a-9
eg. {“openai_api_key”: “OPENAI_API_KEY”} property lc_serializable: bool¶ Return whether or not the class is serializable. Examples using ChatOpenAI¶ Wikipedia Arxiv ChatGPT Plugins Human as a tool ArXiv API Tool Metaphor Search Shell Tool Dynamodb Chat Message History OpenAI Context PromptLayer CnosDB Flyte Arthur CSV ...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.openai.ChatOpenAI.html
cc28e421339a-10
Multi-Agent Simulated Environment: Petting Zoo Multi-agent decentralized speaker selection Multi-agent authoritarian speaker selection Generative Agents in LangChain Two-Player Dungeons & Dragons Multi-Player Dungeons & Dragons Simulated Environment: Gymnasium Agent Debates with Tools MultiQueryRetriever WebResearchRet...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.openai.ChatOpenAI.html
88fe608ba3bb-0
langchain.chat_models.vertexai.ChatVertexAI¶ class langchain.chat_models.vertexai.ChatVertexAI[source]¶ Bases: _VertexAICommon, BaseChatModel Wrapper around Vertex AI large language models. Create a new model by parsing and validating input data from keyword arguments. Raises ValidationError if the input data cannot be...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.vertexai.ChatVertexAI.html
88fe608ba3bb-1
param top_k: int = 40¶ How the model selects tokens for output, the next token is selected from param top_p: float = 0.95¶ Tokens are selected from most probable to least until the sum of their param verbose: bool [Optional]¶ Whether to print out response text. __call__(messages: List[BaseMessage], stop: Optional[List[...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.vertexai.ChatVertexAI.html
88fe608ba3bb-2
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/chat_models/langchain.chat_models.vertexai.ChatVertexAI.html
88fe608ba3bb-3
Use this method when calling chat models and only the topcandidate generation is needed. 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 add...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.vertexai.ChatVertexAI.html
88fe608ba3bb-4
Duplicate a model, optionally choose which fields to include, exclude and change. Parameters include – fields to include in new model exclude – fields to exclude from new model, as with values this takes precedence over include update – values to change/add in the new model. Note: the data is not validated before creat...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.vertexai.ChatVertexAI.html
88fe608ba3bb-5
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 substrings. callbacks – Callbacks to pass through. Used for executing additional functionality, such as logging or streaming, throughout generation. **kwarg...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.vertexai.ChatVertexAI.html
88fe608ba3bb-6
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/chat_models/langchain.chat_models.vertexai.ChatVertexAI.html
88fe608ba3bb-7
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/chat_models/langchain.chat_models.vertexai.ChatVertexAI.html
88fe608ba3bb-8
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/chat_models/langchain.chat_models.vertexai.ChatVertexAI.html
fb0da6ec1a2c-0
langchain.chat_models.base.SimpleChatModel¶ class langchain.chat_models.base.SimpleChatModel[source]¶ Bases: BaseChatModel Simple Chat 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 cache: Opti...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.base.SimpleChatModel.html
fb0da6ec1a2c-1
Top Level call async agenerate_prompt(prompts: List[PromptValue], stop: Optional[List[str]] = None, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, **kwargs: Any) → LLMResult¶ Asynchronously pass a sequence of prompts and return model generations. This method should make use of batche...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.base.SimpleChatModel.html
fb0da6ec1a2c-2
Use this method when calling pure text generation models and only the topcandidate generation is needed. Parameters text – String input to pass to the model. 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 argu...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.base.SimpleChatModel.html
fb0da6ec1a2c-3
Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed. Behaves as if Config.extra = ‘allow’ was set since it adds all passed values copy(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclu...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.base.SimpleChatModel.html
fb0da6ec1a2c-4
This method should make use of batched calls for models that expose a batched API. Use this method when you want to: take advantage of batched calls, need more output from the model than just the top generated value, are building chains that are agnostic to the underlying language modeltype (e.g., pure text completion ...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.base.SimpleChatModel.html
fb0da6ec1a2c-5
Parameters text – The string input to tokenize. Returns A list of ids corresponding to the tokens in the text, in order they occurin the text. invoke(input: Union[PromptValue, str, List[BaseMessage]], config: Optional[RunnableConfig] = None, *, stop: Optional[List[str]] = None, **kwargs: Any) → BaseMessageChunk¶ json(*...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.base.SimpleChatModel.html
fb0da6ec1a2c-6
Parameters text – String input to pass to the model. 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. Returns Top model prediction as a string....
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.base.SimpleChatModel.html
fb0da6ec1a2c-7
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/chat_models/langchain.chat_models.base.SimpleChatModel.html
84b9a7d1255e-0
langchain.chat_models.azure_openai.AzureChatOpenAI¶ class langchain.chat_models.azure_openai.AzureChatOpenAI[source]¶ Bases: ChatOpenAI Wrapper around Azure OpenAI Chat Completion API. To use this class you must have a deployed model on Azure OpenAI. Use deployment_name in the constructor to refer to the “Model deploym...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.azure_openai.AzureChatOpenAI.html
84b9a7d1255e-1
param max_tokens: Optional[int] = None¶ Maximum number of tokens to generate. param metadata: Optional[Dict[str, Any]] = None¶ Metadata to add to the run trace. param model_kwargs: Dict[str, Any] [Optional]¶ Holds any model parameters valid for create call not explicitly specified. param model_name: str = 'gpt-3.5-turb...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.azure_openai.AzureChatOpenAI.html
84b9a7d1255e-2
where you may want to use this Embedding class with a model name not supported by tiktoken. This can include when using Azure embeddings or when using one of the many model providers that expose an OpenAI-like API but with different models. In those cases, in order to avoid erroring when tiktoken is called, you can spe...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.azure_openai.AzureChatOpenAI.html
84b9a7d1255e-3
need more output from the model than just the top generated value, are building chains that are agnostic to the underlying language modeltype (e.g., pure text completion models vs chat models). Parameters prompts – List of PromptValues. A PromptValue is an object that can be converted to match the format of any languag...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.azure_openai.AzureChatOpenAI.html
84b9a7d1255e-4
Asynchronously pass messages to the model and return a message prediction. Use this method when calling chat models and only the topcandidate generation is needed. 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 a...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.azure_openai.AzureChatOpenAI.html
84b9a7d1255e-5
Behaves as if Config.extra = ‘allow’ was set since it adds all passed values copy(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, update: Optional[DictStrAny] = None, deep: bool = False) → Model¶ Duplicate a model, optionally...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.azure_openai.AzureChatOpenAI.html
84b9a7d1255e-6
need more output from the model than just the top generated value, are building chains that are agnostic to the underlying language modeltype (e.g., pure text completion models vs chat models). Parameters prompts – List of PromptValues. A PromptValue is an object that can be converted to match the format of any languag...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.azure_openai.AzureChatOpenAI.html
84b9a7d1255e-7
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/chat_models/langchain.chat_models.azure_openai.AzureChatOpenAI.html
84b9a7d1255e-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/chat_models/langchain.chat_models.azure_openai.AzureChatOpenAI.html
84b9a7d1255e-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/chat_models/langchain.chat_models.azure_openai.AzureChatOpenAI.html
42f9978b6e8a-0
langchain.chat_models.azureml_endpoint.LlamaContentFormatter¶ class langchain.chat_models.azureml_endpoint.LlamaContentFormatter[source]¶ Content formatter for LLaMa Attributes SUPPORTED_ROLES accepts The MIME type of the response data returned from the endpoint content_type The MIME type of the input data passed to th...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.azureml_endpoint.LlamaContentFormatter.html
36f132dad120-0
langchain.chat_models.google_palm.chat_with_retry¶ langchain.chat_models.google_palm.chat_with_retry(llm: ChatGooglePalm, **kwargs: Any) → Any[source]¶ Use tenacity to retry the completion call.
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.google_palm.chat_with_retry.html
a85bd2a4f355-0
langchain.chat_models.anyscale.ChatAnyscale¶ class langchain.chat_models.anyscale.ChatAnyscale[source]¶ Bases: ChatOpenAI Wrapper around Anyscale Chat large language models. To use, you should have the openai python package installed, and the environment variable ANYSCALE_API_KEY set with your API key. Alternatively, y...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.anyscale.ChatAnyscale.html
a85bd2a4f355-1
param metadata: Optional[Dict[str, Any]] = None¶ Metadata to add to the run trace. param model_kwargs: Dict[str, Any] [Optional]¶ Holds any model parameters valid for create call not explicitly specified. param model_name: str = 'meta-llama/Llama-2-7b-chat-hf' (alias 'model')¶ Model name to use. param n: int = 1¶ Numbe...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.anyscale.ChatAnyscale.html
a85bd2a4f355-2
when using one of the many model providers that expose an OpenAI-like API but with different models. In those cases, in order to avoid erroring when tiktoken is called, you can specify a model name to use here. param verbose: bool [Optional]¶ Whether to print out response text. __call__(messages: List[BaseMessage], sto...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.anyscale.ChatAnyscale.html
a85bd2a4f355-3
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/chat_models/langchain.chat_models.anyscale.ChatAnyscale.html
a85bd2a4f355-4
Use this method when calling chat models and only the topcandidate generation is needed. 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 add...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.anyscale.ChatAnyscale.html
a85bd2a4f355-5
Behaves as if Config.extra = ‘allow’ was set since it adds all passed values copy(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, update: Optional[DictStrAny] = None, deep: bool = False) → Model¶ Duplicate a model, optionally...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.anyscale.ChatAnyscale.html
a85bd2a4f355-6
need more output from the model than just the top generated value, are building chains that are agnostic to the underlying language modeltype (e.g., pure text completion models vs chat models). Parameters prompts – List of PromptValues. A PromptValue is an object that can be converted to match the format of any languag...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.anyscale.ChatAnyscale.html
a85bd2a4f355-7
Get the tokens present in the text with tiktoken package. invoke(input: Union[PromptValue, str, List[BaseMessage]], config: Optional[RunnableConfig] = None, *, stop: Optional[List[str]] = None, **kwargs: Any) → BaseMessageChunk¶ json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Opti...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.anyscale.ChatAnyscale.html
a85bd2a4f355-8
Parameters text – String input to pass to the model. 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. Returns Top model prediction as a string....
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.anyscale.ChatAnyscale.html
a85bd2a4f355-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/chat_models/langchain.chat_models.anyscale.ChatAnyscale.html
cf59a3965cee-0
langchain.chat_models.openai.convert_openai_messages¶ langchain.chat_models.openai.convert_openai_messages(messages: List[dict]) → List[BaseMessage][source]¶ Convert dictionaries representing OpenAI messages to LangChain format. Parameters messages – List of dictionaries representing OpenAI messages Returns List of Lan...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.openai.convert_openai_messages.html
03dab7c1d615-0
langchain.chat_models.promptlayer_openai.PromptLayerChatOpenAI¶ class langchain.chat_models.promptlayer_openai.PromptLayerChatOpenAI[source]¶ Bases: ChatOpenAI Wrapper around OpenAI Chat large language models and PromptLayer. To use, you should have the openai and promptlayer python package installed, and the environme...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.promptlayer_openai.PromptLayerChatOpenAI.html
03dab7c1d615-1
Holds any model parameters valid for create call not explicitly specified. param model_name: str = 'gpt-3.5-turbo' (alias 'model')¶ Model name to use. param n: int = 1¶ Number of chat completions to generate for each prompt. param openai_api_base: Optional[str] = None¶ param openai_api_key: Optional[str] = None¶ Base U...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.promptlayer_openai.PromptLayerChatOpenAI.html
03dab7c1d615-2
API but with different models. In those cases, in order to avoid erroring when tiktoken is called, you can specify a model name to use here. param verbose: bool [Optional]¶ Whether to print out response text. __call__(messages: List[BaseMessage], stop: Optional[List[str]] = None, callbacks: Optional[Union[List[BaseCall...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.promptlayer_openai.PromptLayerChatOpenAI.html
03dab7c1d615-3
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 substrings. callbacks – Callbacks to pass through. Used for executing additional functi...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.promptlayer_openai.PromptLayerChatOpenAI.html
03dab7c1d615-4
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/chat_models/langchain.chat_models.promptlayer_openai.PromptLayerChatOpenAI.html
03dab7c1d615-5
Duplicate a model, optionally choose which fields to include, exclude and change. Parameters include – fields to include in new model exclude – fields to exclude from new model, as with values this takes precedence over include update – values to change/add in the new model. Note: the data is not validated before creat...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.promptlayer_openai.PromptLayerChatOpenAI.html