OpenAILLMConfiguration#

class council.llm.OpenAILLMConfiguration(api_key: str, model: str, timeout: int = 30)[source]#

Bases: LLMConfigurationBase

Configuration for :class:OpenAILLM

Notes

__init__(api_key: str, model: str, timeout: int = 30)[source]#

Initialize a new instance of OpenAILLMConfiguration :param api_key: the OpenAI api key :type api_key: str :param model: model version to use :type model: str :param timeout: seconds to wait for response from OpenAI before timing out :type timeout: int

property api_key: Parameter[str]#

OpenAI API Key

property frequency_penalty: Parameter[float]#

Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model’s likelihood to repeat the same line verbatim. Number between -2.0 and 2.0 See: https://platform.openai.com/docs/api-reference/completions/create#completions-create-frequency_penalty

property max_tokens: Parameter[int]#

Limit on number of tokens See: https://platform.openai.com/docs/api-reference/completions/create#completions-create-max_tokens

property model: Parameter[str]#

OpenAI model

property n: Parameter[int]#

How many completions to generate for each prompt. See: https://platform.openai.com/docs/api-reference/completions/create#completions-create-n

property presence_penalty: Parameter[float]#

Positive values penalize new tokens based on whether they appear in the text so far, increasing the model’s likelihood to talk about new topics. Number between -2.0 and 2.0 See: https://platform.openai.com/docs/api-reference/completions/create#completions-create-presence_penalty

property temperature: Parameter[float]#

temperature settings for the LLM. Ranges from 0.0 to 2.0. See: https://platform.openai.com/docs/api-reference/completions/create#completions-create-temperature

property timeout: Parameter[int]#

API timeout

property top_p: Parameter[float]#

The model only takes into account the tokens with the highest probability mass. See: https://platform.openai.com/docs/api-reference/completions/create#completions-create-top_p