id
stringlengths
14
15
text
stringlengths
44
2.47k
source
stringlengths
61
181
be3516a1fef1-5
completion_with_retry(run_manager: Optional[CallbackManagerForLLMRun] = None, **kwargs: Any) → Any[source]¶ Use tenacity to retry the completion call. classmethod construct(_fields_set: Optional[SetStr] = None, **values: Any) → Model¶ Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.litellm.ChatLiteLLM.html
be3516a1fef1-6
Top Level call generate_prompt(prompts: List[PromptValue], stop: Optional[List[str]] = None, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, **kwargs: Any) → LLMResult¶ Pass a sequence of prompts to the model and return model generations. This method should make use of batched calls f...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.litellm.ChatLiteLLM.html
be3516a1fef1-7
Parameters text – The string input to tokenize. Returns The integer number of tokens in the text. get_num_tokens_from_messages(messages: List[BaseMessage]) → int¶ Get the number of tokens in the messages. Useful for checking if an input will fit in a model’s context window. Parameters messages – The message inputs to t...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.litellm.ChatLiteLLM.html
be3516a1fef1-8
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(path: Union[str, Path], *, content_type: unicode = None, encod...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.litellm.ChatLiteLLM.html
be3516a1fef1-9
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 message. classmethod schema(by_alias: bool = True, ref_templ...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.litellm.ChatLiteLLM.html
be3516a1fef1-10
Bind config to a Runnable, returning a new Runnable. with_fallbacks(fallbacks: ~typing.Sequence[~langchain.schema.runnable.base.Runnable[~langchain.schema.runnable.utils.Input, ~langchain.schema.runnable.utils.Output]], *, exceptions_to_handle: ~typing.Tuple[~typing.Type[BaseException], ...] = (<class 'Exception'>,)) →...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.litellm.ChatLiteLLM.html
2e92c2b1cb19-0
langchain.chat_models.anthropic.ChatAnthropic¶ class langchain.chat_models.anthropic.ChatAnthropic[source]¶ Bases: BaseChatModel, _AnthropicCommon Anthropic chat large language models. To use, you should have the anthropic python package installed, and the environment variable ANTHROPIC_API_KEY set with your API key, o...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.anthropic.ChatAnthropic.html
2e92c2b1cb19-1
param model: str = 'claude-2' (alias 'model_name')¶ Model name to use. param model_kwargs: Dict[str, Any] [Optional]¶ param streaming: bool = False¶ Whether to stream the results. param tags: Optional[List[str]] = None¶ Tags to add to the run trace. param temperature: Optional[float] = None¶ A non-negative float that t...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.anthropic.ChatAnthropic.html
2e92c2b1cb19-2
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.anthropic.ChatAnthropic.html
2e92c2b1cb19-3
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.anthropic.ChatAnthropic.html
2e92c2b1cb19-4
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/chat_models/langchain.chat_models.anthropic.ChatAnthropic.html
2e92c2b1cb19-5
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.anthropic.ChatAnthropic.html
2e92c2b1cb19-6
Top Level call generate_prompt(prompts: List[PromptValue], stop: Optional[List[str]] = None, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, **kwargs: Any) → LLMResult¶ Pass a sequence of prompts to the model and return model generations. This method should make use of batched calls f...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.anthropic.ChatAnthropic.html
2e92c2b1cb19-7
Get the number of tokens in the messages. Useful for checking if an input will fit in a model’s context window. Parameters messages – The message inputs to tokenize. Returns The sum of the number of tokens across the messages. get_token_ids(text: str) → List[int]¶ Return the ordered ids of the tokens in a text. Paramet...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.anthropic.ChatAnthropic.html
2e92c2b1cb19-8
Return a new Runnable that maps a list of inputs to a list of outputs, by calling invoke() with each input. 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¶ cl...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.anthropic.ChatAnthropic.html
2e92c2b1cb19-9
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/chat_models/langchain.chat_models.anthropic.ChatAnthropic.html
2e92c2b1cb19-10
Bind config to a Runnable, returning a new Runnable. with_fallbacks(fallbacks: ~typing.Sequence[~langchain.schema.runnable.base.Runnable[~langchain.schema.runnable.utils.Input, ~langchain.schema.runnable.utils.Output]], *, exceptions_to_handle: ~typing.Tuple[~typing.Type[BaseException], ...] = (<class 'Exception'>,)) →...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.anthropic.ChatAnthropic.html
159bb05f27c2-0
langchain.chat_models.konko.ChatKonko¶ class langchain.chat_models.konko.ChatKonko[source]¶ Bases: ChatOpenAI ChatKonko Chat large language models API. To use, you should have the konko python package installed, and the environment variable KONKO_API_KEY and OPENAI_API_KEY set with your API key. Any parameters that are...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.konko.ChatKonko.html
159bb05f27c2-1
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 URL path for API requests, leave blank if not using a proxy or service emulator. param openai_organization: Optional[str] = None¶ par...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.konko.ChatKonko.html
159bb05f27c2-2
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.konko.ChatKonko.html
159bb05f27c2-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.konko.ChatKonko.html
159bb05f27c2-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.konko.ChatKonko.html
159bb05f27c2-5
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. Subclasses should override this method if th...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.konko.ChatKonko.html
159bb05f27c2-6
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.konko.ChatKonko.html
159bb05f27c2-7
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.konko.ChatKonko.html
159bb05f27c2-8
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¶ classmethod is_lc_serializable() → bool[source]¶ Return whether this model can be serialize...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.konko.ChatKonko.html
159bb05f27c2-9
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¶ predict(text: str, *, stop: Optional[Sequence[str]] = None, **kwargs: Any) → str¶ Pass a single string input to t...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.konko.ChatKonko.html
159bb05f27c2-10
stream(input: Union[PromptValue, str, List[BaseMessage]], config: Optional[RunnableConfig] = None, *, stop: Optional[List[str]] = None, **kwargs: Any) → Iterator[BaseMessageChunk]¶ Default implementation of stream, which calls invoke. Subclasses should override this method if they support streaming output. to_json() → ...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.konko.ChatKonko.html
159bb05f27c2-11
property InputType: TypeAlias¶ Get the input type for this runnable. property OutputType: Any¶ Get the input type for this runnable. 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 acce...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.konko.ChatKonko.html
043ad17f1326-0
langchain.chat_models.baidu_qianfan_endpoint.QianfanChatEndpoint¶ class langchain.chat_models.baidu_qianfan_endpoint.QianfanChatEndpoint[source]¶ Bases: BaseChatModel Baidu Qianfan chat models. To use, you should have the qianfan python package installed, and the environment variable qianfan_ak and qianfan_sk set with ...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.baidu_qianfan_endpoint.QianfanChatEndpoint.html
043ad17f1326-1
param model_kwargs: Dict[str, Any] [Optional]¶ param penalty_score: Optional[float] = 1¶ Model params, only supported in ERNIE-Bot and ERNIE-Bot-turbo. In the case of other model, passing these params will not affect the result. param qianfan_ak: Optional[str] = None¶ param qianfan_sk: Optional[str] = None¶ param reque...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.baidu_qianfan_endpoint.QianfanChatEndpoint.html
043ad17f1326-2
Subclasses should override this method if they can batch more efficiently. async agenerate(messages: List[List[BaseMessage]], stop: Optional[List[str]] = None, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, *, tags: Optional[List[str]] = None, metadata: Optional[Dict[str, Any]] = Non...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.baidu_qianfan_endpoint.QianfanChatEndpoint.html
043ad17f1326-3
async ainvoke(input: Union[PromptValue, str, List[BaseMessage]], config: Optional[RunnableConfig] = None, *, stop: Optional[List[str]] = None, **kwargs: Any) → BaseMessageChunk¶ Default implementation of ainvoke, which calls invoke in a thread pool. Subclasses should override this method if they can run asynchronously....
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.baidu_qianfan_endpoint.QianfanChatEndpoint.html
043ad17f1326-4
Default implementation of astream, which calls ainvoke. Subclasses should override this method if they support streaming output. async astream_log(input: Any, config: Optional[RunnableConfig] = None, *, include_names: Optional[Sequence[str]] = None, include_types: Optional[Sequence[str]] = None, include_tags: Optional[...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.baidu_qianfan_endpoint.QianfanChatEndpoint.html
043ad17f1326-5
Bind arguments to a Runnable, returning a new Runnable. call_as_llm(message: str, stop: Optional[List[str]] = None, **kwargs: Any) → str¶ 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. Defaul...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.baidu_qianfan_endpoint.QianfanChatEndpoint.html
043ad17f1326-6
Top Level call generate_prompt(prompts: List[PromptValue], stop: Optional[List[str]] = None, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, **kwargs: Any) → LLMResult¶ Pass a sequence of prompts to the model and return model generations. This method should make use of batched calls f...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.baidu_qianfan_endpoint.QianfanChatEndpoint.html
043ad17f1326-7
Parameters text – The string input to tokenize. Returns The integer number of tokens in the text. get_num_tokens_from_messages(messages: List[BaseMessage]) → int¶ Get the number of tokens in the messages. Useful for checking if an input will fit in a model’s context window. Parameters messages – The message inputs to t...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.baidu_qianfan_endpoint.QianfanChatEndpoint.html
043ad17f1326-8
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(path: Union[str, Path], *, content_type: unicode = None, encod...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.baidu_qianfan_endpoint.QianfanChatEndpoint.html
043ad17f1326-9
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 message. classmethod schema(by_alias: bool = True, ref_templ...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.baidu_qianfan_endpoint.QianfanChatEndpoint.html
043ad17f1326-10
Bind config to a Runnable, returning a new Runnable. with_fallbacks(fallbacks: ~typing.Sequence[~langchain.schema.runnable.base.Runnable[~langchain.schema.runnable.utils.Input, ~langchain.schema.runnable.utils.Output]], *, exceptions_to_handle: ~typing.Tuple[~typing.Type[BaseException], ...] = (<class 'Exception'>,)) →...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.baidu_qianfan_endpoint.QianfanChatEndpoint.html
fedcd40212aa-0
langchain.chat_models.google_palm.ChatGooglePalm¶ class langchain.chat_models.google_palm.ChatGooglePalm[source]¶ Bases: BaseChatModel, BaseModel Google PaLM Chat models API. To use you must have the google.generativeai Python package installed and either: The GOOGLE_API_KEY` environment variable set with your API key,...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.google_palm.ChatGooglePalm.html
fedcd40212aa-1
Must be positive. param top_p: Optional[float] = None¶ Decode using nucleus sampling: consider the smallest set of tokens whose probability sum is at least top_p. Must be in the closed interval [0.0, 1.0]. param verbose: bool [Optional]¶ Whether to print out response text. __call__(messages: List[BaseMessage], stop: Op...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.google_palm.ChatGooglePalm.html
fedcd40212aa-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.google_palm.ChatGooglePalm.html
fedcd40212aa-3
to the model provider API call. Returns Top model prediction as a string. async apredict_messages(messages: List[BaseMessage], *, stop: Optional[Sequence[str]] = None, **kwargs: Any) → BaseMessage¶ Asynchronously pass messages to the model and return a message prediction. Use this method when calling chat models and on...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.google_palm.ChatGooglePalm.html
fedcd40212aa-4
jsonpatch ops that describe how the state of the run has changed in each step, and the final state of the run. The jsonpatch ops can be applied in order to construct state. async atransform(input: AsyncIterator[Input], config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) → AsyncIterator[Output]¶ Default im...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.google_palm.ChatGooglePalm.html
fedcd40212aa-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.google_palm.ChatGooglePalm.html
fedcd40212aa-6
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
fedcd40212aa-7
invoke(input: Union[PromptValue, str, List[BaseMessage]], config: Optional[RunnableConfig] = None, *, stop: Optional[List[str]] = None, **kwargs: Any) → BaseMessageChunk¶ classmethod is_lc_serializable() → bool¶ Is this class serializable? json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, ex...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.google_palm.ChatGooglePalm.html
fedcd40212aa-8
predict(text: str, *, stop: Optional[Sequence[str]] = None, **kwargs: Any) → str¶ 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 m...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.google_palm.ChatGooglePalm.html
fedcd40212aa-9
Default implementation of stream, which calls invoke. Subclasses should override this method if they support streaming output. to_json() → Union[SerializedConstructor, SerializedNotImplemented]¶ to_json_not_implemented() → SerializedNotImplemented¶ transform(input: Iterator[Input], config: Optional[RunnableConfig] = No...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.google_palm.ChatGooglePalm.html
fedcd40212aa-10
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 constructor argument names to secret ids. For example,{“openai_api_key”: “OPENAI_API_KEY”} property output_schema: T...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.google_palm.ChatGooglePalm.html
1447f85f7be3-0
langchain.chat_models.fireworks.completion_with_retry¶ langchain.chat_models.fireworks.completion_with_retry(llm: ChatFireworks, *, run_manager: Optional[CallbackManagerForLLMRun] = None, **kwargs: Any) → Any[source]¶ Use tenacity to retry the completion call.
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.fireworks.completion_with_retry.html
1b3c98181cd4-0
langchain.chat_models.fireworks.acompletion_with_retry¶ async langchain.chat_models.fireworks.acompletion_with_retry(llm: ChatFireworks, *, run_manager: Optional[AsyncCallbackManagerForLLMRun] = None, **kwargs: Any) → Any[source]¶ Use tenacity to retry the async completion call.
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.fireworks.acompletion_with_retry.html
160d2bf6bd75-0
langchain.chat_models.openai.acompletion_with_retry¶ async langchain.chat_models.openai.acompletion_with_retry(llm: ChatOpenAI, run_manager: Optional[AsyncCallbackManagerForLLMRun] = None, **kwargs: Any) → Any[source]¶ Use tenacity to retry the async completion call.
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.openai.acompletion_with_retry.html
58ce38b8cb19-0
langchain.chat_models.fireworks.ChatFireworks¶ class langchain.chat_models.fireworks.ChatFireworks[source]¶ Bases: BaseChatModel Fireworks Chat 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 c...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.fireworks.ChatFireworks.html
58ce38b8cb19-1
Subclasses should override this method if they can batch more efficiently. async agenerate(messages: List[List[BaseMessage]], stop: Optional[List[str]] = None, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, *, tags: Optional[List[str]] = None, metadata: Optional[Dict[str, Any]] = Non...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.fireworks.ChatFireworks.html
58ce38b8cb19-2
async ainvoke(input: Union[PromptValue, str, List[BaseMessage]], config: Optional[RunnableConfig] = None, *, stop: Optional[List[str]] = None, **kwargs: Any) → BaseMessageChunk¶ Default implementation of ainvoke, which calls invoke in a thread pool. Subclasses should override this method if they can run asynchronously....
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.fireworks.ChatFireworks.html
58ce38b8cb19-3
Default implementation of astream, which calls ainvoke. Subclasses should override this method if they support streaming output. async astream_log(input: Any, config: Optional[RunnableConfig] = None, *, include_names: Optional[Sequence[str]] = None, include_types: Optional[Sequence[str]] = None, include_tags: Optional[...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.fireworks.ChatFireworks.html
58ce38b8cb19-4
Bind arguments to a Runnable, returning a new Runnable. call_as_llm(message: str, stop: Optional[List[str]] = None, **kwargs: Any) → str¶ 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. Defaul...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.fireworks.ChatFireworks.html
58ce38b8cb19-5
Top Level call generate_prompt(prompts: List[PromptValue], stop: Optional[List[str]] = None, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, **kwargs: Any) → LLMResult¶ Pass a sequence of prompts to the model and return model generations. This method should make use of batched calls f...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.fireworks.ChatFireworks.html
58ce38b8cb19-6
Parameters text – The string input to tokenize. Returns The integer number of tokens in the text. get_num_tokens_from_messages(messages: List[BaseMessage]) → int¶ Get the number of tokens in the messages. Useful for checking if an input will fit in a model’s context window. Parameters messages – The message inputs to t...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.fireworks.ChatFireworks.html
58ce38b8cb19-7
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(path: Union[str, Path], *, content_type: unicode = None, encod...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.fireworks.ChatFireworks.html
58ce38b8cb19-8
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 message. classmethod schema(by_alias: bool = True, ref_templ...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.fireworks.ChatFireworks.html
58ce38b8cb19-9
Bind config to a Runnable, returning a new Runnable. with_fallbacks(fallbacks: ~typing.Sequence[~langchain.schema.runnable.base.Runnable[~langchain.schema.runnable.utils.Input, ~langchain.schema.runnable.utils.Output]], *, exceptions_to_handle: ~typing.Tuple[~typing.Type[BaseException], ...] = (<class 'Exception'>,)) →...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.fireworks.ChatFireworks.html
12c19eb8911d-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
1d98a0213b68-0
langchain.chat_models.vertexai.ChatVertexAI¶ class langchain.chat_models.vertexai.ChatVertexAI[source]¶ Bases: _VertexAICommon, BaseChatModel Vertex AI Chat large language models API. 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/chat_models/langchain.chat_models.vertexai.ChatVertexAI.html
1d98a0213b68-1
Sampling temperature, it controls the degree of randomness in token selection. 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 prin...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.vertexai.ChatVertexAI.html
1d98a0213b68-2
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 models vs chat models). Parameters prompts – List of PromptValues. A PromptVal...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.vertexai.ChatVertexAI.html
1d98a0213b68-3
**kwargs – Arbitrary additional keyword arguments. These are usually passed to the model provider API call. Returns Top model prediction as a string. async apredict_messages(messages: List[BaseMessage], *, stop: Optional[Sequence[str]] = None, **kwargs: Any) → BaseMessage¶ Asynchronously pass messages to the model and ...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.vertexai.ChatVertexAI.html
1d98a0213b68-4
Output is streamed as Log objects, which include a list of jsonpatch ops that describe how the state of the run has changed in each step, and the final state of the run. The jsonpatch ops can be applied in order to construct state. async atransform(input: AsyncIterator[Input], config: Optional[RunnableConfig] = None, *...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.vertexai.ChatVertexAI.html
1d98a0213b68-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.vertexai.ChatVertexAI.html
1d98a0213b68-6
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
1d98a0213b68-7
invoke(input: Union[PromptValue, str, List[BaseMessage]], config: Optional[RunnableConfig] = None, *, stop: Optional[List[str]] = None, **kwargs: Any) → BaseMessageChunk¶ classmethod is_lc_serializable() → bool¶ Is this class serializable? json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, ex...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.vertexai.ChatVertexAI.html
1d98a0213b68-8
predict(text: str, *, stop: Optional[Sequence[str]] = None, **kwargs: Any) → str¶ 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 m...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.vertexai.ChatVertexAI.html
1d98a0213b68-9
Default implementation of stream, which calls invoke. Subclasses should override this method if they support streaming output. to_json() → Union[SerializedConstructor, SerializedNotImplemented]¶ to_json_not_implemented() → SerializedNotImplemented¶ transform(input: Iterator[Input], config: Optional[RunnableConfig] = No...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.vertexai.ChatVertexAI.html
1d98a0213b68-10
property is_codey_model: bool¶ 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 constructor argument names to secret ids. For example,{“openai_api_key”: “OPENAI_API_...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.vertexai.ChatVertexAI.html
54930cf3d17f-0
langchain.chat_models.litellm.ChatLiteLLMException¶ class langchain.chat_models.litellm.ChatLiteLLMException[source]¶ Error with the LiteLLM I/O library
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.litellm.ChatLiteLLMException.html
1a165ea7d290-0
langchain.chat_models.fake.FakeListChatModel¶ class langchain.chat_models.fake.FakeListChatModel[source]¶ Bases: SimpleChatModel Fake ChatModel for testing purposes. 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 ...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.fake.FakeListChatModel.html
1a165ea7d290-1
Subclasses should override this method if they can batch more efficiently. async agenerate(messages: List[List[BaseMessage]], stop: Optional[List[str]] = None, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, *, tags: Optional[List[str]] = None, metadata: Optional[Dict[str, Any]] = Non...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.fake.FakeListChatModel.html
1a165ea7d290-2
async ainvoke(input: Union[PromptValue, str, List[BaseMessage]], config: Optional[RunnableConfig] = None, *, stop: Optional[List[str]] = None, **kwargs: Any) → BaseMessageChunk¶ Default implementation of ainvoke, which calls invoke in a thread pool. Subclasses should override this method if they can run asynchronously....
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.fake.FakeListChatModel.html
1a165ea7d290-3
Default implementation of astream, which calls ainvoke. Subclasses should override this method if they support streaming output. async astream_log(input: Any, config: Optional[RunnableConfig] = None, *, include_names: Optional[Sequence[str]] = None, include_types: Optional[Sequence[str]] = None, include_tags: Optional[...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.fake.FakeListChatModel.html
1a165ea7d290-4
Bind arguments to a Runnable, returning a new Runnable. call_as_llm(message: str, stop: Optional[List[str]] = None, **kwargs: Any) → str¶ 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. Defaul...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.fake.FakeListChatModel.html
1a165ea7d290-5
Top Level call generate_prompt(prompts: List[PromptValue], stop: Optional[List[str]] = None, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, **kwargs: Any) → LLMResult¶ Pass a sequence of prompts to the model and return model generations. This method should make use of batched calls f...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.fake.FakeListChatModel.html
1a165ea7d290-6
Parameters text – The string input to tokenize. Returns The integer number of tokens in the text. get_num_tokens_from_messages(messages: List[BaseMessage]) → int¶ Get the number of tokens in the messages. Useful for checking if an input will fit in a model’s context window. Parameters messages – The message inputs to t...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.fake.FakeListChatModel.html
1a165ea7d290-7
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(path: Union[str, Path], *, content_type: unicode = None, encod...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.fake.FakeListChatModel.html
1a165ea7d290-8
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 message. classmethod schema(by_alias: bool = True, ref_templ...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.fake.FakeListChatModel.html
1a165ea7d290-9
Bind config to a Runnable, returning a new Runnable. with_fallbacks(fallbacks: ~typing.Sequence[~langchain.schema.runnable.base.Runnable[~langchain.schema.runnable.utils.Input, ~langchain.schema.runnable.utils.Output]], *, exceptions_to_handle: ~typing.Tuple[~typing.Type[BaseException], ...] = (<class 'Exception'>,)) →...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.fake.FakeListChatModel.html
fed50144c6c8-0
langchain.chat_models.mlflow_ai_gateway.ChatMLflowAIGateway¶ class langchain.chat_models.mlflow_ai_gateway.ChatMLflowAIGateway[source]¶ Bases: BaseChatModel MLflow AI Gateway chat models API. To use, you should have the mlflow[gateway] python package installed. For more information, see https://mlflow.org/docs/latest/g...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.mlflow_ai_gateway.ChatMLflowAIGateway.html
fed50144c6c8-1
Call self as a function. async abatch(inputs: List[Input], config: Optional[Union[RunnableConfig, List[RunnableConfig]]] = None, *, return_exceptions: bool = False, **kwargs: Optional[Any]) → List[Output]¶ Default implementation of abatch, which calls ainvoke N times. Subclasses should override this method if they can ...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.mlflow_ai_gateway.ChatMLflowAIGateway.html
fed50144c6c8-2
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.mlflow_ai_gateway.ChatMLflowAIGateway.html
fed50144c6c8-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
fed50144c6c8-4
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/chat_models/langchain.chat_models.mlflow_ai_gateway.ChatMLflowAIGateway.html
fed50144c6c8-5
classmethod from_orm(obj: Any) → Model¶ generate(messages: List[List[BaseMessage]], stop: Optional[List[str]] = None, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, *, tags: Optional[List[str]] = None, metadata: Optional[Dict[str, Any]] = None, run_name: Optional[str] = None, **kwarg...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.mlflow_ai_gateway.ChatMLflowAIGateway.html
fed50144c6c8-6
Get the namespace of the langchain object. For example, if the class is langchain.llms.openai.OpenAI, then the namespace is [“langchain”, “llms”, “openai”] 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. Parameters text...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.mlflow_ai_gateway.ChatMLflowAIGateway.html
fed50144c6c8-7
classmethod is_lc_serializable() → bool¶ Is this class serializable? json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defa...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.mlflow_ai_gateway.ChatMLflowAIGateway.html
fed50144c6c8-8
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.mlflow_ai_gateway.ChatMLflowAIGateway.html
fed50144c6c8-9
Subclasses should override this method if they support streaming output. to_json() → Union[SerializedConstructor, SerializedNotImplemented]¶ to_json_not_implemented() → SerializedNotImplemented¶ transform(input: Iterator[Input], config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) → Iterator[Output]¶ Defau...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.mlflow_ai_gateway.ChatMLflowAIGateway.html
fed50144c6c8-10
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 constructor argument names to secret ids. For example,{“openai_api_key”: “OPENAI_API_KEY”} property output_schema: Type[pydantic.main.BaseModel]¶ ...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.mlflow_ai_gateway.ChatMLflowAIGateway.html
72f9d2848d57-0
langchain.chat_models.javelin_ai_gateway.ChatParams¶ class langchain.chat_models.javelin_ai_gateway.ChatParams[source]¶ Bases: BaseModel Parameters for the Javelin AI Gateway LLM. Create a new model by parsing and validating input data from keyword arguments. Raises ValidationError if the input data cannot be parsed to...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.javelin_ai_gateway.ChatParams.html
72f9d2848d57-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/chat_models/langchain.chat_models.javelin_ai_gateway.ChatParams.html