mirascope 2.0.0a6__py3-none-any.whl → 2.0.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mirascope/_utils.py +34 -0
- mirascope/api/_generated/__init__.py +186 -5
- mirascope/api/_generated/annotations/client.py +38 -6
- mirascope/api/_generated/annotations/raw_client.py +366 -47
- mirascope/api/_generated/annotations/types/annotations_create_response.py +19 -6
- mirascope/api/_generated/annotations/types/annotations_get_response.py +19 -6
- mirascope/api/_generated/annotations/types/annotations_list_response_annotations_item.py +22 -7
- mirascope/api/_generated/annotations/types/annotations_update_response.py +19 -6
- mirascope/api/_generated/api_keys/__init__.py +12 -2
- mirascope/api/_generated/api_keys/client.py +107 -6
- mirascope/api/_generated/api_keys/raw_client.py +486 -38
- mirascope/api/_generated/api_keys/types/__init__.py +7 -1
- mirascope/api/_generated/api_keys/types/api_keys_list_all_for_org_response_item.py +40 -0
- mirascope/api/_generated/client.py +36 -0
- mirascope/api/_generated/docs/raw_client.py +71 -9
- mirascope/api/_generated/environment.py +3 -3
- mirascope/api/_generated/environments/__init__.py +6 -0
- mirascope/api/_generated/environments/client.py +158 -9
- mirascope/api/_generated/environments/raw_client.py +620 -52
- mirascope/api/_generated/environments/types/__init__.py +10 -0
- mirascope/api/_generated/environments/types/environments_get_analytics_response.py +60 -0
- mirascope/api/_generated/environments/types/environments_get_analytics_response_top_functions_item.py +24 -0
- mirascope/api/_generated/{organizations/types/organizations_credits_response.py → environments/types/environments_get_analytics_response_top_models_item.py} +6 -3
- mirascope/api/_generated/errors/__init__.py +6 -0
- mirascope/api/_generated/errors/bad_request_error.py +5 -2
- mirascope/api/_generated/errors/conflict_error.py +5 -2
- mirascope/api/_generated/errors/payment_required_error.py +15 -0
- mirascope/api/_generated/errors/service_unavailable_error.py +14 -0
- mirascope/api/_generated/errors/too_many_requests_error.py +15 -0
- mirascope/api/_generated/functions/__init__.py +10 -0
- mirascope/api/_generated/functions/client.py +222 -8
- mirascope/api/_generated/functions/raw_client.py +975 -134
- mirascope/api/_generated/functions/types/__init__.py +28 -4
- mirascope/api/_generated/functions/types/functions_get_by_env_response.py +53 -0
- mirascope/api/_generated/functions/types/functions_get_by_env_response_dependencies_value.py +22 -0
- mirascope/api/_generated/functions/types/functions_list_by_env_response.py +25 -0
- mirascope/api/_generated/functions/types/functions_list_by_env_response_functions_item.py +56 -0
- mirascope/api/_generated/functions/types/functions_list_by_env_response_functions_item_dependencies_value.py +22 -0
- mirascope/api/_generated/health/raw_client.py +74 -10
- mirascope/api/_generated/organization_invitations/__init__.py +33 -0
- mirascope/api/_generated/organization_invitations/client.py +546 -0
- mirascope/api/_generated/organization_invitations/raw_client.py +1519 -0
- mirascope/api/_generated/organization_invitations/types/__init__.py +53 -0
- mirascope/api/_generated/organization_invitations/types/organization_invitations_accept_response.py +34 -0
- mirascope/api/_generated/organization_invitations/types/organization_invitations_accept_response_role.py +7 -0
- mirascope/api/_generated/organization_invitations/types/organization_invitations_create_request_role.py +7 -0
- mirascope/api/_generated/organization_invitations/types/organization_invitations_create_response.py +48 -0
- mirascope/api/_generated/organization_invitations/types/organization_invitations_create_response_role.py +7 -0
- mirascope/api/_generated/organization_invitations/types/organization_invitations_create_response_status.py +7 -0
- mirascope/api/_generated/organization_invitations/types/organization_invitations_get_response.py +48 -0
- mirascope/api/_generated/organization_invitations/types/organization_invitations_get_response_role.py +7 -0
- mirascope/api/_generated/organization_invitations/types/organization_invitations_get_response_status.py +7 -0
- mirascope/api/_generated/organization_invitations/types/organization_invitations_list_response_item.py +48 -0
- mirascope/api/_generated/organization_invitations/types/organization_invitations_list_response_item_role.py +7 -0
- mirascope/api/_generated/organization_invitations/types/organization_invitations_list_response_item_status.py +7 -0
- mirascope/api/_generated/organization_memberships/__init__.py +19 -0
- mirascope/api/_generated/organization_memberships/client.py +302 -0
- mirascope/api/_generated/organization_memberships/raw_client.py +736 -0
- mirascope/api/_generated/organization_memberships/types/__init__.py +27 -0
- mirascope/api/_generated/organization_memberships/types/organization_memberships_list_response_item.py +33 -0
- mirascope/api/_generated/organization_memberships/types/organization_memberships_list_response_item_role.py +7 -0
- mirascope/api/_generated/organization_memberships/types/organization_memberships_update_request_role.py +7 -0
- mirascope/api/_generated/organization_memberships/types/organization_memberships_update_response.py +31 -0
- mirascope/api/_generated/organization_memberships/types/organization_memberships_update_response_role.py +7 -0
- mirascope/api/_generated/organizations/__init__.py +26 -2
- mirascope/api/_generated/organizations/client.py +442 -20
- mirascope/api/_generated/organizations/raw_client.py +1763 -164
- mirascope/api/_generated/organizations/types/__init__.py +48 -2
- mirascope/api/_generated/organizations/types/organizations_create_payment_intent_response.py +24 -0
- mirascope/api/_generated/organizations/types/organizations_preview_subscription_change_request_target_plan.py +7 -0
- mirascope/api/_generated/organizations/types/organizations_preview_subscription_change_response.py +47 -0
- mirascope/api/_generated/organizations/types/organizations_preview_subscription_change_response_validation_errors_item.py +33 -0
- mirascope/api/_generated/organizations/types/organizations_preview_subscription_change_response_validation_errors_item_resource.py +7 -0
- mirascope/api/_generated/organizations/types/organizations_router_balance_response.py +24 -0
- mirascope/api/_generated/organizations/types/organizations_subscription_response.py +53 -0
- mirascope/api/_generated/organizations/types/organizations_subscription_response_current_plan.py +7 -0
- mirascope/api/_generated/organizations/types/organizations_subscription_response_payment_method.py +26 -0
- mirascope/api/_generated/organizations/types/organizations_subscription_response_scheduled_change.py +34 -0
- mirascope/api/_generated/organizations/types/organizations_subscription_response_scheduled_change_target_plan.py +7 -0
- mirascope/api/_generated/organizations/types/organizations_update_subscription_request_target_plan.py +7 -0
- mirascope/api/_generated/organizations/types/organizations_update_subscription_response.py +35 -0
- mirascope/api/_generated/project_memberships/__init__.py +25 -0
- mirascope/api/_generated/project_memberships/client.py +437 -0
- mirascope/api/_generated/project_memberships/raw_client.py +1039 -0
- mirascope/api/_generated/project_memberships/types/__init__.py +29 -0
- mirascope/api/_generated/project_memberships/types/project_memberships_create_request_role.py +7 -0
- mirascope/api/_generated/project_memberships/types/project_memberships_create_response.py +35 -0
- mirascope/api/_generated/project_memberships/types/project_memberships_create_response_role.py +7 -0
- mirascope/api/_generated/project_memberships/types/project_memberships_list_response_item.py +33 -0
- mirascope/api/_generated/project_memberships/types/project_memberships_list_response_item_role.py +7 -0
- mirascope/api/_generated/project_memberships/types/project_memberships_update_request_role.py +7 -0
- mirascope/api/_generated/project_memberships/types/project_memberships_update_response.py +35 -0
- mirascope/api/_generated/project_memberships/types/project_memberships_update_response_role.py +7 -0
- mirascope/api/_generated/projects/raw_client.py +415 -58
- mirascope/api/_generated/reference.md +2767 -397
- mirascope/api/_generated/tags/__init__.py +19 -0
- mirascope/api/_generated/tags/client.py +504 -0
- mirascope/api/_generated/tags/raw_client.py +1288 -0
- mirascope/api/_generated/tags/types/__init__.py +17 -0
- mirascope/api/_generated/tags/types/tags_create_response.py +41 -0
- mirascope/api/_generated/tags/types/tags_get_response.py +41 -0
- mirascope/api/_generated/tags/types/tags_list_response.py +23 -0
- mirascope/api/_generated/tags/types/tags_list_response_tags_item.py +41 -0
- mirascope/api/_generated/tags/types/tags_update_response.py +41 -0
- mirascope/api/_generated/token_cost/__init__.py +7 -0
- mirascope/api/_generated/token_cost/client.py +160 -0
- mirascope/api/_generated/token_cost/raw_client.py +264 -0
- mirascope/api/_generated/token_cost/types/__init__.py +8 -0
- mirascope/api/_generated/token_cost/types/token_cost_calculate_request_usage.py +54 -0
- mirascope/api/_generated/token_cost/types/token_cost_calculate_response.py +52 -0
- mirascope/api/_generated/traces/__init__.py +20 -0
- mirascope/api/_generated/traces/client.py +543 -0
- mirascope/api/_generated/traces/raw_client.py +1366 -96
- mirascope/api/_generated/traces/types/__init__.py +28 -0
- mirascope/api/_generated/traces/types/traces_get_analytics_summary_response.py +6 -0
- mirascope/api/_generated/traces/types/traces_get_trace_detail_by_env_response.py +33 -0
- mirascope/api/_generated/traces/types/traces_get_trace_detail_by_env_response_spans_item.py +88 -0
- mirascope/api/_generated/traces/types/traces_get_trace_detail_response_spans_item.py +0 -2
- mirascope/api/_generated/traces/types/traces_list_by_function_hash_response.py +25 -0
- mirascope/api/_generated/traces/types/traces_list_by_function_hash_response_traces_item.py +44 -0
- mirascope/api/_generated/traces/types/traces_search_by_env_request_attribute_filters_item.py +26 -0
- mirascope/api/_generated/traces/types/traces_search_by_env_request_attribute_filters_item_operator.py +7 -0
- mirascope/api/_generated/traces/types/traces_search_by_env_request_sort_by.py +7 -0
- mirascope/api/_generated/traces/types/traces_search_by_env_request_sort_order.py +7 -0
- mirascope/api/_generated/traces/types/traces_search_by_env_response.py +26 -0
- mirascope/api/_generated/traces/types/traces_search_by_env_response_spans_item.py +50 -0
- mirascope/api/_generated/traces/types/traces_search_response_spans_item.py +10 -1
- mirascope/api/_generated/types/__init__.py +32 -2
- mirascope/api/_generated/types/bad_request_error_body.py +50 -0
- mirascope/api/_generated/types/date.py +3 -0
- mirascope/api/_generated/types/immutable_resource_error.py +22 -0
- mirascope/api/_generated/types/internal_server_error_body.py +3 -3
- mirascope/api/_generated/types/plan_limit_exceeded_error.py +32 -0
- mirascope/api/_generated/types/plan_limit_exceeded_error_tag.py +7 -0
- mirascope/api/_generated/types/pricing_unavailable_error.py +23 -0
- mirascope/api/_generated/types/rate_limit_error.py +31 -0
- mirascope/api/_generated/types/rate_limit_error_tag.py +5 -0
- mirascope/api/_generated/types/service_unavailable_error_body.py +24 -0
- mirascope/api/_generated/types/service_unavailable_error_tag.py +7 -0
- mirascope/api/_generated/types/subscription_past_due_error.py +31 -0
- mirascope/api/_generated/types/subscription_past_due_error_tag.py +7 -0
- mirascope/api/settings.py +19 -1
- mirascope/llm/__init__.py +53 -10
- mirascope/llm/calls/__init__.py +2 -1
- mirascope/llm/calls/calls.py +29 -20
- mirascope/llm/calls/decorator.py +21 -7
- mirascope/llm/content/tool_output.py +22 -5
- mirascope/llm/exceptions.py +284 -71
- mirascope/llm/formatting/__init__.py +17 -0
- mirascope/llm/formatting/format.py +112 -35
- mirascope/llm/formatting/output_parser.py +178 -0
- mirascope/llm/formatting/partial.py +80 -7
- mirascope/llm/formatting/primitives.py +192 -0
- mirascope/llm/formatting/types.py +20 -8
- mirascope/llm/messages/__init__.py +3 -0
- mirascope/llm/messages/_utils.py +34 -0
- mirascope/llm/models/__init__.py +5 -0
- mirascope/llm/models/models.py +137 -69
- mirascope/llm/{providers/base → models}/params.py +7 -57
- mirascope/llm/models/thinking_config.py +61 -0
- mirascope/llm/prompts/_utils.py +0 -32
- mirascope/llm/prompts/decorator.py +16 -5
- mirascope/llm/prompts/prompts.py +160 -92
- mirascope/llm/providers/__init__.py +1 -4
- mirascope/llm/providers/anthropic/_utils/__init__.py +2 -0
- mirascope/llm/providers/anthropic/_utils/beta_decode.py +18 -9
- mirascope/llm/providers/anthropic/_utils/beta_encode.py +62 -13
- mirascope/llm/providers/anthropic/_utils/decode.py +18 -9
- mirascope/llm/providers/anthropic/_utils/encode.py +26 -7
- mirascope/llm/providers/anthropic/_utils/errors.py +2 -2
- mirascope/llm/providers/anthropic/beta_provider.py +64 -18
- mirascope/llm/providers/anthropic/provider.py +91 -33
- mirascope/llm/providers/base/__init__.py +0 -4
- mirascope/llm/providers/base/_utils.py +55 -6
- mirascope/llm/providers/base/base_provider.py +116 -37
- mirascope/llm/providers/google/_utils/__init__.py +2 -0
- mirascope/llm/providers/google/_utils/decode.py +20 -7
- mirascope/llm/providers/google/_utils/encode.py +26 -7
- mirascope/llm/providers/google/_utils/errors.py +3 -2
- mirascope/llm/providers/google/provider.py +64 -18
- mirascope/llm/providers/mirascope/_utils.py +13 -17
- mirascope/llm/providers/mirascope/provider.py +49 -18
- mirascope/llm/providers/mlx/_utils.py +7 -2
- mirascope/llm/providers/mlx/encoding/base.py +5 -2
- mirascope/llm/providers/mlx/encoding/transformers.py +5 -2
- mirascope/llm/providers/mlx/mlx.py +23 -6
- mirascope/llm/providers/mlx/provider.py +42 -13
- mirascope/llm/providers/openai/_utils/errors.py +2 -2
- mirascope/llm/providers/openai/completions/_utils/encode.py +20 -16
- mirascope/llm/providers/openai/completions/base_provider.py +40 -11
- mirascope/llm/providers/openai/provider.py +40 -10
- mirascope/llm/providers/openai/responses/_utils/__init__.py +2 -0
- mirascope/llm/providers/openai/responses/_utils/decode.py +19 -6
- mirascope/llm/providers/openai/responses/_utils/encode.py +22 -10
- mirascope/llm/providers/openai/responses/provider.py +56 -18
- mirascope/llm/providers/provider_registry.py +93 -19
- mirascope/llm/responses/__init__.py +6 -1
- mirascope/llm/responses/_utils.py +102 -12
- mirascope/llm/responses/base_response.py +5 -2
- mirascope/llm/responses/base_stream_response.py +115 -25
- mirascope/llm/responses/response.py +2 -1
- mirascope/llm/responses/root_response.py +89 -17
- mirascope/llm/responses/stream_response.py +6 -9
- mirascope/llm/tools/decorator.py +9 -4
- mirascope/llm/tools/tool_schema.py +17 -6
- mirascope/llm/tools/toolkit.py +35 -27
- mirascope/llm/tools/tools.py +45 -20
- mirascope/ops/__init__.py +4 -0
- mirascope/ops/_internal/closure.py +4 -1
- mirascope/ops/_internal/configuration.py +82 -31
- mirascope/ops/_internal/exporters/exporters.py +55 -35
- mirascope/ops/_internal/exporters/utils.py +37 -0
- mirascope/ops/_internal/instrumentation/llm/common.py +530 -0
- mirascope/ops/_internal/instrumentation/llm/cost.py +190 -0
- mirascope/ops/_internal/instrumentation/llm/encode.py +1 -1
- mirascope/ops/_internal/instrumentation/llm/llm.py +116 -1242
- mirascope/ops/_internal/instrumentation/llm/model.py +1798 -0
- mirascope/ops/_internal/instrumentation/llm/response.py +521 -0
- mirascope/ops/_internal/instrumentation/llm/serialize.py +300 -0
- mirascope/ops/_internal/protocols.py +83 -1
- mirascope/ops/_internal/traced_calls.py +18 -0
- mirascope/ops/_internal/traced_functions.py +125 -10
- mirascope/ops/_internal/tracing.py +78 -1
- mirascope/ops/_internal/utils.py +60 -4
- mirascope/ops/_internal/versioned_functions.py +1 -1
- {mirascope-2.0.0a6.dist-info → mirascope-2.0.2.dist-info}/METADATA +12 -11
- mirascope-2.0.2.dist-info/RECORD +424 -0
- {mirascope-2.0.0a6.dist-info → mirascope-2.0.2.dist-info}/licenses/LICENSE +1 -1
- mirascope-2.0.0a6.dist-info/RECORD +0 -316
- {mirascope-2.0.0a6.dist-info → mirascope-2.0.2.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,521 @@
|
|
|
1
|
+
"""Mirascope-specific instrumentation for Response.resume methods."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from functools import wraps
|
|
6
|
+
from typing import TYPE_CHECKING, Any, cast, overload
|
|
7
|
+
|
|
8
|
+
from .....llm import (
|
|
9
|
+
AsyncContextResponse,
|
|
10
|
+
AsyncContextStreamResponse,
|
|
11
|
+
AsyncResponse,
|
|
12
|
+
AsyncStreamResponse,
|
|
13
|
+
Context,
|
|
14
|
+
ContextResponse,
|
|
15
|
+
ContextStreamResponse,
|
|
16
|
+
DepsT,
|
|
17
|
+
FormattableT,
|
|
18
|
+
Response,
|
|
19
|
+
StreamResponse,
|
|
20
|
+
UserContent,
|
|
21
|
+
)
|
|
22
|
+
from ...spans import Span as MirascopeSpan
|
|
23
|
+
from .serialize import attach_mirascope_response, attach_mirascope_response_async
|
|
24
|
+
|
|
25
|
+
if TYPE_CHECKING:
|
|
26
|
+
pass
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
# =============================================================================
|
|
30
|
+
# Original method references and wrapped state flags
|
|
31
|
+
# =============================================================================
|
|
32
|
+
|
|
33
|
+
_ORIGINAL_RESPONSE_RESUME = Response.resume
|
|
34
|
+
_RESPONSE_RESUME_WRAPPED = False
|
|
35
|
+
_ORIGINAL_ASYNC_RESPONSE_RESUME = AsyncResponse.resume
|
|
36
|
+
_ASYNC_RESPONSE_RESUME_WRAPPED = False
|
|
37
|
+
_ORIGINAL_CONTEXT_RESPONSE_RESUME = ContextResponse.resume
|
|
38
|
+
_CONTEXT_RESPONSE_RESUME_WRAPPED = False
|
|
39
|
+
_ORIGINAL_ASYNC_CONTEXT_RESPONSE_RESUME = AsyncContextResponse.resume
|
|
40
|
+
_ASYNC_CONTEXT_RESPONSE_RESUME_WRAPPED = False
|
|
41
|
+
_ORIGINAL_STREAM_RESPONSE_RESUME = StreamResponse.resume
|
|
42
|
+
_STREAM_RESPONSE_RESUME_WRAPPED = False
|
|
43
|
+
_ORIGINAL_ASYNC_STREAM_RESPONSE_RESUME = AsyncStreamResponse.resume
|
|
44
|
+
_ASYNC_STREAM_RESPONSE_RESUME_WRAPPED = False
|
|
45
|
+
_ORIGINAL_CONTEXT_STREAM_RESPONSE_RESUME = ContextStreamResponse.resume
|
|
46
|
+
_CONTEXT_STREAM_RESPONSE_RESUME_WRAPPED = False
|
|
47
|
+
_ORIGINAL_ASYNC_CONTEXT_STREAM_RESPONSE_RESUME = AsyncContextStreamResponse.resume
|
|
48
|
+
_ASYNC_CONTEXT_STREAM_RESPONSE_RESUME_WRAPPED = False
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
# =============================================================================
|
|
52
|
+
# Response.resume instrumentation
|
|
53
|
+
# =============================================================================
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
@overload
|
|
57
|
+
def _instrumented_response_resume(self: Response, content: UserContent) -> Response: ...
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
@overload
|
|
61
|
+
def _instrumented_response_resume(
|
|
62
|
+
self: Response[FormattableT], content: UserContent
|
|
63
|
+
) -> Response[FormattableT]: ...
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
@wraps(_ORIGINAL_RESPONSE_RESUME)
|
|
67
|
+
def _instrumented_response_resume(
|
|
68
|
+
self: Response | Response[FormattableT], content: UserContent
|
|
69
|
+
) -> Response | Response[FormattableT]:
|
|
70
|
+
"""Returns a Mirascope-traced result of `Response.resume`."""
|
|
71
|
+
with MirascopeSpan(f"Response.resume {self.model_id}") as span:
|
|
72
|
+
span.set(
|
|
73
|
+
**{
|
|
74
|
+
"mirascope.type": "response_resume",
|
|
75
|
+
"mirascope.response.model_id": self.model_id,
|
|
76
|
+
"mirascope.response.provider_id": self.provider_id,
|
|
77
|
+
}
|
|
78
|
+
)
|
|
79
|
+
result = cast(
|
|
80
|
+
"Response | Response[FormattableT]",
|
|
81
|
+
_ORIGINAL_RESPONSE_RESUME(cast(Any, self), content),
|
|
82
|
+
)
|
|
83
|
+
attach_mirascope_response(span, result)
|
|
84
|
+
return result
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
def wrap_response_resume() -> None:
|
|
88
|
+
"""Returns None. Replaces `Response.resume` with the instrumented wrapper."""
|
|
89
|
+
global _RESPONSE_RESUME_WRAPPED
|
|
90
|
+
if _RESPONSE_RESUME_WRAPPED:
|
|
91
|
+
return
|
|
92
|
+
Response.resume = _instrumented_response_resume
|
|
93
|
+
_RESPONSE_RESUME_WRAPPED = True
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
def unwrap_response_resume() -> None:
|
|
97
|
+
"""Returns None. Restores the original `Response.resume` implementation."""
|
|
98
|
+
global _RESPONSE_RESUME_WRAPPED
|
|
99
|
+
if not _RESPONSE_RESUME_WRAPPED:
|
|
100
|
+
return
|
|
101
|
+
Response.resume = _ORIGINAL_RESPONSE_RESUME
|
|
102
|
+
_RESPONSE_RESUME_WRAPPED = False
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
# =============================================================================
|
|
106
|
+
# AsyncResponse.resume instrumentation
|
|
107
|
+
# =============================================================================
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
@overload
|
|
111
|
+
async def _instrumented_async_response_resume(
|
|
112
|
+
self: AsyncResponse, content: UserContent
|
|
113
|
+
) -> AsyncResponse: ...
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
@overload
|
|
117
|
+
async def _instrumented_async_response_resume(
|
|
118
|
+
self: AsyncResponse[FormattableT], content: UserContent
|
|
119
|
+
) -> AsyncResponse[FormattableT]: ...
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
@wraps(_ORIGINAL_ASYNC_RESPONSE_RESUME)
|
|
123
|
+
async def _instrumented_async_response_resume(
|
|
124
|
+
self: AsyncResponse | AsyncResponse[FormattableT], content: UserContent
|
|
125
|
+
) -> AsyncResponse | AsyncResponse[FormattableT]:
|
|
126
|
+
"""Returns a Mirascope-traced result of `AsyncResponse.resume`."""
|
|
127
|
+
with MirascopeSpan(f"AsyncResponse.resume {self.model_id}") as span:
|
|
128
|
+
span.set(
|
|
129
|
+
**{
|
|
130
|
+
"mirascope.type": "response_resume",
|
|
131
|
+
"mirascope.response.model_id": self.model_id,
|
|
132
|
+
"mirascope.response.provider_id": self.provider_id,
|
|
133
|
+
}
|
|
134
|
+
)
|
|
135
|
+
result = cast(
|
|
136
|
+
"AsyncResponse | AsyncResponse[FormattableT]",
|
|
137
|
+
await _ORIGINAL_ASYNC_RESPONSE_RESUME(cast(Any, self), content),
|
|
138
|
+
)
|
|
139
|
+
await attach_mirascope_response_async(span, result)
|
|
140
|
+
return result
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
def wrap_async_response_resume() -> None:
|
|
144
|
+
"""Returns None. Replaces `AsyncResponse.resume` with the instrumented wrapper."""
|
|
145
|
+
global _ASYNC_RESPONSE_RESUME_WRAPPED
|
|
146
|
+
if _ASYNC_RESPONSE_RESUME_WRAPPED:
|
|
147
|
+
return
|
|
148
|
+
AsyncResponse.resume = _instrumented_async_response_resume
|
|
149
|
+
_ASYNC_RESPONSE_RESUME_WRAPPED = True
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
def unwrap_async_response_resume() -> None:
|
|
153
|
+
"""Returns None. Restores the original `AsyncResponse.resume` implementation."""
|
|
154
|
+
global _ASYNC_RESPONSE_RESUME_WRAPPED
|
|
155
|
+
if not _ASYNC_RESPONSE_RESUME_WRAPPED:
|
|
156
|
+
return
|
|
157
|
+
AsyncResponse.resume = _ORIGINAL_ASYNC_RESPONSE_RESUME
|
|
158
|
+
_ASYNC_RESPONSE_RESUME_WRAPPED = False
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
# =============================================================================
|
|
162
|
+
# ContextResponse.resume instrumentation
|
|
163
|
+
# =============================================================================
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
@overload
|
|
167
|
+
def _instrumented_context_response_resume(
|
|
168
|
+
self: ContextResponse[DepsT], ctx: Context[DepsT], content: UserContent
|
|
169
|
+
) -> ContextResponse[DepsT]: ...
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
@overload
|
|
173
|
+
def _instrumented_context_response_resume(
|
|
174
|
+
self: ContextResponse[DepsT, FormattableT],
|
|
175
|
+
ctx: Context[DepsT],
|
|
176
|
+
content: UserContent,
|
|
177
|
+
) -> ContextResponse[DepsT, FormattableT]: ...
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
@wraps(_ORIGINAL_CONTEXT_RESPONSE_RESUME)
|
|
181
|
+
def _instrumented_context_response_resume(
|
|
182
|
+
self: ContextResponse[DepsT] | ContextResponse[DepsT, FormattableT],
|
|
183
|
+
ctx: Context[DepsT],
|
|
184
|
+
content: UserContent,
|
|
185
|
+
) -> ContextResponse[DepsT] | ContextResponse[DepsT, FormattableT]:
|
|
186
|
+
"""Returns a Mirascope-traced result of `ContextResponse.resume`."""
|
|
187
|
+
with MirascopeSpan(f"ContextResponse.resume {self.model_id}") as span:
|
|
188
|
+
span.set(
|
|
189
|
+
**{
|
|
190
|
+
"mirascope.type": "response_resume",
|
|
191
|
+
"mirascope.response.model_id": self.model_id,
|
|
192
|
+
"mirascope.response.provider_id": self.provider_id,
|
|
193
|
+
}
|
|
194
|
+
)
|
|
195
|
+
result = cast(
|
|
196
|
+
"ContextResponse[DepsT] | ContextResponse[DepsT, FormattableT]",
|
|
197
|
+
_ORIGINAL_CONTEXT_RESPONSE_RESUME(cast(Any, self), ctx, content),
|
|
198
|
+
)
|
|
199
|
+
attach_mirascope_response(span, result)
|
|
200
|
+
return result
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
def wrap_context_response_resume() -> None:
|
|
204
|
+
"""Returns None. Replaces `ContextResponse.resume` with the instrumented wrapper."""
|
|
205
|
+
global _CONTEXT_RESPONSE_RESUME_WRAPPED
|
|
206
|
+
if _CONTEXT_RESPONSE_RESUME_WRAPPED:
|
|
207
|
+
return
|
|
208
|
+
ContextResponse.resume = _instrumented_context_response_resume
|
|
209
|
+
_CONTEXT_RESPONSE_RESUME_WRAPPED = True
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
def unwrap_context_response_resume() -> None:
|
|
213
|
+
"""Returns None. Restores the original `ContextResponse.resume` implementation."""
|
|
214
|
+
global _CONTEXT_RESPONSE_RESUME_WRAPPED
|
|
215
|
+
if not _CONTEXT_RESPONSE_RESUME_WRAPPED:
|
|
216
|
+
return
|
|
217
|
+
ContextResponse.resume = _ORIGINAL_CONTEXT_RESPONSE_RESUME
|
|
218
|
+
_CONTEXT_RESPONSE_RESUME_WRAPPED = False
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
# =============================================================================
|
|
222
|
+
# AsyncContextResponse.resume instrumentation
|
|
223
|
+
# =============================================================================
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
@overload
|
|
227
|
+
async def _instrumented_async_context_response_resume(
|
|
228
|
+
self: AsyncContextResponse[DepsT], ctx: Context[DepsT], content: UserContent
|
|
229
|
+
) -> AsyncContextResponse[DepsT]: ...
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
@overload
|
|
233
|
+
async def _instrumented_async_context_response_resume(
|
|
234
|
+
self: AsyncContextResponse[DepsT, FormattableT],
|
|
235
|
+
ctx: Context[DepsT],
|
|
236
|
+
content: UserContent,
|
|
237
|
+
) -> AsyncContextResponse[DepsT, FormattableT]: ...
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
@wraps(_ORIGINAL_ASYNC_CONTEXT_RESPONSE_RESUME)
|
|
241
|
+
async def _instrumented_async_context_response_resume(
|
|
242
|
+
self: AsyncContextResponse[DepsT] | AsyncContextResponse[DepsT, FormattableT],
|
|
243
|
+
ctx: Context[DepsT],
|
|
244
|
+
content: UserContent,
|
|
245
|
+
) -> AsyncContextResponse[DepsT] | AsyncContextResponse[DepsT, FormattableT]:
|
|
246
|
+
"""Returns a Mirascope-traced result of `AsyncContextResponse.resume`."""
|
|
247
|
+
with MirascopeSpan(f"AsyncContextResponse.resume {self.model_id}") as span:
|
|
248
|
+
span.set(
|
|
249
|
+
**{
|
|
250
|
+
"mirascope.type": "response_resume",
|
|
251
|
+
"mirascope.response.model_id": self.model_id,
|
|
252
|
+
"mirascope.response.provider_id": self.provider_id,
|
|
253
|
+
}
|
|
254
|
+
)
|
|
255
|
+
result = cast(
|
|
256
|
+
"AsyncContextResponse[DepsT] | AsyncContextResponse[DepsT, FormattableT]",
|
|
257
|
+
await _ORIGINAL_ASYNC_CONTEXT_RESPONSE_RESUME(
|
|
258
|
+
cast(Any, self), ctx, content
|
|
259
|
+
),
|
|
260
|
+
)
|
|
261
|
+
await attach_mirascope_response_async(span, result)
|
|
262
|
+
return result
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
def wrap_async_context_response_resume() -> None:
|
|
266
|
+
"""Returns None. Replaces `AsyncContextResponse.resume` with the instrumented wrapper."""
|
|
267
|
+
global _ASYNC_CONTEXT_RESPONSE_RESUME_WRAPPED
|
|
268
|
+
if _ASYNC_CONTEXT_RESPONSE_RESUME_WRAPPED:
|
|
269
|
+
return
|
|
270
|
+
AsyncContextResponse.resume = _instrumented_async_context_response_resume
|
|
271
|
+
_ASYNC_CONTEXT_RESPONSE_RESUME_WRAPPED = True
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
def unwrap_async_context_response_resume() -> None:
|
|
275
|
+
"""Returns None. Restores the original `AsyncContextResponse.resume` implementation."""
|
|
276
|
+
global _ASYNC_CONTEXT_RESPONSE_RESUME_WRAPPED
|
|
277
|
+
if not _ASYNC_CONTEXT_RESPONSE_RESUME_WRAPPED:
|
|
278
|
+
return
|
|
279
|
+
AsyncContextResponse.resume = _ORIGINAL_ASYNC_CONTEXT_RESPONSE_RESUME
|
|
280
|
+
_ASYNC_CONTEXT_RESPONSE_RESUME_WRAPPED = False
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
# =============================================================================
|
|
284
|
+
# StreamResponse.resume instrumentation
|
|
285
|
+
# =============================================================================
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
@overload
|
|
289
|
+
def _instrumented_stream_response_resume(
|
|
290
|
+
self: StreamResponse, content: UserContent
|
|
291
|
+
) -> StreamResponse: ...
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
@overload
|
|
295
|
+
def _instrumented_stream_response_resume(
|
|
296
|
+
self: StreamResponse[FormattableT], content: UserContent
|
|
297
|
+
) -> StreamResponse[FormattableT]: ...
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
@wraps(_ORIGINAL_STREAM_RESPONSE_RESUME)
|
|
301
|
+
def _instrumented_stream_response_resume(
|
|
302
|
+
self: StreamResponse | StreamResponse[FormattableT], content: UserContent
|
|
303
|
+
) -> StreamResponse | StreamResponse[FormattableT]:
|
|
304
|
+
"""Returns a Mirascope-traced result of `StreamResponse.resume`."""
|
|
305
|
+
with MirascopeSpan(f"StreamResponse.resume {self.model_id}") as span:
|
|
306
|
+
span.set(
|
|
307
|
+
**{
|
|
308
|
+
"mirascope.type": "response_resume",
|
|
309
|
+
"mirascope.response.model_id": self.model_id,
|
|
310
|
+
"mirascope.response.provider_id": self.provider_id,
|
|
311
|
+
}
|
|
312
|
+
)
|
|
313
|
+
result = cast(
|
|
314
|
+
"StreamResponse | StreamResponse[FormattableT]",
|
|
315
|
+
_ORIGINAL_STREAM_RESPONSE_RESUME(cast(Any, self), content),
|
|
316
|
+
)
|
|
317
|
+
attach_mirascope_response(span, result)
|
|
318
|
+
return result
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
def wrap_stream_response_resume() -> None:
|
|
322
|
+
"""Returns None. Replaces `StreamResponse.resume` with the instrumented wrapper."""
|
|
323
|
+
global _STREAM_RESPONSE_RESUME_WRAPPED
|
|
324
|
+
if _STREAM_RESPONSE_RESUME_WRAPPED:
|
|
325
|
+
return
|
|
326
|
+
StreamResponse.resume = _instrumented_stream_response_resume
|
|
327
|
+
_STREAM_RESPONSE_RESUME_WRAPPED = True
|
|
328
|
+
|
|
329
|
+
|
|
330
|
+
def unwrap_stream_response_resume() -> None:
|
|
331
|
+
"""Returns None. Restores the original `StreamResponse.resume` implementation."""
|
|
332
|
+
global _STREAM_RESPONSE_RESUME_WRAPPED
|
|
333
|
+
if not _STREAM_RESPONSE_RESUME_WRAPPED:
|
|
334
|
+
return
|
|
335
|
+
StreamResponse.resume = _ORIGINAL_STREAM_RESPONSE_RESUME
|
|
336
|
+
_STREAM_RESPONSE_RESUME_WRAPPED = False
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
# =============================================================================
|
|
340
|
+
# AsyncStreamResponse.resume instrumentation
|
|
341
|
+
# =============================================================================
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
@overload
|
|
345
|
+
async def _instrumented_async_stream_response_resume(
|
|
346
|
+
self: AsyncStreamResponse, content: UserContent
|
|
347
|
+
) -> AsyncStreamResponse: ...
|
|
348
|
+
|
|
349
|
+
|
|
350
|
+
@overload
|
|
351
|
+
async def _instrumented_async_stream_response_resume(
|
|
352
|
+
self: AsyncStreamResponse[FormattableT], content: UserContent
|
|
353
|
+
) -> AsyncStreamResponse[FormattableT]: ...
|
|
354
|
+
|
|
355
|
+
|
|
356
|
+
@wraps(_ORIGINAL_ASYNC_STREAM_RESPONSE_RESUME)
|
|
357
|
+
async def _instrumented_async_stream_response_resume(
|
|
358
|
+
self: AsyncStreamResponse | AsyncStreamResponse[FormattableT], content: UserContent
|
|
359
|
+
) -> AsyncStreamResponse | AsyncStreamResponse[FormattableT]:
|
|
360
|
+
"""Returns a Mirascope-traced result of `AsyncStreamResponse.resume`."""
|
|
361
|
+
with MirascopeSpan(f"AsyncStreamResponse.resume {self.model_id}") as span:
|
|
362
|
+
span.set(
|
|
363
|
+
**{
|
|
364
|
+
"mirascope.type": "response_resume",
|
|
365
|
+
"mirascope.response.model_id": self.model_id,
|
|
366
|
+
"mirascope.response.provider_id": self.provider_id,
|
|
367
|
+
}
|
|
368
|
+
)
|
|
369
|
+
result = cast(
|
|
370
|
+
"AsyncStreamResponse | AsyncStreamResponse[FormattableT]",
|
|
371
|
+
await _ORIGINAL_ASYNC_STREAM_RESPONSE_RESUME(cast(Any, self), content),
|
|
372
|
+
)
|
|
373
|
+
await attach_mirascope_response_async(span, result)
|
|
374
|
+
return result
|
|
375
|
+
|
|
376
|
+
|
|
377
|
+
def wrap_async_stream_response_resume() -> None:
|
|
378
|
+
"""Returns None. Replaces `AsyncStreamResponse.resume` with the instrumented wrapper."""
|
|
379
|
+
global _ASYNC_STREAM_RESPONSE_RESUME_WRAPPED
|
|
380
|
+
if _ASYNC_STREAM_RESPONSE_RESUME_WRAPPED:
|
|
381
|
+
return
|
|
382
|
+
AsyncStreamResponse.resume = _instrumented_async_stream_response_resume
|
|
383
|
+
_ASYNC_STREAM_RESPONSE_RESUME_WRAPPED = True
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+
def unwrap_async_stream_response_resume() -> None:
|
|
387
|
+
"""Returns None. Restores the original `AsyncStreamResponse.resume` implementation."""
|
|
388
|
+
global _ASYNC_STREAM_RESPONSE_RESUME_WRAPPED
|
|
389
|
+
if not _ASYNC_STREAM_RESPONSE_RESUME_WRAPPED:
|
|
390
|
+
return
|
|
391
|
+
AsyncStreamResponse.resume = _ORIGINAL_ASYNC_STREAM_RESPONSE_RESUME
|
|
392
|
+
_ASYNC_STREAM_RESPONSE_RESUME_WRAPPED = False
|
|
393
|
+
|
|
394
|
+
|
|
395
|
+
# =============================================================================
|
|
396
|
+
# ContextStreamResponse.resume instrumentation
|
|
397
|
+
# =============================================================================
|
|
398
|
+
|
|
399
|
+
|
|
400
|
+
@overload
|
|
401
|
+
def _instrumented_context_stream_response_resume(
|
|
402
|
+
self: ContextStreamResponse[DepsT], ctx: Context[DepsT], content: UserContent
|
|
403
|
+
) -> ContextStreamResponse[DepsT]: ...
|
|
404
|
+
|
|
405
|
+
|
|
406
|
+
@overload
|
|
407
|
+
def _instrumented_context_stream_response_resume(
|
|
408
|
+
self: ContextStreamResponse[DepsT, FormattableT],
|
|
409
|
+
ctx: Context[DepsT],
|
|
410
|
+
content: UserContent,
|
|
411
|
+
) -> ContextStreamResponse[DepsT, FormattableT]: ...
|
|
412
|
+
|
|
413
|
+
|
|
414
|
+
@wraps(_ORIGINAL_CONTEXT_STREAM_RESPONSE_RESUME)
|
|
415
|
+
def _instrumented_context_stream_response_resume(
|
|
416
|
+
self: ContextStreamResponse[DepsT] | ContextStreamResponse[DepsT, FormattableT],
|
|
417
|
+
ctx: Context[DepsT],
|
|
418
|
+
content: UserContent,
|
|
419
|
+
) -> ContextStreamResponse[DepsT] | ContextStreamResponse[DepsT, FormattableT]:
|
|
420
|
+
"""Returns a Mirascope-traced result of `ContextStreamResponse.resume`."""
|
|
421
|
+
with MirascopeSpan(f"ContextStreamResponse.resume {self.model_id}") as span:
|
|
422
|
+
span.set(
|
|
423
|
+
**{
|
|
424
|
+
"mirascope.type": "response_resume",
|
|
425
|
+
"mirascope.response.model_id": self.model_id,
|
|
426
|
+
"mirascope.response.provider_id": self.provider_id,
|
|
427
|
+
}
|
|
428
|
+
)
|
|
429
|
+
result = cast(
|
|
430
|
+
"ContextStreamResponse[DepsT] | ContextStreamResponse[DepsT, FormattableT]",
|
|
431
|
+
_ORIGINAL_CONTEXT_STREAM_RESPONSE_RESUME(cast(Any, self), ctx, content),
|
|
432
|
+
)
|
|
433
|
+
attach_mirascope_response(span, result)
|
|
434
|
+
return result
|
|
435
|
+
|
|
436
|
+
|
|
437
|
+
def wrap_context_stream_response_resume() -> None:
|
|
438
|
+
"""Returns None. Replaces `ContextStreamResponse.resume` with the instrumented wrapper."""
|
|
439
|
+
global _CONTEXT_STREAM_RESPONSE_RESUME_WRAPPED
|
|
440
|
+
if _CONTEXT_STREAM_RESPONSE_RESUME_WRAPPED:
|
|
441
|
+
return
|
|
442
|
+
ContextStreamResponse.resume = _instrumented_context_stream_response_resume
|
|
443
|
+
_CONTEXT_STREAM_RESPONSE_RESUME_WRAPPED = True
|
|
444
|
+
|
|
445
|
+
|
|
446
|
+
def unwrap_context_stream_response_resume() -> None:
|
|
447
|
+
"""Returns None. Restores the original `ContextStreamResponse.resume` implementation."""
|
|
448
|
+
global _CONTEXT_STREAM_RESPONSE_RESUME_WRAPPED
|
|
449
|
+
if not _CONTEXT_STREAM_RESPONSE_RESUME_WRAPPED:
|
|
450
|
+
return
|
|
451
|
+
ContextStreamResponse.resume = _ORIGINAL_CONTEXT_STREAM_RESPONSE_RESUME
|
|
452
|
+
_CONTEXT_STREAM_RESPONSE_RESUME_WRAPPED = False
|
|
453
|
+
|
|
454
|
+
|
|
455
|
+
# =============================================================================
|
|
456
|
+
# AsyncContextStreamResponse.resume instrumentation
|
|
457
|
+
# =============================================================================
|
|
458
|
+
|
|
459
|
+
|
|
460
|
+
@overload
|
|
461
|
+
async def _instrumented_async_context_stream_response_resume(
|
|
462
|
+
self: AsyncContextStreamResponse[DepsT],
|
|
463
|
+
ctx: Context[DepsT],
|
|
464
|
+
content: UserContent,
|
|
465
|
+
) -> AsyncContextStreamResponse[DepsT]: ...
|
|
466
|
+
|
|
467
|
+
|
|
468
|
+
@overload
|
|
469
|
+
async def _instrumented_async_context_stream_response_resume(
|
|
470
|
+
self: AsyncContextStreamResponse[DepsT, FormattableT],
|
|
471
|
+
ctx: Context[DepsT],
|
|
472
|
+
content: UserContent,
|
|
473
|
+
) -> AsyncContextStreamResponse[DepsT, FormattableT]: ...
|
|
474
|
+
|
|
475
|
+
|
|
476
|
+
@wraps(_ORIGINAL_ASYNC_CONTEXT_STREAM_RESPONSE_RESUME)
|
|
477
|
+
async def _instrumented_async_context_stream_response_resume(
|
|
478
|
+
self: AsyncContextStreamResponse[DepsT]
|
|
479
|
+
| AsyncContextStreamResponse[DepsT, FormattableT],
|
|
480
|
+
ctx: Context[DepsT],
|
|
481
|
+
content: UserContent,
|
|
482
|
+
) -> (
|
|
483
|
+
AsyncContextStreamResponse[DepsT] | AsyncContextStreamResponse[DepsT, FormattableT]
|
|
484
|
+
):
|
|
485
|
+
"""Returns a Mirascope-traced result of `AsyncContextStreamResponse.resume`."""
|
|
486
|
+
with MirascopeSpan(f"AsyncContextStreamResponse.resume {self.model_id}") as span:
|
|
487
|
+
span.set(
|
|
488
|
+
**{
|
|
489
|
+
"mirascope.type": "response_resume",
|
|
490
|
+
"mirascope.response.model_id": self.model_id,
|
|
491
|
+
"mirascope.response.provider_id": self.provider_id,
|
|
492
|
+
}
|
|
493
|
+
)
|
|
494
|
+
result = cast(
|
|
495
|
+
"AsyncContextStreamResponse[DepsT] | AsyncContextStreamResponse[DepsT, FormattableT]",
|
|
496
|
+
await _ORIGINAL_ASYNC_CONTEXT_STREAM_RESPONSE_RESUME(
|
|
497
|
+
cast(Any, self), ctx, content
|
|
498
|
+
),
|
|
499
|
+
)
|
|
500
|
+
await attach_mirascope_response_async(span, result)
|
|
501
|
+
return result
|
|
502
|
+
|
|
503
|
+
|
|
504
|
+
def wrap_async_context_stream_response_resume() -> None:
|
|
505
|
+
"""Returns None. Replaces `AsyncContextStreamResponse.resume` with the instrumented wrapper."""
|
|
506
|
+
global _ASYNC_CONTEXT_STREAM_RESPONSE_RESUME_WRAPPED
|
|
507
|
+
if _ASYNC_CONTEXT_STREAM_RESPONSE_RESUME_WRAPPED:
|
|
508
|
+
return
|
|
509
|
+
AsyncContextStreamResponse.resume = (
|
|
510
|
+
_instrumented_async_context_stream_response_resume
|
|
511
|
+
)
|
|
512
|
+
_ASYNC_CONTEXT_STREAM_RESPONSE_RESUME_WRAPPED = True
|
|
513
|
+
|
|
514
|
+
|
|
515
|
+
def unwrap_async_context_stream_response_resume() -> None:
|
|
516
|
+
"""Returns None. Restores the original `AsyncContextStreamResponse.resume` implementation."""
|
|
517
|
+
global _ASYNC_CONTEXT_STREAM_RESPONSE_RESUME_WRAPPED
|
|
518
|
+
if not _ASYNC_CONTEXT_STREAM_RESPONSE_RESUME_WRAPPED:
|
|
519
|
+
return
|
|
520
|
+
AsyncContextStreamResponse.resume = _ORIGINAL_ASYNC_CONTEXT_STREAM_RESPONSE_RESUME
|
|
521
|
+
_ASYNC_CONTEXT_STREAM_RESPONSE_RESUME_WRAPPED = False
|