AnalyzeLROPoller Class
Custom LROPoller for Content Understanding analyze operations.
Provides access to the operation ID for tracking and diagnostics.
Constructor
AnalyzeLROPoller(client: Any, initial_response: Any, deserialization_callback: Callable[[Any], PollingReturnType_co], polling_method: PollingMethod[PollingReturnType_co])
Parameters
| Name | Description |
|---|---|
|
client
Required
|
|
|
initial_response
Required
|
|
|
deserialization_callback
Required
|
|
|
polling_method
Required
|
|
Methods
| add_done_callback |
Add callback function to be run once the long running operation has completed - regardless of the status of the operation. |
| continuation_token |
Return a continuation token that allows to restart the poller later. |
| done |
Check status of the long running operation. |
| from_continuation_token |
Create a poller from a continuation token. |
| from_poller |
Wrap an existing LROPoller without re-initializing the polling method. This avoids duplicate HTTP requests that would occur if we created a new LROPoller instance (which calls polling_method.initialize() again). |
| polling_method |
Return the polling method associated to this poller. |
| remove_done_callback |
Remove a callback from the long running operation. |
| result |
Return the result of the long running operation, or the result available after the specified timeout. |
| status |
Returns the current status string. |
| wait |
Wait on the long running operation for a specified length of time. You can check if this call as ended with timeout with the "done()" method. |
add_done_callback
Add callback function to be run once the long running operation has completed - regardless of the status of the operation.
add_done_callback(func: Callable) -> None
Parameters
| Name | Description |
|---|---|
|
func
Required
|
Callback function that takes at least one argument, a completed LongRunningOperation. |
continuation_token
Return a continuation token that allows to restart the poller later.
continuation_token() -> str
Returns
| Type | Description |
|---|---|
|
An opaque continuation token |
done
Check status of the long running operation.
done() -> bool
Returns
| Type | Description |
|---|---|
|
'True' if the process has completed, else 'False'. |
from_continuation_token
Create a poller from a continuation token.
from_continuation_token(polling_method: PollingMethod[PollingReturnType_co], continuation_token: str, **kwargs: Any) -> AnalyzeLROPoller
Parameters
| Name | Description |
|---|---|
|
polling_method
Required
|
The polling strategy to adopt |
|
continuation_token
Required
|
An opaque continuation token |
Returns
| Type | Description |
|---|---|
|
An instance of AnalyzeLROPoller |
Exceptions
| Type | Description |
|---|---|
|
If the continuation token is invalid. |
from_poller
Wrap an existing LROPoller without re-initializing the polling method.
This avoids duplicate HTTP requests that would occur if we created a new LROPoller instance (which calls polling_method.initialize() again).
from_poller(poller: LROPoller[PollingReturnType_co]) -> AnalyzeLROPoller[PollingReturnType_co]
Parameters
| Name | Description |
|---|---|
|
poller
Required
|
The existing LROPoller to wrap |
Returns
| Type | Description |
|---|---|
|
An AnalyzeLROPoller wrapping the same polling state |
polling_method
Return the polling method associated to this poller.
polling_method() -> PollingMethod[PollingReturnType_co]
Returns
| Type | Description |
|---|---|
|
The polling method |
remove_done_callback
Remove a callback from the long running operation.
remove_done_callback(func: Callable) -> None
Parameters
| Name | Description |
|---|---|
|
func
Required
|
The function to be removed from the callbacks. |
Exceptions
| Type | Description |
|---|---|
|
if the long running operation has already completed. |
result
Return the result of the long running operation, or the result available after the specified timeout.
result(timeout: float | None = None) -> PollingReturnType_co
Parameters
| Name | Description |
|---|---|
|
timeout
|
Period of time to wait before getting back control. Default value: None
|
Returns
| Type | Description |
|---|---|
|
any,
|
The deserialized resource of the long running operation, if one is available. |
Exceptions
| Type | Description |
|---|---|
|
Server problem with the query. |
status
Returns the current status string.
status() -> str
Returns
| Type | Description |
|---|---|
|
The current status string |
wait
Wait on the long running operation for a specified length of time. You can check if this call as ended with timeout with the "done()" method.
wait(timeout: float | None = None) -> None
Parameters
| Name | Description |
|---|---|
|
timeout
|
Period of time to wait for the long running operation to complete (in seconds). Default value: None
|
Exceptions
| Type | Description |
|---|---|
|
Server problem with the query. |
Attributes
operation_id
Returns the operation ID for this long-running operation.
The operation ID can be used with get_result_file() to retrieve intermediate or final result files from the service.
Returns
| Type | Description |
|---|---|
|
The operation ID |
Exceptions
| Type | Description |
|---|---|
|
If the operation ID cannot be extracted |
usage
Returns the usage details from the completed analyze operation.
This property is available after the operation has completed successfully. It provides information about the resources consumed during analysis, including document pages, contextualization tokens, and LLM token breakdown.
Returns
| Type | Description |
|---|---|
|
The usage details, or None if the operation is not yet complete or usage information is not available. |