-
Notifications
You must be signed in to change notification settings - Fork 10
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
Move command requests to card message matrix events and add support for multiple commands per message #2145
Move command requests to card message matrix events and add support for multiple commands per message #2145
Conversation
…pport multiple command requests per message
b762a09
to
8d52ce0
Compare
8d52ce0
to
c7a2bd6
Compare
…ave results and at least one has output
…iple-tool-calls-per-ai-response
…sing absolute URLs
ddeea6e
to
1f5b5c6
Compare
1f5b5c6
to
9979d51
Compare
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 approving after having read this over with the caveat that I couldn’t get it running locally, the bot was crashing like this:
/Users/b/Documents/Cardstack/Code/boxel-motion/packages/ai-bot/helpers.ts:196
let { attachedCardsEventIds } = event.content.data;
^
TypeError: Cannot destructure property 'attachedCardsEventIds' of 'event.content.data' as it is undefined.
at constructHistory (/Users/b/Documents/Cardstack/Code/boxel-motion/packages/ai-bot/helpers.ts:196:13)
Is this the breaking change of the PR description, do I need to clear my Matrix history?
It's not supposed to crash. Thanks for the error message. I'll see if I can fix it. |
2fda108
to
c5ec57a
Compare
replacing m.annotation with a custom thing seems to work for that issue. |
8795782
to
03c51ea
Compare
03c51ea
to
53a898d
Compare
Interesting -- that prompt was enough to get multiple commands in one message for me |
I tested this again and I'm a little confused about how multiple commands per message should work. I would expect there would be multiple commands within the same message, but when I test it, the commands will be in multiple messages. Is this expected? Or is there an issue with the test prompt? |
This PR is breaking in a sense -- previous commands added to matrix rooms will no longer be visible since this PR changes the way we are encoding command requests (tool calls) into matrix events.
The motivation for this change is that tool-call-enabled LLMs have the ability make multiple tool calls in a single response, and our modeling made that quite awkward. This PR make that case normal with full support.
This PR also changes the way that debouncing/throttling works in the aibot. It handles response streaming in better, ensuring an event is sent to matrix at most every 250ms and the response is encoded and delivered in full.
Finally, type-checking and linting in the aibot package is improved in this PR too. It was a little loose before.
UPDATE:
This PR has some issues consuming the stream from OpenRouter. I'm investigating.Resolved!