id stringlengths 14 15 | text stringlengths 13 2.7k | source stringlengths 60 181 |
|---|---|---|
4a34cc4482ce-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.javelin_ai_gateway.JavelinAIGateway.html |
4a34cc4482ce-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.javelin_ai_gateway.JavelinAIGateway.html |
4a34cc4482ce-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.javelin_ai_gateway.JavelinAIGateway.html |
4a34cc4482ce-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.javelin_ai_gateway.JavelinAIGateway.html |
4a34cc4482ce-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.javelin_ai_gateway.JavelinAIGateway.html |
4a34cc4482ce-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.javelin_ai_gateway.JavelinAIGateway.html |
4a34cc4482ce-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.javelin_ai_gateway.JavelinAIGateway.html |
77ff77ef3485-0 | langchain_community.llms.yandex.YandexGPT¶
class langchain_community.llms.yandex.YandexGPT[source]¶
Bases: _BaseYandexGPT, LLM
Yandex large language models.
To use, you should have the yandexcloud python package installed.
There are two authentication options for the service account
with the ai.languageModels.user role... | https://api.python.langchain.com/en/latest/llms/langchain_community.llms.yandex.YandexGPT.html |
77ff77ef3485-1 | Must be greater than zero and not exceed 7400 tokens.
param metadata: Optional[Dict[str, Any]] = None¶
Metadata to add to the run trace.
param model_name: str = 'yandexgpt-lite'¶
Model name to use.
param model_uri: str = ''¶
Model uri to use.
param model_version: str = 'latest'¶
Model version to use.
param stop: Option... | https://api.python.langchain.com/en/latest/llms/langchain_community.llms.yandex.YandexGPT.html |
77ff77ef3485-2 | Subclasses should override this method if they can batch more efficiently;
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[BaseC... | https://api.python.langchain.com/en/latest/llms/langchain_community.llms.yandex.YandexGPT.html |
77ff77ef3485-3 | 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.yandex.YandexGPT.html |
77ff77ef3485-4 | Parameters
messages – A sequence of chat messages corresponding to a single model input.
stop – Stop words to use when generating. Model output is cut off at the
first occurrence of any of these substrings.
**kwargs – Arbitrary additional keyword arguments. These are usually passed
to the model provider API call.
Retur... | https://api.python.langchain.com/en/latest/llms/langchain_community.llms.yandex.YandexGPT.html |
77ff77ef3485-5 | 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 types.
include_tags – Only include logs with these tags.
exclude_names – Exclude ... | https://api.python.langchain.com/en/latest/llms/langchain_community.llms.yandex.YandexGPT.html |
77ff77ef3485-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.yandex.YandexGPT.html |
77ff77ef3485-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.yandex.YandexGPT.html |
77ff77ef3485-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.yandex.YandexGPT.html |
77ff77ef3485-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.yandex.YandexGPT.html |
77ff77ef3485-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.yandex.YandexGPT.html |
77ff77ef3485-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.yandex.YandexGPT.html |
77ff77ef3485-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.yandex.YandexGPT.html |
77ff77ef3485-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.yandex.YandexGPT.html |
77ff77ef3485-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.yandex.YandexGPT.html |
fc23442cfe85-0 | langchain_community.llms.vertexai.is_gemini_model¶
langchain_community.llms.vertexai.is_gemini_model(model_name: str) → bool[source]¶
Returns True if the model name is a Gemini model. | https://api.python.langchain.com/en/latest/llms/langchain_community.llms.vertexai.is_gemini_model.html |
4008a3efe3a8-0 | langchain_community.llms.watsonxllm.WatsonxLLM¶
class langchain_community.llms.watsonxllm.WatsonxLLM[source]¶
Bases: BaseLLM
IBM watsonx.ai large language models.
To use, you should have ibm_watson_machine_learning python package installed,
and the environment variable WATSONX_APIKEY set with your API key, or pass
it a... | https://api.python.langchain.com/en/latest/llms/langchain_community.llms.watsonxllm.WatsonxLLM.html |
4008a3efe3a8-1 | param callbacks: Callbacks = None¶
param instance_id: Optional[pydantic.types.SecretStr] = None¶
Instance_id of Watson Machine Learning instance
Constraints
type = string
writeOnly = True
format = password
param metadata: Optional[Dict[str, Any]] = None¶
Metadata to add to the run trace.
param model_id: str = ''¶
Type ... | https://api.python.langchain.com/en/latest/llms/langchain_community.llms.watsonxllm.WatsonxLLM.html |
4008a3efe3a8-2 | the path to a CA_BUNDLE file
the path of directory with certificates of trusted CAs
True - default path to truststore will be taken
False - no verification will be made
param version: Optional[pydantic.types.SecretStr] = None¶
Version of Watson Machine Learning instance
Constraints
type = string
writeOnly = True
format... | https://api.python.langchain.com/en/latest/llms/langchain_community.llms.watsonxllm.WatsonxLLM.html |
4008a3efe3a8-3 | 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.watsonxllm.WatsonxLLM.html |
4008a3efe3a8-4 | 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.watsonxllm.WatsonxLLM.html |
4008a3efe3a8-5 | 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.watsonxllm.WatsonxLLM.html |
4008a3efe3a8-6 | 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.watsonxllm.WatsonxLLM.html |
4008a3efe3a8-7 | 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.watsonxllm.WatsonxLLM.html |
4008a3efe3a8-8 | 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.watsonxllm.WatsonxLLM.html |
4008a3efe3a8-9 | 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.watsonxllm.WatsonxLLM.html |
4008a3efe3a8-10 | 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.watsonxllm.WatsonxLLM.html |
4008a3efe3a8-11 | classmethod is_lc_serializable() → bool[source]¶
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, excl... | https://api.python.langchain.com/en/latest/llms/langchain_community.llms.watsonxllm.WatsonxLLM.html |
4008a3efe3a8-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... | https://api.python.langchain.com/en/latest/llms/langchain_community.llms.watsonxllm.WatsonxLLM.html |
4008a3efe3a8-13 | 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.watsonxllm.WatsonxLLM.html |
4008a3efe3a8-14 | 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.watsonxllm.WatsonxLLM.html |
4008a3efe3a8-15 | 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.watsonxllm.WatsonxLLM.html |
57b77cd20ab2-0 | langchain_community.llms.fireworks.acompletion_with_retry¶
async langchain_community.llms.fireworks.acompletion_with_retry(llm: Fireworks, use_retry: bool, *, run_manager: Optional[AsyncCallbackManagerForLLMRun] = None, **kwargs: Any) → Any[source]¶
Use tenacity to retry the completion call. | https://api.python.langchain.com/en/latest/llms/langchain_community.llms.fireworks.acompletion_with_retry.html |
59286420ff14-0 | langchain_community.llms.gradient_ai.TrainResult¶
class langchain_community.llms.gradient_ai.TrainResult[source]¶
Train result.
loss: float¶ | https://api.python.langchain.com/en/latest/llms/langchain_community.llms.gradient_ai.TrainResult.html |
82df57cdc750-0 | langchain_community.llms.anyscale.Anyscale¶
class langchain_community.llms.anyscale.Anyscale[source]¶
Bases: BaseOpenAI
Anyscale large language models.
To use, you should have the environment variable ANYSCALE_API_BASE and
``ANYSCALE_API_KEY``set with your Anyscale Endpoint, or pass it as a named
parameter to the const... | https://api.python.langchain.com/en/latest/llms/langchain_community.llms.anyscale.Anyscale.html |
82df57cdc750-1 | Adjust the probability of specific tokens being generated.
param max_retries: int = 2¶
Maximum number of retries to make when generating.
param max_tokens: int = 256¶
The maximum number of tokens to generate in the completion.
-1 returns as many tokens as possible given the prompt and
the models maximal context size.
p... | https://api.python.langchain.com/en/latest/llms/langchain_community.llms.anyscale.Anyscale.html |
82df57cdc750-2 | 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 tokens in documents to constrain
them... | https://api.python.langchain.com/en/latest/llms/langchain_community.llms.anyscale.Anyscale.html |
82df57cdc750-3 | The default implementation of batch works well for IO bound runnables.
Subclasses should override this method if they can batch more efficiently;
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[BaseCall... | https://api.python.langchain.com/en/latest/llms/langchain_community.llms.anyscale.Anyscale.html |
82df57cdc750-4 | stop – Stop words to use when generating. Model output is cut off at the
first occurrence of any of these substrings.
callbacks – Callbacks to pass through. Used for executing additional
functionality, such as logging or streaming, throughout generation.
**kwargs – Arbitrary additional keyword arguments. These are usua... | https://api.python.langchain.com/en/latest/llms/langchain_community.llms.anyscale.Anyscale.html |
82df57cdc750-5 | 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.anyscale.Anyscale.html |
82df57cdc750-6 | 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.anyscale.Anyscale.html |
82df57cdc750-7 | 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.anyscale.Anyscale.html |
82df57cdc750-8 | deep – set to True to make a deep copy of the model
Returns
new model instance
create_llm_result(choices: Any, prompts: List[str], params: Dict[str, Any], token_usage: Dict[str, int], *, system_fingerprint: Optional[str] = None) → LLMResult¶
Create the LLMResult from the choices and prompts.
dict(**kwargs: Any) → Dict¶... | https://api.python.langchain.com/en/latest/llms/langchain_community.llms.anyscale.Anyscale.html |
82df57cdc750-9 | 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.anyscale.Anyscale.html |
82df57cdc750-10 | 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 to the runnable.
Runnables that leverage the configurable_fields and c... | https://api.python.langchain.com/en/latest/llms/langchain_community.llms.anyscale.Anyscale.html |
82df57cdc750-11 | classmethod is_lc_serializable() → bool[source]¶
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, excl... | https://api.python.langchain.com/en/latest/llms/langchain_community.llms.anyscale.Anyscale.html |
82df57cdc750-12 | 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.anyscale.Anyscale.html |
82df57cdc750-13 | 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.anyscale.Anyscale.html |
82df57cdc750-14 | 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.anyscale.Anyscale.html |
82df57cdc750-15 | 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.anyscale.Anyscale.html |
ec47bc7004f0-0 | langchain_community.llms.promptlayer_openai.PromptLayerOpenAIChat¶
class langchain_community.llms.promptlayer_openai.PromptLayerOpenAIChat[source]¶
Bases: OpenAIChat
Wrapper around OpenAI large language models.
To use, you should have the openai and promptlayer python
package installed, and the environment variable OPE... | https://api.python.langchain.com/en/latest/llms/langchain_community.llms.promptlayer_openai.PromptLayerOpenAIChat.html |
ec47bc7004f0-1 | param model_kwargs: Dict[str, Any] [Optional]¶
Holds any model parameters valid for create call not explicitly specified.
param model_name: str = 'gpt-3.5-turbo'¶
Model name to use.
param openai_api_base: Optional[str] = None (alias 'base_url')¶
Base URL path for API requests, leave blank if not using a proxy or servic... | https://api.python.langchain.com/en/latest/llms/langchain_community.llms.promptlayer_openai.PromptLayerOpenAIChat.html |
ec47bc7004f0-2 | Default implementation runs ainvoke in parallel using asyncio.gather.
The default implementation of batch works well for IO bound runnables.
Subclasses should override this method if they can batch more efficiently;
e.g., if the underlying runnable uses an API which supports a batch mode.
async agenerate(prompts: List[... | https://api.python.langchain.com/en/latest/llms/langchain_community.llms.promptlayer_openai.PromptLayerOpenAIChat.html |
ec47bc7004f0-3 | 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/llms/langchain_community.llms.promptlayer_openai.PromptLayerOpenAIChat.html |
ec47bc7004f0-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/llms/langchain_community.llms.promptlayer_openai.PromptLayerOpenAIChat.html |
ec47bc7004f0-5 | The jsonpatch ops can be applied in order to construct state.
Parameters
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 incl... | https://api.python.langchain.com/en/latest/llms/langchain_community.llms.promptlayer_openai.PromptLayerOpenAIChat.html |
ec47bc7004f0-6 | 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_alternatives(which: ConfigurableField, *, default_key: str = 'default', prefix_keys: bool = False, **kwargs: Union[Runnable[Input, Outp... | https://api.python.langchain.com/en/latest/llms/langchain_community.llms.promptlayer_openai.PromptLayerOpenAIChat.html |
ec47bc7004f0-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.promptlayer_openai.PromptLayerOpenAIChat.html |
ec47bc7004f0-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.promptlayer_openai.PromptLayerOpenAIChat.html |
ec47bc7004f0-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.promptlayer_openai.PromptLayerOpenAIChat.html |
ec47bc7004f0-10 | Generate a JSON representation of the model, include and exclude arguments as per dict().
encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().
classmethod lc_id() → List[str]¶
A unique identifier for this class for serialization purposes.
The unique identifier is a ... | https://api.python.langchain.com/en/latest/llms/langchain_community.llms.promptlayer_openai.PromptLayerOpenAIChat.html |
ec47bc7004f0-11 | Pass a message sequence to the model and return a message prediction.
Use this method when passing in chat messages. If you want to pass in raw text,use predict.
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 ... | https://api.python.langchain.com/en/latest/llms/langchain_community.llms.promptlayer_openai.PromptLayerOpenAIChat.html |
ec47bc7004f0-12 | input is still being generated.
classmethod update_forward_refs(**localns: Any) → None¶
Try to update ForwardRefs on fields based on this Model, globalns and localns.
classmethod validate(value: Any) → Model¶
with_config(config: Optional[RunnableConfig] = None, **kwargs: Any) → Runnable[Input, Output]¶
Bind config to a... | https://api.python.langchain.com/en/latest/llms/langchain_community.llms.promptlayer_openai.PromptLayerOpenAIChat.html |
ec47bc7004f0-13 | added to the run.
with_retry(*, retry_if_exception_type: ~typing.Tuple[~typing.Type[BaseException], ...] = (<class 'Exception'>,), wait_exponential_jitter: bool = True, stop_after_attempt: int = 3) → Runnable[Input, Output]¶
Create a new Runnable that retries the original runnable on exceptions.
Parameters
retry_if_exc... | https://api.python.langchain.com/en/latest/llms/langchain_community.llms.promptlayer_openai.PromptLayerOpenAIChat.html |
06d9e519467e-0 | langchain_community.llms.titan_takeoff_pro.TitanTakeoffPro¶
class langchain_community.llms.titan_takeoff_pro.TitanTakeoffPro[source]¶
Bases: LLM
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 base_url... | https://api.python.langchain.com/en/latest/llms/langchain_community.llms.titan_takeoff_pro.TitanTakeoffPro.html |
06d9e519467e-1 | param tags: Optional[List[str]] = None¶
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, metada... | https://api.python.langchain.com/en/latest/llms/langchain_community.llms.titan_takeoff_pro.TitanTakeoffPro.html |
06d9e519467e-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.titan_takeoff_pro.TitanTakeoffPro.html |
06d9e519467e-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.titan_takeoff_pro.TitanTakeoffPro.html |
06d9e519467e-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.titan_takeoff_pro.TitanTakeoffPro.html |
06d9e519467e-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.titan_takeoff_pro.TitanTakeoffPro.html |
06d9e519467e-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.titan_takeoff_pro.TitanTakeoffPro.html |
06d9e519467e-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.titan_takeoff_pro.TitanTakeoffPro.html |
06d9e519467e-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.titan_takeoff_pro.TitanTakeoffPro.html |
06d9e519467e-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.titan_takeoff_pro.TitanTakeoffPro.html |
06d9e519467e-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.titan_takeoff_pro.TitanTakeoffPro.html |
06d9e519467e-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.titan_takeoff_pro.TitanTakeoffPro.html |
06d9e519467e-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.titan_takeoff_pro.TitanTakeoffPro.html |
06d9e519467e-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.titan_takeoff_pro.TitanTakeoffPro.html |
9453b84f59a8-0 | langchain_community.llms.azureml_endpoint.HFContentFormatter¶
class langchain_community.llms.azureml_endpoint.HFContentFormatter[source]¶
Content handler for LLMs from the HuggingFace catalog.
Attributes
accepts
The MIME type of the response data returned from the endpoint
content_type
The MIME type of the input data p... | https://api.python.langchain.com/en/latest/llms/langchain_community.llms.azureml_endpoint.HFContentFormatter.html |
9dee6706839c-0 | langchain_experimental.llms.llamaapi.ChatLlamaAPI¶
class langchain_experimental.llms.llamaapi.ChatLlamaAPI[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 valid model.
param cache: Optional[... | https://api.python.langchain.com/en/latest/llms/langchain_experimental.llms.llamaapi.ChatLlamaAPI.html |
9dee6706839c-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... | https://api.python.langchain.com/en/latest/llms/langchain_experimental.llms.llamaapi.ChatLlamaAPI.html |
9dee6706839c-2 | async ainvoke(input: LanguageModelInput, 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 implement a native async ... | https://api.python.langchain.com/en/latest/llms/langchain_experimental.llms.llamaapi.ChatLlamaAPI.html |
9dee6706839c-3 | to the model provider API call.
Returns
Top model prediction as a message.
async astream(input: LanguageModelInput, config: Optional[RunnableConfig] = None, *, stop: Optional[List[str]] = None, **kwargs: Any) → AsyncIterator[BaseMessageChunk]¶
Default implementation of astream, which calls ainvoke.
Subclasses should ov... | https://api.python.langchain.com/en/latest/llms/langchain_experimental.llms.llamaapi.ChatLlamaAPI.html |
9dee6706839c-4 | exclude_names – Exclude logs with these names.
exclude_types – Exclude logs with these types.
exclude_tags – Exclude logs with these tags.
async atransform(input: AsyncIterator[Input], config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) → AsyncIterator[Output]¶
Default implementation of atransform, which ... | https://api.python.langchain.com/en/latest/llms/langchain_experimental.llms.llamaapi.ChatLlamaAPI.html |
9dee6706839c-5 | 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_experimental.llms.llamaapi.ChatLlamaAPI.html |
9dee6706839c-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... | https://api.python.langchain.com/en/latest/llms/langchain_experimental.llms.llamaapi.ChatLlamaAPI.html |
9dee6706839c-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... | https://api.python.langchain.com/en/latest/llms/langchain_experimental.llms.llamaapi.ChatLlamaAPI.html |
9dee6706839c-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: LanguageModelIn... | https://api.python.langchain.com/en/latest/llms/langchain_experimental.llms.llamaapi.ChatLlamaAPI.html |
9dee6706839c-9 | 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 each input.
classmethod parse_file... | https://api.python.langchain.com/en/latest/llms/langchain_experimental.llms.llamaapi.ChatLlamaAPI.html |
9dee6706839c-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... | https://api.python.langchain.com/en/latest/llms/langchain_experimental.llms.llamaapi.ChatLlamaAPI.html |
9dee6706839c-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... | https://api.python.langchain.com/en/latest/llms/langchain_experimental.llms.llamaapi.ChatLlamaAPI.html |
9dee6706839c-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... | https://api.python.langchain.com/en/latest/llms/langchain_experimental.llms.llamaapi.ChatLlamaAPI.html |
377ecd2b77a2-0 | langchain_community.llms.aviary.AviaryBackend¶
class langchain_community.llms.aviary.AviaryBackend(backend_url: str, bearer: str)[source]¶
Aviary backend.
backend_url¶
The URL for the Aviary backend.
Type
str
bearer¶
The bearer token for the Aviary backend.
Type
str
Attributes
backend_url
bearer
Methods
__init__(backen... | https://api.python.langchain.com/en/latest/llms/langchain_community.llms.aviary.AviaryBackend.html |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.