-
Notifications
You must be signed in to change notification settings - Fork 142
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
feat(js/ai): added a simple way to interrupt tool execution #1583
Merged
+305
−62
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Collaborator
pavelgj
commented
Jan 4, 2025
•
edited
Loading
edited
pavelgj
force-pushed
the
pj/toolChoice
branch
from
January 15, 2025 14:24
3358714
to
1baf2af
Compare
mbleigh
reviewed
Jan 23, 2025
It's up to the dev to figure it what to do with the metadata, for now it's
just an annotation and the dev can use it to drive UI etc.
I want there to be a mechanism/API to explicitly signal (maybe via
context?) that it's a resumed interruption, but I think we can figure that
out later.
…On Wed, Jan 22, 2025, 5:44 PM Pavel Jbanov ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In js/ai/src/tool.ts
<#1583 (comment)>:
> +export function interruptTool() {
+ throw new ToolInterruptError();
+}
this implies this interrupt is resumable/rerunnable where the interrupt
won't be triggered? Like we we had with durable flows? How do you imagine
the user facing api for this?
—
Reply to this email directly, view it on GitHub
<#1583 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAAH7U7LAPMI56VPE67AFL2MBCPNAVCNFSM6AAAAABUTITF3CVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDKNRYGY4DCNZZGE>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
mbleigh
approved these changes
Jan 23, 2025
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'm actually pretty happy with this API sitting with it overnight, and I think we could do defineInterrupt
as a thin sugaring on top of it.
pavelgj
force-pushed
the
pj/interruptTool
branch
from
January 23, 2025 18:40
9af7937
to
df7a717
Compare
mbleigh
approved these changes
Jan 23, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.