-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Revert "Stop yielding the accumulated final response" #1048
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -42,10 +42,11 @@ | |||||||||||||
| from tools import get_contact_info | ||||||||||||||
| from a2ui.core.schema.constants import VERSION_0_8, VERSION_0_9, A2UI_OPEN_TAG, A2UI_CLOSE_TAG | ||||||||||||||
| from a2ui.core.schema.manager import A2uiSchemaManager | ||||||||||||||
| from a2ui.core.parser.parser import parse_response | ||||||||||||||
| from a2ui.core.parser.parser import parse_response, ResponsePart | ||||||||||||||
| from a2ui.basic_catalog.provider import BasicCatalog | ||||||||||||||
| from a2ui.a2a import ( | ||||||||||||||
| get_a2ui_agent_extension, | ||||||||||||||
| parse_response_to_parts, | ||||||||||||||
| stream_response_to_parts, | ||||||||||||||
| ) | ||||||||||||||
|
|
||||||||||||||
|
|
@@ -357,13 +358,16 @@ async def token_stream(): | |||||||||||||
|
|
||||||||||||||
| if is_valid: | ||||||||||||||
| logger.info( | ||||||||||||||
| "--- ContactAgent.stream: Response is valid. Task complete (Attempt" | ||||||||||||||
| f" {attempt}). ---" | ||||||||||||||
| "--- ContactAgent.stream: Response is valid. Sending final response" | ||||||||||||||
| f" (Attempt {attempt}). ---" | ||||||||||||||
| ) | ||||||||||||||
| final_parts = parse_response_to_parts( | ||||||||||||||
| final_response_content, fallback_text="OK." | ||||||||||||||
| ) | ||||||||||||||
|
Comment on lines
+364
to
366
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using You should use
Suggested change
|
||||||||||||||
|
|
||||||||||||||
| yield { | ||||||||||||||
| "is_task_complete": True, | ||||||||||||||
| "parts": [], | ||||||||||||||
| "parts": final_parts, | ||||||||||||||
| } | ||||||||||||||
| return # We're done, exit the generator | ||||||||||||||
|
|
||||||||||||||
|
|
||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -43,11 +43,12 @@ | |||||||||||||
| from tools import get_restaurants | ||||||||||||||
| from a2ui.core.schema.constants import VERSION_0_8, VERSION_0_9, A2UI_OPEN_TAG, A2UI_CLOSE_TAG | ||||||||||||||
| from a2ui.core.schema.manager import A2uiSchemaManager | ||||||||||||||
| from a2ui.core.parser.parser import parse_response | ||||||||||||||
| from a2ui.core.parser.parser import parse_response, ResponsePart | ||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||||||||||
| from a2ui.basic_catalog.provider import BasicCatalog | ||||||||||||||
| from a2ui.core.schema.common_modifiers import remove_strict_validation | ||||||||||||||
| from a2ui.a2a import ( | ||||||||||||||
| get_a2ui_agent_extension, | ||||||||||||||
| parse_response_to_parts, | ||||||||||||||
| stream_response_to_parts, | ||||||||||||||
| ) | ||||||||||||||
|
|
||||||||||||||
|
|
@@ -326,13 +327,16 @@ async def token_stream(): | |||||||||||||
|
|
||||||||||||||
| if is_valid: | ||||||||||||||
| logger.info( | ||||||||||||||
| "--- RestaurantAgent.stream: Response is valid. Task complete" | ||||||||||||||
| "--- RestaurantAgent.stream: Response is valid. Sending final response" | ||||||||||||||
| f" (Attempt {attempt}). ---" | ||||||||||||||
| ) | ||||||||||||||
| final_parts = parse_response_to_parts( | ||||||||||||||
| final_response_content, fallback_text="OK." | ||||||||||||||
| ) | ||||||||||||||
|
Comment on lines
+333
to
+335
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using You should use
Suggested change
|
||||||||||||||
|
|
||||||||||||||
| yield { | ||||||||||||||
| "is_task_complete": True, | ||||||||||||||
| "parts": [], | ||||||||||||||
| "parts": final_parts, | ||||||||||||||
| } | ||||||||||||||
| return # We're done, exit the generator | ||||||||||||||
|
|
||||||||||||||
|
|
||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The import of
ResponsePartis unused in this file and can be removed.