id
stringlengths
14
16
text
stringlengths
13
2.7k
source
stringlengths
57
178
a6d656e65025-2
classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶ classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) → unicode¶ classmethod update_forward_refs(**localns: Any) → None¶ Try to update ForwardRefs on...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.mlflow_ai_gateway.ChatParams.html
1d86c670c9dc-0
langchain.chat_models.google_palm.ChatGooglePalmError¶ class langchain.chat_models.google_palm.ChatGooglePalmError[source]¶ Error with the Google PaLM API.
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.google_palm.ChatGooglePalmError.html
763d0ed616ee-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 ...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.fake.FakeListChatModel.html
763d0ed616ee-1
e.g., if the underlying runnable uses an API which supports a batch mode. 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]] = None...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.fake.FakeListChatModel.html
763d0ed616ee-2
async ainvoke(input: Union[PromptValue, str, List[BaseMessage]], config: Optional[RunnableConfig] = None, *, stop: Optional[List[str]] = None, **kwargs: Any) → BaseMessage¶ Default implementation of ainvoke, calls invoke from a thread. The default implementation allows usage of async code even if the runnable did not i...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.fake.FakeListChatModel.html
763d0ed616ee-3
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]¶ Default implementation of astream, which calls ainvo...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.fake.FakeListChatModel.html
763d0ed616ee-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 runs invoke in parallel using a thread pool executor. The default implementation of batch w...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.fake.FakeListChatModel.html
763d0ed616ee-5
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...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.fake.FakeListChatModel.html
763d0ed616ee-6
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...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.fake.FakeListChatModel.html
763d0ed616ee-7
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 – 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 ...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.fake.FakeListChatModel.html
763d0ed616ee-8
config – A config to use when invoking the runnable. The config supports standard keys like ‘tags’, ‘metadata’ for tracing purposes, ‘max_concurrency’ for controlling how much work to do in parallel, and other keys. Please refer to the RunnableConfig for more details. Returns The output of the runnable. classmethod is_...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.fake.FakeListChatModel.html
763d0ed616ee-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...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.fake.FakeListChatModel.html
763d0ed616ee-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() → ...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.fake.FakeListChatModel.html
763d0ed616ee-11
fallback in order, upon failures. with_listeners(*, on_start: Optional[Listener] = None, on_end: Optional[Listener] = None, on_error: Optional[Listener] = None) → Runnable[Input, Output]¶ Bind lifecycle listeners to a Runnable, returning a new Runnable. on_start: Called before the runnable starts running, with the Run ...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.fake.FakeListChatModel.html
763d0ed616ee-12
List configurable fields for this runnable. property input_schema: Type[pydantic.main.BaseModel]¶ The type of input this runnable accepts specified as a pydantic model. property lc_attributes: Dict¶ List of attribute names that should be included in the serialized kwargs. These attributes must be accepted by the constr...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.fake.FakeListChatModel.html
65077844837a-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...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.anthropic.ChatAnthropic.html
65077844837a-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...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.anthropic.ChatAnthropic.html
65077844837a-2
e.g., if the underlying runnable uses an API which supports a batch mode. 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]] = None...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.anthropic.ChatAnthropic.html
65077844837a-3
async ainvoke(input: Union[PromptValue, str, List[BaseMessage]], config: Optional[RunnableConfig] = None, *, stop: Optional[List[str]] = None, **kwargs: Any) → BaseMessage¶ Default implementation of ainvoke, calls invoke from a thread. The default implementation allows usage of async code even if the runnable did not i...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.anthropic.ChatAnthropic.html
65077844837a-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]¶ Default implementation of astream, which calls ainvo...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.anthropic.ChatAnthropic.html
65077844837a-5
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 runs invoke in parallel using a thread pool executor. The default implementation of batch w...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.anthropic.ChatAnthropic.html
65077844837a-6
Default values are respected, but no other validation is performed. Behaves as if Config.extra = ‘allow’ was set since it adds all passed values convert_prompt(prompt: PromptValue) → str[source]¶ copy(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, Map...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.anthropic.ChatAnthropic.html
65077844837a-7
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 ...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.anthropic.ChatAnthropic.html
65077844837a-8
namespace is [“langchain”, “llms”, “openai”] get_num_tokens(text: str) → int[source]¶ Calculate number of tokens. 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 mes...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.anthropic.ChatAnthropic.html
65077844837a-9
purposes, ‘max_concurrency’ for controlling how much work to do in parallel, and other keys. Please refer to the RunnableConfig for more details. Returns The output of the runnable. classmethod is_lc_serializable() → bool[source]¶ Return whether this model can be serialized by Langchain. json(*, include: Optional[Union...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.anthropic.ChatAnthropic.html
65077844837a-10
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...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.anthropic.ChatAnthropic.html
65077844837a-11
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...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.anthropic.ChatAnthropic.html
65077844837a-12
on_start: Called before the runnable starts running, with the Run object. on_end: Called after the runnable finishes running, with the Run object. on_error: Called if the runnable throws an error, with the Run object. The Run object contains information about the run, including its id, type, input, output, error, start...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.anthropic.ChatAnthropic.html
65077844837a-13
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]¶ The type of output this runnable produces specified as a pydantic model. E...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.anthropic.ChatAnthropic.html
7d47e8c97445-0
langchain.chat_models.gigachat.GigaChat¶ class langchain.chat_models.gigachat.GigaChat[source]¶ Bases: _BaseGigaChat, BaseChatModel GigaChat large language models API. To use, you should pass login and password to access GigaChat API or use token. Example from langchain.chat_models import GigaChat giga = GigaChat(crede...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.gigachat.GigaChat.html
7d47e8c97445-1
param scope: Optional[str] = None¶ Permission scope for access token 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: Optional[float] = None¶ What sampling temperature to use. param timeout: Optional[float] = No...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.gigachat.GigaChat.html
7d47e8c97445-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...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.gigachat.GigaChat.html
7d47e8c97445-3
Subclasses should override this method if they can run asynchronously. async apredict(text: str, *, stop: Optional[Sequence[str]] = None, **kwargs: Any) → str¶ 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 gen...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.gigachat.GigaChat.html
7d47e8c97445-4
Subclasses should override this method if they support streaming output. async astream_log(input: Any, config: Optional[RunnableConfig] = None, *, diff: bool = True, include_names: Optional[Sequence[str]] = None, include_types: Optional[Sequence[str]] = None, include_tags: Optional[Sequence[str]] = None, exclude_names:...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.gigachat.GigaChat.html
7d47e8c97445-5
e.g., if the underlying runnable uses an API which supports a batch mode. bind(**kwargs: Any) → Runnable[Input, Output]¶ Bind arguments to a Runnable, returning a new Runnable. call_as_llm(message: str, stop: Optional[List[str]] = None, **kwargs: Any) → str¶ config_schema(*, include: Optional[Sequence[str]] = None) → T...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.gigachat.GigaChat.html
7d47e8c97445-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...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.gigachat.GigaChat.html
7d47e8c97445-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...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.gigachat.GigaChat.html
7d47e8c97445-8
Get a pydantic model that can be used to validate output to the runnable. Runnables that leverage the configurable_fields and configurable_alternatives methods will have a dynamic output schema that depends on which configuration the runnable is invoked with. This method allows to get an output schema for a specific co...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.gigachat.GigaChat.html
7d47e8c97445-9
classmethod is_lc_serializable() → bool¶ Is this class serializable? json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defa...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.gigachat.GigaChat.html
7d47e8c97445-10
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...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.gigachat.GigaChat.html
7d47e8c97445-11
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...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.gigachat.GigaChat.html
7d47e8c97445-12
on_end: Called after the runnable finishes running, with the Run object. on_error: Called if the runnable throws an error, with the Run object. The Run object contains information about the run, including its id, type, input, output, error, start_time, end_time, and any tags or metadata added to the run. with_retry(*, ...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.gigachat.GigaChat.html
7d47e8c97445-13
property lc_secrets: Dict[str, str]¶ A map of constructor argument names to secret ids. For example,{“openai_api_key”: “OPENAI_API_KEY”} property lc_serializable: bool¶ property output_schema: Type[pydantic.main.BaseModel]¶ The type of output this runnable produces specified as a pydantic model.
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.gigachat.GigaChat.html
2a495b86660f-0
langchain.chat_models.konko.ChatKonko¶ class langchain.chat_models.konko.ChatKonko[source]¶ Bases: BaseChatModel 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 ...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.konko.ChatKonko.html
2a495b86660f-1
Number of chat completions to generate for each prompt. param openai_api_key: Optional[str] = None¶ param request_timeout: Optional[Union[float, Tuple[float, float]]] = None¶ Timeout for requests to Konko completion API. param streaming: bool = False¶ Whether to stream the results or not. param tags: Optional[List[str]...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.konko.ChatKonko.html
2a495b86660f-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...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.konko.ChatKonko.html
2a495b86660f-3
Subclasses should override this method if they can run asynchronously. async apredict(text: str, *, stop: Optional[Sequence[str]] = None, **kwargs: Any) → str¶ 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 gen...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.konko.ChatKonko.html
2a495b86660f-4
Subclasses should override this method if they support streaming output. async astream_log(input: Any, config: Optional[RunnableConfig] = None, *, diff: bool = True, include_names: Optional[Sequence[str]] = None, include_types: Optional[Sequence[str]] = None, include_tags: Optional[Sequence[str]] = None, exclude_names:...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.konko.ChatKonko.html
2a495b86660f-5
e.g., if the underlying runnable uses an API which supports a batch mode. bind(**kwargs: Any) → Runnable[Input, Output]¶ Bind arguments to a Runnable, returning a new Runnable. call_as_llm(message: str, stop: Optional[List[str]] = None, **kwargs: Any) → str¶ completion_with_retry(run_manager: Optional[CallbackManagerFo...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.konko.ChatKonko.html
2a495b86660f-6
Behaves as if Config.extra = ‘allow’ was set since it adds all passed values copy(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, update: Optional[DictStrAny] = None, deep: bool = False) → Model¶ Duplicate a model, optionally...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.konko.ChatKonko.html
2a495b86660f-7
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...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.konko.ChatKonko.html
2a495b86660f-8
classmethod get_lc_namespace() → List[str]¶ 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 ...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.konko.ChatKonko.html
2a495b86660f-9
invoke(input: Union[PromptValue, str, List[BaseMessage]], config: Optional[RunnableConfig] = None, *, stop: Optional[List[str]] = None, **kwargs: Any) → BaseMessage¶ Transform a single input into an output. Override to implement. Parameters input – The input to the runnable. config – A config to use when invoking the r...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.konko.ChatKonko.html
2a495b86660f-10
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¶ classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = No...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.konko.ChatKonko.html
2a495b86660f-11
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...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.konko.ChatKonko.html
2a495b86660f-12
Add fallbacks to a runnable, returning a new Runnable. Parameters fallbacks – A sequence of runnables to try if the original runnable fails. exceptions_to_handle – A tuple of exception types to handle. Returns A new Runnable that will try the original runnable, and then each fallback in order, upon failures. with_liste...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.konko.ChatKonko.html
2a495b86660f-13
Bind input and output types to a Runnable, returning a new Runnable. property InputType: TypeAlias¶ Get the input type for this runnable. property OutputType: Any¶ Get the output type for this runnable. property config_specs: List[langchain.schema.runnable.utils.ConfigurableFieldSpec]¶ List configurable fields for this...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.konko.ChatKonko.html
0e349f3a1a0d-0
langchain.chat_models.javelin_ai_gateway.ChatJavelinAIGateway¶ class langchain.chat_models.javelin_ai_gateway.ChatJavelinAIGateway[source]¶ Bases: BaseChatModel Javelin AI Gateway chat models API. To use, you should have the javelin_sdk python package installed. For more information, see https://docs.getjavelin.io Exam...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.javelin_ai_gateway.ChatJavelinAIGateway.html
0e349f3a1a0d-1
param route: str [Required]¶ The route to use for the Javelin AI Gateway API. param tags: Optional[List[str]] = None¶ Tags to add to the run trace. param verbose: bool [Optional]¶ Whether to print out response text. __call__(messages: List[BaseMessage], stop: Optional[List[str]] = None, callbacks: Optional[Union[List[B...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.javelin_ai_gateway.ChatJavelinAIGateway.html
0e349f3a1a0d-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...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.javelin_ai_gateway.ChatJavelinAIGateway.html
0e349f3a1a0d-3
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. async apredict_messages(messages: List[BaseMessage],...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.javelin_ai_gateway.ChatJavelinAIGateway.html
0e349f3a1a0d-4
Stream all output from a runnable, as reported to the callback system. This includes all inner runs of LLMs, Retrievers, Tools, etc. 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...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.javelin_ai_gateway.ChatJavelinAIGateway.html
0e349f3a1a0d-5
Parameters include – A list of fields to include in the config schema. Returns A pydantic model that can be used to validate config. configurable_alternatives(which: ConfigurableField, default_key: str = 'default', **kwargs: Union[Runnable[Input, Output], Callable[[], Runnable[Input, Output]]]) → RunnableSerializable[I...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.javelin_ai_gateway.ChatJavelinAIGateway.html
0e349f3a1a0d-6
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...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.javelin_ai_gateway.ChatJavelinAIGateway.html
0e349f3a1a0d-7
Get a pydantic model that can be used to validate input to the runnable. Runnables that leverage the configurable_fields and configurable_alternatives methods will have a dynamic input schema that depends on which configuration the runnable is invoked with. This method allows to get an input schema for a specific confi...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.javelin_ai_gateway.ChatJavelinAIGateway.html
0e349f3a1a0d-8
Returns A pydantic model that can be used to validate output. get_token_ids(text: str) → List[int]¶ 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[PromptVal...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.javelin_ai_gateway.ChatJavelinAIGateway.html
0e349f3a1a0d-9
classmethod lc_id() → List[str]¶ A unique identifier for this class for serialization purposes. The unique identifier is a list of strings that describes the path to the object. map() → Runnable[List[Input], List[Output]]¶ Return a new Runnable that maps a list of inputs to a list of outputs, by calling invoke() with e...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.javelin_ai_gateway.ChatJavelinAIGateway.html
0e349f3a1a0d-10
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...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.javelin_ai_gateway.ChatJavelinAIGateway.html
0e349f3a1a0d-11
Bind config to a Runnable, returning a new Runnable. with_fallbacks(fallbacks: Sequence[Runnable[Input, Output]], *, exceptions_to_handle: Tuple[Type[BaseException], ...] = (<class 'Exception'>,)) → RunnableWithFallbacksT[Input, Output]¶ Add fallbacks to a runnable, returning a new Runnable. Parameters fallbacks – A se...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.javelin_ai_gateway.ChatJavelinAIGateway.html
0e349f3a1a0d-12
between retries stop_after_attempt – The maximum number of attempts to make before giving up Returns A new Runnable that retries the original runnable on exceptions. with_types(*, input_type: Optional[Type[Input]] = None, output_type: Optional[Type[Output]] = None) → Runnable[Input, Output]¶ Bind input and output types...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.javelin_ai_gateway.ChatJavelinAIGateway.html
063f1739bed3-0
langchain.chat_models.yandex.ChatYandexGPT¶ class langchain.chat_models.yandex.ChatYandexGPT[source]¶ Bases: _BaseYandexGPT, BaseChatModel Wrapper around YandexGPT large language models. There are two authentication options for the service account with the ai.languageModels.user role: You can specify the token in a con...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.yandex.ChatYandexGPT.html
063f1739bed3-1
Model name to use. param stop: Optional[List[str]] = None¶ Sequences when completion generation will stop. param tags: Optional[List[str]] = None¶ Tags to add to the run trace. param temperature: float = 0.6¶ What sampling temperature to use. Should be a double number between 0 (inclusive) and 1 (inclusive). param url:...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.yandex.ChatYandexGPT.html
063f1739bed3-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...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.yandex.ChatYandexGPT.html
063f1739bed3-3
Subclasses should override this method if they can run asynchronously. async apredict(text: str, *, stop: Optional[Sequence[str]] = None, **kwargs: Any) → str¶ 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 gen...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.yandex.ChatYandexGPT.html
063f1739bed3-4
Subclasses should override this method if they support streaming output. async astream_log(input: Any, config: Optional[RunnableConfig] = None, *, diff: bool = True, include_names: Optional[Sequence[str]] = None, include_types: Optional[Sequence[str]] = None, include_tags: Optional[Sequence[str]] = None, exclude_names:...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.yandex.ChatYandexGPT.html
063f1739bed3-5
e.g., if the underlying runnable uses an API which supports a batch mode. bind(**kwargs: Any) → Runnable[Input, Output]¶ Bind arguments to a Runnable, returning a new Runnable. call_as_llm(message: str, stop: Optional[List[str]] = None, **kwargs: Any) → str¶ config_schema(*, include: Optional[Sequence[str]] = None) → T...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.yandex.ChatYandexGPT.html
063f1739bed3-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...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.yandex.ChatYandexGPT.html
063f1739bed3-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...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.yandex.ChatYandexGPT.html
063f1739bed3-8
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_output_schema(config: Optional[RunnableConfig] = None) → Type[BaseModel]¶ Get a pydantic model that can be used to validate output ...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.yandex.ChatYandexGPT.html
063f1739bed3-9
classmethod is_lc_serializable() → bool¶ Is this class serializable? json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defa...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.yandex.ChatYandexGPT.html
063f1739bed3-10
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...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.yandex.ChatYandexGPT.html
063f1739bed3-11
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...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.yandex.ChatYandexGPT.html
063f1739bed3-12
on_end: Called after the runnable finishes running, with the Run object. on_error: Called if the runnable throws an error, with the Run object. The Run object contains information about the run, including its id, type, input, output, error, start_time, end_time, and any tags or metadata added to the run. with_retry(*, ...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.yandex.ChatYandexGPT.html
063f1739bed3-13
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]¶ The type of output this runnable produces specified as a pydantic model.
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.yandex.ChatYandexGPT.html
eddf05ea8c69-0
langchain.chat_models.fireworks.completion_with_retry¶ langchain.chat_models.fireworks.completion_with_retry(llm: ChatFireworks, use_retry: bool, *, run_manager: Optional[CallbackManagerForLLMRun] = None, **kwargs: Any) → Any[source]¶ Use tenacity to retry the completion call.
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.fireworks.completion_with_retry.html
0e8f429a1d47-0
langchain.chat_models.anyscale.ChatAnyscale¶ class langchain.chat_models.anyscale.ChatAnyscale[source]¶ Bases: ChatOpenAI Anyscale Chat large language models. See https://www.anyscale.com/ for information about Anyscale. To use, you should have the openai python package installed, and the environment variable ANYSCALE_...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.anyscale.ChatAnyscale.html
0e8f429a1d47-1
param default_headers: Union[Mapping[str, str], None] = None¶ param default_query: Union[Mapping[str, object], None] = None¶ param http_client: Union[Any, None] = None¶ Optional httpx.Client. param max_retries: int = 2¶ Maximum number of retries to make when generating. param max_tokens: Optional[int] = None¶ Maximum n...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.anyscale.ChatAnyscale.html
0e8f429a1d47-2
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 tiktoken_model_name: Optional[str] = None¶ The model name to pass to tiktoken when using this class. Tiktoken is used to count the number of...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.anyscale.ChatAnyscale.html
0e8f429a1d47-3
e.g., if the underlying runnable uses an API which supports a batch mode. 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]] = None...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.anyscale.ChatAnyscale.html
0e8f429a1d47-4
async ainvoke(input: Union[PromptValue, str, List[BaseMessage]], config: Optional[RunnableConfig] = None, *, stop: Optional[List[str]] = None, **kwargs: Any) → BaseMessage¶ Default implementation of ainvoke, calls invoke from a thread. The default implementation allows usage of async code even if the runnable did not i...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.anyscale.ChatAnyscale.html
0e8f429a1d47-5
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]¶ Default implementation of astream, which calls ainvo...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.anyscale.ChatAnyscale.html
0e8f429a1d47-6
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 runs invoke in parallel using a thread pool executor. The default implementation of batch w...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.anyscale.ChatAnyscale.html
0e8f429a1d47-7
The type of config this runnable accepts specified as a pydantic model. To mark a field as configurable, see the configurable_fields and configurable_alternatives methods. Parameters include – A list of fields to include in the config schema. Returns A pydantic model that can be used to validate config. configurable_al...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.anyscale.ChatAnyscale.html
0e8f429a1d47-8
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[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, *, tags: Optional[List[str]] = N...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.anyscale.ChatAnyscale.html
0e8f429a1d47-9
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. static get_available_models(anyscale_api_key: Optional[str] = None, anyscale_api_base: str = 'https://api.endpoints.anyscale.com/v1') → Set[str][source...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.anyscale.ChatAnyscale.html
0e8f429a1d47-10
main/examples/How_to_format_inputs_to_ChatGPT_models.ipynb get_output_schema(config: Optional[RunnableConfig] = None) → Type[BaseModel]¶ Get a pydantic model that can be used to validate output to the runnable. Runnables that leverage the configurable_fields and configurable_alternatives methods will have a dynamic out...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.anyscale.ChatAnyscale.html
0e8f429a1d47-11
Return whether this model can be serialized by Langchain. 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 ...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.anyscale.ChatAnyscale.html
0e8f429a1d47-12
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...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.anyscale.ChatAnyscale.html
0e8f429a1d47-13
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...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.anyscale.ChatAnyscale.html
0e8f429a1d47-14
on_end: Called after the runnable finishes running, with the Run object. on_error: Called if the runnable throws an error, with the Run object. The Run object contains information about the run, including its id, type, input, output, error, start_time, end_time, and any tags or metadata added to the run. with_retry(*, ...
lang/api.python.langchain.com/en/latest/chat_models/langchain.chat_models.anyscale.ChatAnyscale.html