eg. [“langchain”, “llms”, “openai”]
property lc_secrets: Dict[str, str]#
Return a map of constructor argument names to secret ids.
eg. {“openai_api_key”: “OPENAI_API_KEY”}
property lc_serializable: bool#
Return whether or not the class is serializable.
pydantic model langchain.llms.PredictionGuard[source]#
Wrapper around Prediction Guard large language models.
To use, you should have the predictionguard python package installed, and the
environment variable PREDICTIONGUARD_TOKEN set with your access token, or pass
it as a named parameter to the constructor. To use Prediction Guard’s API along
with OpenAI models, set the environment variable OPENAI_API_KEY with your
OpenAI API key as well.
Example
pgllm = PredictionGuard(model="MPT-7B-Instruct",
                        token="my-access-token",
                        output={
                            "type": "boolean"
                        })
Validators
raise_deprecation » all fields
set_verbose » verbose
validate_environment » all fields
field max_tokens: int = 256#
Denotes the number of tokens to predict per generation.
field model: Optional[str] = 'MPT-7B-Instruct'#
Model name to use.
field output: Optional[Dict[str, Any]] = None#
The output type or structure for controlling the LLM output.
field tags: Optional[List[str]] = None#
Tags to add to the run trace.
field temperature: float = 0.75#
A non-negative float that tunes the degree of randomness in generation.
field token: Optional[str] = None#
Your Prediction Guard access token.
field verbose: bool [Optional]#
Whether to print out response text.
rtdocs_stable/api.python.langchain.com/en/stable/reference/modules/llms.html