RunPollingOptions Class
Configuration and defaults associated with polling behavior for Assistant API requests. Note: This class is experimental and may change in the future. Create a new model by parsing and validating input data from keyword arguments. Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. self is explicitly positional-only to allow self as a field name.
Constructor
RunPollingOptions(*, default_polling_interval: timedelta = datetime.timedelta(microseconds=250000), default_polling_backoff: timedelta = datetime.timedelta(seconds=1), default_polling_backoff_threshold: int = 2, default_message_synchronization_delay: timedelta = datetime.timedelta(microseconds=250000), run_polling_interval: timedelta = datetime.timedelta(microseconds=250000), run_polling_backoff: timedelta = datetime.timedelta(seconds=1), run_polling_backoff_threshold: int = 2, message_synchronization_delay: timedelta = datetime.timedelta(microseconds=250000))
Keyword-Only Parameters
| Name | Description |
|---|---|
|
default_polling_interval
|
Default value: 0:00:00.250000
|
|
default_polling_backoff
|
Default value: 0:00:01
|
|
default_polling_backoff_threshold
|
Default value: 2
|
|
default_message_synchronization_delay
|
Default value: 0:00:00.250000
|
|
run_polling_interval
|
Default value: 0:00:00.250000
|
|
run_polling_backoff
|
Default value: 0:00:01
|
|
run_polling_backoff_threshold
|
Default value: 2
|
|
message_synchronization_delay
|
Default value: 0:00:00.250000
|
Methods
| get_polling_interval |
Get the polling interval for the given iteration count. |
get_polling_interval
Get the polling interval for the given iteration count.
get_polling_interval(iteration_count: int) -> timedelta
Parameters
| Name | Description |
|---|---|
|
iteration_count
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]] = {'default_message_synchronization_delay': FieldInfo(annotation=timedelta, required=False, default=datetime.timedelta(microseconds=250000)), 'default_polling_backoff': FieldInfo(annotation=timedelta, required=False, default=datetime.timedelta(seconds=1)), 'default_polling_backoff_threshold': FieldInfo(annotation=int, required=False, default=2), 'default_polling_interval': FieldInfo(annotation=timedelta, required=False, default=datetime.timedelta(microseconds=250000)), 'message_synchronization_delay': FieldInfo(annotation=timedelta, required=False, default=datetime.timedelta(microseconds=250000)), 'run_polling_backoff': FieldInfo(annotation=timedelta, required=False, default=datetime.timedelta(seconds=1)), 'run_polling_backoff_threshold': FieldInfo(annotation=int, required=False, default=2), 'run_polling_interval': FieldInfo(annotation=timedelta, required=False, default=datetime.timedelta(microseconds=250000))}
default_message_synchronization_delay
default_message_synchronization_delay: timedelta
default_polling_backoff
default_polling_backoff: timedelta
default_polling_backoff_threshold
default_polling_backoff_threshold: int
default_polling_interval
default_polling_interval: timedelta
is_experimental
is_experimental = True
message_synchronization_delay
message_synchronization_delay: timedelta
run_polling_backoff
run_polling_backoff: timedelta
run_polling_backoff_threshold
run_polling_backoff_threshold: int
run_polling_interval
run_polling_interval: timedelta