-
Notifications
You must be signed in to change notification settings - Fork 189
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
[PY] feat: streaming support for Tools Augmentation #2215
base: main
Are you sure you want to change the base?
Conversation
traceback.print_exc() | ||
|
||
# Send a message to the user | ||
await context.send_activity("The bot encountered an error or bug.") | ||
# await context.send_activity("The bot encountered an error or bug.") |
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.
forgot to remove commented out lines in file
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.
@BMS-geodev I think you accidentally uncommented instead of removing for latest updates
message.action_calls[index].function.name += curr_tool_call.function.name | ||
if curr_tool_call.function.arguments: | ||
message.action_calls[index].function.arguments += curr_tool_call.function.arguments | ||
if curr_tool_call.type == "function": # Type must always match the expected value |
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.
extra comment
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.
are we supposed to set the type regardless?
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.
I can experiment with leaving it empty, however to my understanding if its anything other than empty, it has to be "function"
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.
Yup, did it end up throwing an error?
if chunk.delta and ( | ||
(chunk.delta.action_calls and len(chunk.delta.action_calls) > 0) or | ||
chunk.delta.action_call_id or | ||
getattr(chunk.delta, "tool_calls", None) |
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.
we should keep it consistent with JS/C# and check chunk.delta.content
instead
@@ -284,7 +291,20 @@ def chunk_received( | |||
|
|||
if streamer is not None: | |||
await streamer.end_stream() | |||
|
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.
need to also remove L281-283 (check for is_streaming and res.status == "success"
)
@@ -284,7 +291,20 @@ def chunk_received( | |||
|
|||
if streamer is not None: | |||
await streamer.end_stream() |
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.
also need to remove this line
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.
does this not align with this line from Steve's updates?
await streamer.endStream(); |
else {
if (response.status == 'success') {
// Delete message from response to avoid sending it twice
delete response.message;
}
// End the stream and remove pointer from memory
// - We're not listening for the response received event because we can't await the completion of events.
await streamer.endStream();
memory.deleteValue('temp.streamer');
}
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.
oh I may have the wrong place
res.message.content = "" | ||
else: | ||
if res.status == "success": | ||
res.message = None |
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.
could we also add in the comments that Steve has for JS so we remember the purpose of these edge cases in the future
Linked issues
closes: # 2212
Details
Provide a list of your changes here. If you are fixing a bug, please provide steps to reproduce the bug.
Change details
code snippets:
screenshots:
Attestation Checklist
My code follows the style guidelines of this project
I have checked for/fixed spelling, linting, and other errors
I have commented my code for clarity
I have made corresponding changes to the documentation (updating the doc strings in the code is sufficient)
My changes generate no new warnings
I have added tests that validates my changes, and provides sufficient test coverage. I have tested with:
New and existing unit tests pass locally with my changes
Additional information