chore: import upstream snapshot with attribution
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled

This commit is contained in:
wehub-resource-sync
2026-07-13 13:21:23 +08:00
commit b957a53def
5423 changed files with 863745 additions and 0 deletions
@@ -0,0 +1,31 @@
# Copyright (c) Microsoft. All rights reserved.
from datetime import timedelta
from pydantic import Field
from semantic_kernel.kernel_pydantic import KernelBaseModel
from semantic_kernel.utils.feature_stage_decorator import experimental
@experimental
class RunPollingOptions(KernelBaseModel):
"""Configuration and defaults associated with polling behavior for Assistant API requests."""
default_polling_interval: timedelta = Field(default=timedelta(milliseconds=250))
default_polling_backoff: timedelta = Field(default=timedelta(seconds=1))
default_polling_backoff_threshold: int = Field(default=2)
default_message_synchronization_delay: timedelta = Field(default=timedelta(milliseconds=250))
run_polling_interval: timedelta = Field(default=timedelta(milliseconds=250))
run_polling_backoff: timedelta = Field(default=timedelta(seconds=1))
run_polling_backoff_threshold: int = Field(default=2)
message_synchronization_delay: timedelta = Field(default=timedelta(milliseconds=250))
run_polling_timeout: timedelta = Field(default=timedelta(minutes=1)) # New timeout attribute
def get_polling_interval(self, iteration_count: int) -> timedelta:
"""Get the polling interval for the given iteration count."""
return (
self.run_polling_backoff
if iteration_count > self.run_polling_backoff_threshold
else self.run_polling_interval
)