mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
[BREAKING] Python: Remove request_type param from ctx.request_info() (#1824)
* Remove request_type param from ctx.request_info() * Address comments
This commit is contained in:
committed by
GitHub
Unverified
parent
2101d9d36d
commit
68b6a55757
+4
-4
@@ -122,7 +122,7 @@ def build_resource_request_distribution_workflow() -> Workflow:
|
||||
|
||||
@handler
|
||||
async def run(self, request: ResourceRequest, ctx: WorkflowContext) -> None:
|
||||
await ctx.request_info(request, ResourceRequest, ResourceResponse)
|
||||
await ctx.request_info(request_data=request, response_type=ResourceResponse)
|
||||
|
||||
@response_handler
|
||||
async def handle_response(
|
||||
@@ -136,7 +136,7 @@ def build_resource_request_distribution_workflow() -> Workflow:
|
||||
|
||||
@handler
|
||||
async def run(self, request: PolicyRequest, ctx: WorkflowContext) -> None:
|
||||
await ctx.request_info(request, PolicyRequest, PolicyResponse)
|
||||
await ctx.request_info(request_data=request, response_type=PolicyResponse)
|
||||
|
||||
@response_handler
|
||||
async def handle_response(
|
||||
@@ -219,7 +219,7 @@ class ResourceAllocator(Executor):
|
||||
else:
|
||||
# Request cannot be fulfilled via cache, forward the request to external
|
||||
self._pending_requests[request_payload.id] = source_event
|
||||
await ctx.request_info(request_payload, ResourceRequest, ResourceResponse)
|
||||
await ctx.request_info(request_data=request_payload, response_type=ResourceResponse)
|
||||
|
||||
@response_handler
|
||||
async def handle_external_response(
|
||||
@@ -270,7 +270,7 @@ class PolicyEngine(Executor):
|
||||
else:
|
||||
# For other policy types, forward to external system
|
||||
self._pending_requests[request_payload.id] = source_event
|
||||
await ctx.request_info(request_payload, PolicyRequest, PolicyResponse)
|
||||
await ctx.request_info(request_data=request_payload, response_type=PolicyResponse)
|
||||
|
||||
@response_handler
|
||||
async def handle_external_response(
|
||||
|
||||
+1
-1
@@ -124,7 +124,7 @@ def build_email_address_validation_workflow() -> Workflow:
|
||||
print(f"🔍 Validating domain: '{domain}'")
|
||||
self._pending_domains[domain] = partial_result
|
||||
# Send a request to the external system via the request_info mechanism
|
||||
await ctx.request_info(domain, str, bool)
|
||||
await ctx.request_info(request_data=domain, response_type=bool)
|
||||
|
||||
@response_handler
|
||||
async def handle_domain_validation_response(
|
||||
|
||||
Reference in New Issue
Block a user