OpenAIPromptExecutionSettings Class

Common request settings for (Azure) OpenAI services.

Initialize the prompt execution settings.

Inheritance
OpenAIPromptExecutionSettings

Constructor

OpenAIPromptExecutionSettings(service_id: str | None = None, *, extension_data: dict[str, Any] = None, function_choice_behavior: FunctionChoiceBehavior | None = None, ai_model_id: str | None = None, frequency_penalty: Annotated[float | None, Ge(ge=-2.0), Le(le=2.0)] = None, logit_bias: dict[str | int, float] | None = None, max_tokens: Annotated[int | None, Gt(gt=0)] = None, number_of_responses: Annotated[int | None, Ge(ge=1), Le(le=128)] = None, presence_penalty: Annotated[float | None, Ge(ge=-2.0), Le(le=2.0)] = None, seed: int | None = None, stop: str | list[str] | None = None, stream: bool = False, temperature: Annotated[float | None, Ge(ge=0.0), Le(le=2.0)] = None, top_p: Annotated[float | None, Ge(ge=0.0), Le(le=1.0)] = None, user: str | None = None)

Parameters

Name Description
service_id
str

The service ID to use for the request.

Default value: None
kwargs
Required
Any

Additional keyword arguments, these are attempted to parse into the keys of the specific prompt execution settings.

Keyword-Only Parameters

Name Description
extension_data
Required
function_choice_behavior
Required
ai_model_id
Required
frequency_penalty
Required
logit_bias
Required
max_tokens
Required
number_of_responses
Required
presence_penalty
Required
seed
Required
stop
Required
stream
Required
temperature
Required
top_p
Required
user
Required

Attributes

model_computed_fields

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}

model_config

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'populate_by_name': True, 'validate_assignment': True}

model_fields

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.

This replaces Model.fields from Pydantic V1.

model_fields: ClassVar[Dict[str, FieldInfo]] = {'ai_model_id': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, alias_priority=2, serialization_alias='model'), 'extension_data': FieldInfo(annotation=dict[str, Any], required=False, default_factory=dict), 'frequency_penalty': FieldInfo(annotation=Union[float, NoneType], required=False, default=None, metadata=[Ge(ge=-2.0), Le(le=2.0)]), 'function_choice_behavior': FieldInfo(annotation=Union[FunctionChoiceBehavior, NoneType], required=False, default=None, exclude=True), 'logit_bias': FieldInfo(annotation=Union[dict[Union[str, int], float], NoneType], required=False, default=None), 'max_tokens': FieldInfo(annotation=Union[int, NoneType], required=False, default=None, metadata=[Gt(gt=0)]), 'number_of_responses': FieldInfo(annotation=Union[int, NoneType], required=False, default=None, alias_priority=2, serialization_alias='n', metadata=[Ge(ge=1), Le(le=128)]), 'presence_penalty': FieldInfo(annotation=Union[float, NoneType], required=False, default=None, metadata=[Ge(ge=-2.0), Le(le=2.0)]), 'seed': FieldInfo(annotation=Union[int, NoneType], required=False, default=None), 'service_id': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, metadata=[MinLen(min_length=1)]), 'stop': FieldInfo(annotation=Union[str, list[str], NoneType], required=False, default=None), 'stream': FieldInfo(annotation=bool, required=False, default=False), 'temperature': FieldInfo(annotation=Union[float, NoneType], required=False, default=None, metadata=[Ge(ge=0.0), Le(le=2.0)]), 'top_p': FieldInfo(annotation=Union[float, NoneType], required=False, default=None, metadata=[Ge(ge=0.0), Le(le=1.0)]), 'user': FieldInfo(annotation=Union[str, NoneType], required=False, default=None)}

ai_model_id

ai_model_id: str | None

frequency_penalty

frequency_penalty: float | None

logit_bias

logit_bias: dict[str | int, float] | None

max_tokens

max_tokens: int | None

number_of_responses

number_of_responses: int | None

presence_penalty

presence_penalty: float | None

seed

seed: int | None

stop

stop: str | list[str] | None

stream

stream: bool

temperature

temperature: float | None

top_p

top_p: float | None

user

user: str | None