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 contains a list of candidate Generations for each inputprompt and additional model provider-specific output.
get_astream(inputs: Sequence[Dict], labels: Optional[dict] = None, stop: Optional[Sequence[str]] = None, **kwargs: Any) → AsyncIterator¶
Call to client astream methods with call scope
get_generation(inputs: Sequence[Dict], labels: Optional[dict] = None, stop: Optional[Sequence[str]] = None, **kwargs: Any) → dict¶
Call to client generate method with call scope
get_input_schema(config: Optional[RunnableConfig] = None) → Type[BaseModel]¶
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 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 langchain.llms.openai.OpenAI, then the
namespace is [“langchain”, “llms”, “openai”]
get_model_details(model: Optional[str] = None) → dict¶
Get more meta-details about a model retrieved by a given name
get_num_tokens(text: str) → int¶
Get the number of tokens present in the text.