id
stringlengths
14
15
text
stringlengths
13
2.7k
source
stringlengths
60
181
8a51fd087654-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/llms/langchain_community.llms.sagemaker_endpoint.SagemakerEndpoint.html
8a51fd087654-5
input – The input to the runnable. config – The config to use for the runnable. diff – Whether to yield diffs between each step, or the current state. with_streamed_output_list – Whether to yield the streamed_output list. include_names – Only include logs with these names. include_types – Only include logs with these t...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.sagemaker_endpoint.SagemakerEndpoint.html
8a51fd087654-6
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', prefix_keys: bool = False, **kwargs: Union[Runnable[Input, Output], Callable[[], Runnable[Input, Outpu...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.sagemaker_endpoint.SagemakerEndpoint.html
8a51fd087654-7
classmethod from_orm(obj: Any) → Model¶ generate(prompts: List[str], stop: Optional[List[str]] = None, callbacks: Union[List[BaseCallbackHandler], BaseCallbackManager, None, List[Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]]]] = None, *, tags: Optional[Union[List[str], List[List[str]]]] = None, metada...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.sagemaker_endpoint.SagemakerEndpoint.html
8a51fd087654-8
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 each inputprompt and additional model provider-specific output. get_inp...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.sagemaker_endpoint.SagemakerEndpoint.html
8a51fd087654-9
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...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.sagemaker_endpoint.SagemakerEndpoint.html
8a51fd087654-10
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/llms/langchain_community.llms.sagemaker_endpoint.SagemakerEndpoint.html
8a51fd087654-11
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/llms/langchain_community.llms.sagemaker_endpoint.SagemakerEndpoint.html
8a51fd087654-12
stream(input: Union[PromptValue, str, List[BaseMessage]], config: Optional[RunnableConfig] = None, *, stop: Optional[List[str]] = None, **kwargs: Any) → Iterator[str]¶ Default implementation of stream, which calls invoke. Subclasses should override this method if they support streaming output. to_json() → Union[Seriali...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.sagemaker_endpoint.SagemakerEndpoint.html
8a51fd087654-13
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 ...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.sagemaker_endpoint.SagemakerEndpoint.html
8a51fd087654-14
property config_specs: List[langchain_core.runnables.utils.ConfigurableFieldSpec]¶ 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...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.sagemaker_endpoint.SagemakerEndpoint.html
e554914923bf-0
langchain_community.llms.openai.AzureOpenAI¶ class langchain_community.llms.openai.AzureOpenAI[source]¶ Bases: BaseOpenAI Azure-specific OpenAI 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/llms/langchain_community.llms.openai.AzureOpenAI.html
e554914923bf-1
param cache: Optional[bool] = None¶ param callback_manager: Optional[BaseCallbackManager] = None¶ param callbacks: Callbacks = None¶ param default_headers: Union[Mapping[str, str], None] = None¶ param default_query: Union[Mapping[str, object], None] = None¶ param deployment_name: Union[str, None] = None (alias 'azure_d...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.openai.AzureOpenAI.html
e554914923bf-2
param n: int = 1¶ How many completions to generate for each prompt. param openai_api_base: Optional[str] = None (alias 'base_url')¶ Base URL path for API requests, leave blank if not using a proxy or service emulator. param openai_api_key: Union[str, None] = None (alias 'api_key')¶ Automatically inferred from env var A...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.openai.AzureOpenAI.html
e554914923bf-3
be the same as the embedding model name. However, there are some cases 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...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.openai.AzureOpenAI.html
e554914923bf-4
e.g., if the underlying runnable uses an API which supports a batch mode. async agenerate(prompts: List[str], stop: Optional[List[str]] = None, callbacks: Union[List[BaseCallbackHandler], BaseCallbackManager, None, List[Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]]]] = None, *, tags: Optional[Union[Li...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.openai.AzureOpenAI.html
e554914923bf-5
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 each inputprompt and additional model provider-specific output. async a...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.openai.AzureOpenAI.html
e554914923bf-6
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/llms/langchain_community.llms.openai.AzureOpenAI.html
e554914923bf-7
include_names – Only include logs with these names. include_types – Only include logs with these types. include_tags – Only include logs with these tags. exclude_names – Exclude logs with these names. exclude_types – Exclude logs with these types. exclude_tags – Exclude logs with these tags. async atransform(input: Asy...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.openai.AzureOpenAI.html
e554914923bf-8
Returns A pydantic model that can be used to validate config. configurable_alternatives(which: ConfigurableField, *, default_key: str = 'default', prefix_keys: bool = False, **kwargs: Union[Runnable[Input, Output], Callable[[], Runnable[Input, Output]]]) → RunnableSerializable[Input, Output]¶ configurable_fields(**kwar...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.openai.AzureOpenAI.html
e554914923bf-9
Create the LLMResult from the choices and prompts. dict(**kwargs: Any) → Dict¶ Return a dictionary of the LLM. classmethod from_orm(obj: Any) → Model¶ generate(prompts: List[str], stop: Optional[List[str]] = None, callbacks: Union[List[BaseCallbackHandler], BaseCallbackManager, None, List[Optional[Union[List[BaseCallba...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.openai.AzureOpenAI.html
e554914923bf-10
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 usually passed to the model provider API call. Returns An LLMResult, which co...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.openai.AzureOpenAI.html
e554914923bf-11
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...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.openai.AzureOpenAI.html
e554914923bf-12
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/llms/langchain_community.llms.openai.AzureOpenAI.html
e554914923bf-13
max_tokens = openai.modelname_to_contextsize("text-davinci-003") 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], *...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.openai.AzureOpenAI.html
e554914923bf-14
to the model provider API call. Returns Top model prediction as a message. save(file_path: Union[Path, str]) → None¶ Save the LLM. Parameters file_path – Path to file to save the LLM to. Example: .. code-block:: python llm.save(file_path=”path/llm.yaml”) classmethod schema(by_alias: bool = True, ref_template: unicode =...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.openai.AzureOpenAI.html
e554914923bf-15
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...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.openai.AzureOpenAI.html
e554914923bf-16
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...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.openai.AzureOpenAI.html
eedde95a6fa8-0
langchain_community.llms.aleph_alpha.AlephAlpha¶ class langchain_community.llms.aleph_alpha.AlephAlpha[source]¶ Bases: LLM Aleph Alpha large language models. To use, you should have the aleph_alpha_client python package installed, and the environment variable ALEPH_ALPHA_API_KEY set with your API key, or pass it as a n...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.aleph_alpha.AlephAlpha.html
eedde95a6fa8-1
param contextual_control_threshold: Optional[float] = None¶ If set to None, attention control parameters only apply to those tokens that have explicitly been set in the request. If set to a non-None value, control parameters are also applied to similar tokens. param control_log_additive: Optional[bool] = True¶ True: ap...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.aleph_alpha.AlephAlpha.html
eedde95a6fa8-2
param maximum_tokens: int = 64¶ The maximum number of tokens to be generated. param metadata: Optional[Dict[str, Any]] = None¶ Metadata to add to the run trace. param minimum_tokens: Optional[int] = 0¶ Generate at least this number of tokens. param model: Optional[str] = 'luminous-base'¶ Model name to use. param n: int...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.aleph_alpha.AlephAlpha.html
eedde95a6fa8-3
param sequence_penalty_min_length: int = 2¶ param stop_sequences: Optional[List[str]] = None¶ Stop sequences to use. param tags: Optional[List[str]] = None¶ Tags to add to the run trace. param temperature: float = 0.0¶ A non-negative float that tunes the degree of randomness in generation. param tokens: Optional[bool] ...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.aleph_alpha.AlephAlpha.html
eedde95a6fa8-4
Check Cache and run the LLM on the given prompt and input. async abatch(inputs: List[Union[PromptValue, str, List[BaseMessage]]], config: Optional[Union[RunnableConfig, List[RunnableConfig]]] = None, *, return_exceptions: bool = False, **kwargs: Any) → List[str]¶ Default implementation runs ainvoke in parallel using as...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.aleph_alpha.AlephAlpha.html
eedde95a6fa8-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/llms/langchain_community.llms.aleph_alpha.AlephAlpha.html
eedde95a6fa8-6
**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/llms/langchain_community.llms.aleph_alpha.AlephAlpha.html
eedde95a6fa8-7
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...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.aleph_alpha.AlephAlpha.html
eedde95a6fa8-8
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. config_schema(*, include: Optional[Sequence[str]] = None) → Type[BaseModel]¶ The type of config this runnable accepts specified as a pydantic m...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.aleph_alpha.AlephAlpha.html
eedde95a6fa8-9
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 creating the new model: you should trust this data deep – set to True to make a deep co...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.aleph_alpha.AlephAlpha.html
eedde95a6fa8-10
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/llms/langchain_community.llms.aleph_alpha.AlephAlpha.html
eedde95a6fa8-11
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 tokenize. Returns The sum of the number of tokens across the messages. get_output_schema(config: Op...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.aleph_alpha.AlephAlpha.html
eedde95a6fa8-12
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/llms/langchain_community.llms.aleph_alpha.AlephAlpha.html
eedde95a6fa8-13
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/llms/langchain_community.llms.aleph_alpha.AlephAlpha.html
eedde95a6fa8-14
stream(input: Union[PromptValue, str, List[BaseMessage]], config: Optional[RunnableConfig] = None, *, stop: Optional[List[str]] = None, **kwargs: Any) → Iterator[str]¶ Default implementation of stream, which calls invoke. Subclasses should override this method if they support streaming output. to_json() → Union[Seriali...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.aleph_alpha.AlephAlpha.html
eedde95a6fa8-15
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 ...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.aleph_alpha.AlephAlpha.html
eedde95a6fa8-16
property config_specs: List[langchain_core.runnables.utils.ConfigurableFieldSpec]¶ 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...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.aleph_alpha.AlephAlpha.html
c65427c22408-0
langchain_community.llms.forefrontai.ForefrontAI¶ class langchain_community.llms.forefrontai.ForefrontAI[source]¶ Bases: LLM ForefrontAI large language models. To use, you should have the environment variable FOREFRONTAI_API_KEY set with your API key. Example from langchain_community.llms import ForefrontAI forefrontai...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.forefrontai.ForefrontAI.html
c65427c22408-1
param verbose: bool [Optional]¶ Whether to print out response text. __call__(prompt: str, stop: Optional[List[str]] = None, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, *, tags: Optional[List[str]] = None, metadata: Optional[Dict[str, Any]] = None, **kwargs: Any) → str¶ Check Cache...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.forefrontai.ForefrontAI.html
c65427c22408-2
Run the LLM on the given prompt and input. async agenerate_prompt(prompts: List[PromptValue], stop: Optional[List[str]] = None, callbacks: Union[List[BaseCallbackHandler], BaseCallbackManager, None, List[Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]]]] = None, **kwargs: Any) → LLMResult¶ Asynchronously...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.forefrontai.ForefrontAI.html
c65427c22408-3
the runnable did not implement a native async version of invoke. 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 ...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.forefrontai.ForefrontAI.html
c65427c22408-4
Subclasses should override this method if they support streaming output. async astream_log(input: Any, config: Optional[RunnableConfig] = None, *, diff: bool = True, with_streamed_output_list: bool = True, include_names: Optional[Sequence[str]] = None, include_types: Optional[Sequence[str]] = None, include_tags: Option...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.forefrontai.ForefrontAI.html
c65427c22408-5
Default implementation of atransform, which buffers input and calls astream. Subclasses should override this method if they can start producing output while input is still being generated. batch(inputs: List[Union[PromptValue, str, List[BaseMessage]]], config: Optional[Union[RunnableConfig, List[RunnableConfig]]] = Non...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.forefrontai.ForefrontAI.html
c65427c22408-6
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/llms/langchain_community.llms.forefrontai.ForefrontAI.html
c65427c22408-7
Run the LLM on the given prompt and input. generate_prompt(prompts: List[PromptValue], stop: Optional[List[str]] = None, callbacks: Union[List[BaseCallbackHandler], BaseCallbackManager, None, List[Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]]]] = None, **kwargs: Any) → LLMResult¶ Pass a sequence of pr...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.forefrontai.ForefrontAI.html
c65427c22408-8
This method allows to get an input schema for a specific configuration. Parameters config – A config to use when generating the schema. Returns A pydantic model that can be used to validate input. classmethod get_lc_namespace() → List[str]¶ Get the namespace of the langchain object. For example, if the class is langcha...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.forefrontai.ForefrontAI.html
c65427c22408-9
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) → str¶ Transform a single ...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.forefrontai.ForefrontAI.html
c65427c22408-10
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, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool =...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.forefrontai.ForefrontAI.html
c65427c22408-11
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. save(file_path: Union[Path, str]) → None¶ Save the LLM. Parameters file_path – Path to file to save the LLM to. Example: .. ...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.forefrontai.ForefrontAI.html
c65427c22408-12
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...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.forefrontai.ForefrontAI.html
c65427c22408-13
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...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.forefrontai.ForefrontAI.html
6bda72657b1f-0
langchain_community.llms.vertexai.VertexAIModelGarden¶ class langchain_community.llms.vertexai.VertexAIModelGarden[source]¶ Bases: _VertexAIBase, BaseLLM Large language models served from Vertex AI Model Garden. Create a new model by parsing and validating input data from keyword arguments. Raises ValidationError if th...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.vertexai.VertexAIModelGarden.html
6bda72657b1f-1
Tags to add to the run trace. param verbose: bool [Optional]¶ Whether to print out response text. __call__(prompt: str, stop: Optional[List[str]] = None, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, *, tags: Optional[List[str]] = None, metadata: Optional[Dict[str, Any]] = None, **k...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.vertexai.VertexAIModelGarden.html
6bda72657b1f-2
Run the LLM on the given prompt and input. async agenerate_prompt(prompts: List[PromptValue], stop: Optional[List[str]] = None, callbacks: Union[List[BaseCallbackHandler], BaseCallbackManager, None, List[Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]]]] = None, **kwargs: Any) → LLMResult¶ Asynchronously...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.vertexai.VertexAIModelGarden.html
6bda72657b1f-3
the runnable did not implement a native async version of invoke. 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 ...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.vertexai.VertexAIModelGarden.html
6bda72657b1f-4
Subclasses should override this method if they support streaming output. async astream_log(input: Any, config: Optional[RunnableConfig] = None, *, diff: bool = True, with_streamed_output_list: bool = True, include_names: Optional[Sequence[str]] = None, include_types: Optional[Sequence[str]] = None, include_tags: Option...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.vertexai.VertexAIModelGarden.html
6bda72657b1f-5
Default implementation of atransform, which buffers input and calls astream. Subclasses should override this method if they can start producing output while input is still being generated. batch(inputs: List[Union[PromptValue, str, List[BaseMessage]]], config: Optional[Union[RunnableConfig, List[RunnableConfig]]] = Non...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.vertexai.VertexAIModelGarden.html
6bda72657b1f-6
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/llms/langchain_community.llms.vertexai.VertexAIModelGarden.html
6bda72657b1f-7
Run the LLM on the given prompt and input. generate_prompt(prompts: List[PromptValue], stop: Optional[List[str]] = None, callbacks: Union[List[BaseCallbackHandler], BaseCallbackManager, None, List[Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]]]] = None, **kwargs: Any) → LLMResult¶ Pass a sequence of pr...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.vertexai.VertexAIModelGarden.html
6bda72657b1f-8
This method allows to get an input schema for a specific configuration. Parameters config – A config to use when generating the schema. Returns A pydantic model that can be used to validate input. classmethod get_lc_namespace() → List[str]¶ Get the namespace of the langchain object. For example, if the class is langcha...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.vertexai.VertexAIModelGarden.html
6bda72657b1f-9
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) → str¶ Transform a single ...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.vertexai.VertexAIModelGarden.html
6bda72657b1f-10
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, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool =...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.vertexai.VertexAIModelGarden.html
6bda72657b1f-11
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. save(file_path: Union[Path, str]) → None¶ Save the LLM. Parameters file_path – Path to file to save the LLM to. Example: .. ...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.vertexai.VertexAIModelGarden.html
6bda72657b1f-12
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...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.vertexai.VertexAIModelGarden.html
6bda72657b1f-13
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...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.vertexai.VertexAIModelGarden.html
4755cfd8cc4b-0
langchain_community.llms.azureml_endpoint.ContentFormatterBase¶ class langchain_community.llms.azureml_endpoint.ContentFormatterBase[source]¶ Transform request and response of AzureML endpoint to match with required schema. Attributes accepts The MIME type of the response data returned from the endpoint content_type Th...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.azureml_endpoint.ContentFormatterBase.html
5e8d3ed49c28-0
langchain_community.llms.nlpcloud.NLPCloud¶ class langchain_community.llms.nlpcloud.NLPCloud[source]¶ Bases: LLM NLPCloud large language models. To use, you should have the nlpcloud python package installed, and the environment variable NLPCLOUD_API_KEY set with your API key. Example from langchain_community.llms impor...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.nlpcloud.NLPCloud.html
5e8d3ed49c28-1
Number of beams for beam search. param num_return_sequences: int = 1¶ How many completions to generate for each prompt. param remove_end_sequence: bool = True¶ Whether or not to remove the end sequence token. param remove_input: bool = True¶ Remove input text from API response param repetition_penalty: float = 1.0¶ Pen...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.nlpcloud.NLPCloud.html
5e8d3ed49c28-2
e.g., if the underlying runnable uses an API which supports a batch mode. async agenerate(prompts: List[str], stop: Optional[List[str]] = None, callbacks: Union[List[BaseCallbackHandler], BaseCallbackManager, None, List[Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]]]] = None, *, tags: Optional[Union[Li...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.nlpcloud.NLPCloud.html
5e8d3ed49c28-3
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 each inputprompt and additional model provider-specific output. async a...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.nlpcloud.NLPCloud.html
5e8d3ed49c28-4
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/llms/langchain_community.llms.nlpcloud.NLPCloud.html
5e8d3ed49c28-5
include_names – Only include logs with these names. include_types – Only include logs with these types. include_tags – Only include logs with these tags. exclude_names – Exclude logs with these names. exclude_types – Exclude logs with these types. exclude_tags – Exclude logs with these tags. async atransform(input: Asy...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.nlpcloud.NLPCloud.html
5e8d3ed49c28-6
Returns A pydantic model that can be used to validate config. configurable_alternatives(which: ConfigurableField, *, default_key: str = 'default', prefix_keys: bool = False, **kwargs: Union[Runnable[Input, Output], Callable[[], Runnable[Input, Output]]]) → RunnableSerializable[Input, Output]¶ configurable_fields(**kwar...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.nlpcloud.NLPCloud.html
5e8d3ed49c28-7
classmethod from_orm(obj: Any) → Model¶ generate(prompts: List[str], stop: Optional[List[str]] = None, callbacks: Union[List[BaseCallbackHandler], BaseCallbackManager, None, List[Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]]]] = None, *, tags: Optional[Union[List[str], List[List[str]]]] = None, metada...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.nlpcloud.NLPCloud.html
5e8d3ed49c28-8
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 each inputprompt and additional model provider-specific output. get_inp...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.nlpcloud.NLPCloud.html
5e8d3ed49c28-9
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...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.nlpcloud.NLPCloud.html
5e8d3ed49c28-10
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/llms/langchain_community.llms.nlpcloud.NLPCloud.html
5e8d3ed49c28-11
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/llms/langchain_community.llms.nlpcloud.NLPCloud.html
5e8d3ed49c28-12
stream(input: Union[PromptValue, str, List[BaseMessage]], config: Optional[RunnableConfig] = None, *, stop: Optional[List[str]] = None, **kwargs: Any) → Iterator[str]¶ Default implementation of stream, which calls invoke. Subclasses should override this method if they support streaming output. to_json() → Union[Seriali...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.nlpcloud.NLPCloud.html
5e8d3ed49c28-13
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 ...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.nlpcloud.NLPCloud.html
5e8d3ed49c28-14
property config_specs: List[langchain_core.runnables.utils.ConfigurableFieldSpec]¶ 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...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.nlpcloud.NLPCloud.html
d79d6896dac8-0
langchain_community.llms.volcengine_maas.VolcEngineMaasBase¶ class langchain_community.llms.volcengine_maas.VolcEngineMaasBase[source]¶ Bases: BaseModel Base class for VolcEngineMaas models. Create a new model by parsing and validating input data from keyword arguments. Raises ValidationError if the input data cannot b...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.volcengine_maas.VolcEngineMaasBase.html
d79d6896dac8-1
param top_p: Optional[float] = 0.8¶ Total probability mass of tokens to consider at each step. param volc_engine_maas_ak: Optional[str] = None¶ access key for volc engine param volc_engine_maas_sk: Optional[str] = None¶ secret key for volc engine classmethod construct(_fields_set: Optional[SetStr] = None, **values: Any...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.volcengine_maas.VolcEngineMaasBase.html
d79d6896dac8-2
Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. classmethod from_orm(obj: Any) → Model¶ json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False,...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.volcengine_maas.VolcEngineMaasBase.html
be5bee59791c-0
langchain_community.llms.cohere.acompletion_with_retry¶ langchain_community.llms.cohere.acompletion_with_retry(llm: Cohere, **kwargs: Any) → Any[source]¶ Use tenacity to retry the completion call.
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.cohere.acompletion_with_retry.html
913c7458394d-0
langchain_community.llms.bedrock.BedrockBase¶ class langchain_community.llms.bedrock.BedrockBase[source]¶ Bases: BaseModel, ABC Base class for Bedrock 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. ...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.bedrock.BedrockBase.html
913c7458394d-1
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/llms/langchain_community.llms.bedrock.BedrockBase.html
913c7458394d-2
classmethod from_orm(obj: Any) → Model¶ json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_n...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.bedrock.BedrockBase.html
f5d9a53325b9-0
langchain_community.llms.minimax.MinimaxCommon¶ class langchain_community.llms.minimax.MinimaxCommon[source]¶ Bases: BaseModel Common parameters for Minimax large language models. 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/llms/langchain_community.llms.minimax.MinimaxCommon.html
f5d9a53325b9-1
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/llms/langchain_community.llms.minimax.MinimaxCommon.html
f5d9a53325b9-2
classmethod parse_file(path: Union[str, Path], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) → Model¶ classmethod parse_obj(obj: Any) → Model¶ classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto...
https://api.python.langchain.com/en/latest/llms/langchain_community.llms.minimax.MinimaxCommon.html
5a199eb836f1-0
langchain_experimental.llms.anthropic_functions.AnthropicFunctions¶ class langchain_experimental.llms.anthropic_functions.AnthropicFunctions[source]¶ Bases: BaseChatModel 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 v...
https://api.python.langchain.com/en/latest/llms/langchain_experimental.llms.anthropic_functions.AnthropicFunctions.html