Repository navigation
feat(ai-components): parse agent reply steps from message attachments - #3920
Open
isekovanic wants to merge 1 commit into
Open
isekovanic wants to merge 1 commit into
isekovanic wants to merge 1 commit into
Conversation
Contributor
SDK Size
|
2 of 6 tasks
This branch has not been deployed
This file contains hidden or 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
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.
Ticket: https://linear.app/stream/issue/RN-485
π― Goal
First of a stack of PRs that bring agent conversations to
ai-components: reasoning, tool calls, approvals, sign-in and the conversation view, as in StreamChatAI, ai-compose and stream-chat-react#3376.This one adds only the data model. No UI.
π Implementation details
An agent writes each step of its reply as an attachment (
ai_reasoning,ai_tool_call).parseMessageParts(message.attachments)turns those into typed parts and skips everything else, such as images and files.Ported from React #3376 with the same names and behaviour:
v > 1) keep their payload but have no typed view.approvalandauthorizationare parsed on tool calls.isAwaitingApproval,isAwaitingAuthorization,isAwaitingClient,isDeclined,isToolCallFinished,isAuthorizationExpired,isSupportedPart.One deviation from React: the sign-in URL check doesn't use
URL. On RN < 0.80 itsprotocolandhostgetters throw "not implemented", which would silently drop every sign-in on 0.76β0.79. It's a regex instead.Exported from the
ai-componentsentry only. The main entry is unaffected.π¨ UI Changes
None.
π§ͺ Testing
messagePartssuite ported to Jest.searchtool call β reasoning).URLand checks a sign-in still parses.yarn lint,yarn test:typecheck,yarn buildandyarn test:unitpass.βοΈ Checklist
developbranch