Share via


OpenAITextPromptExecutionSettings Class

Specific settings for the completions endpoint.

Initialize the prompt execution settings.

Constructor

OpenAITextPromptExecutionSettings(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, store: bool | None = None, metadata: dict[str, str] | None = None, prompt: str | None = None, best_of: Annotated[int | None, Ge(ge=1)] = None, echo: bool = False, logprobs: Annotated[int | None, Ge(ge=0), Le(le=5)] = None, suffix: 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
store
Required
metadata
Required
prompt
Required
best_of
Required
echo
Required
logprobs
Required
suffix
Required

Methods

check_best_of_and_n

Check that the best_of parameter is not greater than the number_of_responses parameter.

check_best_of_and_n

Check that the best_of parameter is not greater than the number_of_responses parameter.

check_best_of_and_n() -> OpenAITextPromptExecutionSettings

Attributes

best_of

best_of: Annotated[int | None, FieldInfo(annotation=NoneType, required=True, metadata=[Ge(ge=1)])]

echo

echo: bool

logprobs

logprobs: Annotated[int | None, FieldInfo(annotation=NoneType, required=True, metadata=[Ge(ge=0), Le(le=5)])]

prompt

prompt: Annotated[str | None, FieldInfo(annotation=NoneType, required=True, description='Do not set this manually. It is set by the service based on the text content.')]

suffix

suffix: str | None