Repository navigation
Conversation
…ents 0.4.1 Replace @stream-io/calypso 0.3 with @stream-io/stream-agents 0.4.1 in ExpoChatGPTSample and ExpoCrewAssistant, and build each conversation's AIConversationController from the SDK's AgentChat and agentChatTransport instead of the examples' own agentChat.ts and agentTransport.ts. What the SDK doesn't hold stays in the apps: listing a new conversation once it is used, and in ExpoCrewAssistant the step titles, the "getting things ready" state, retrying the last request, voice memos and reopening a dropped session when the app comes back to the foreground.
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-524
What
@stream-io/calypso^0.3.0 →@stream-io/stream-agents^0.4.1 in ExpoChatGPTSample and ExpoCrewAssistant (the same JS SDK, renamed). Imports move to@stream-io/stream-agentsand/chat.stream-chatstays on 9.55;/chatsupports 9 and 10..yarnrc.ymlswaps calypso for stream-agents on the age-gate allowlist, since 0.4.1 is newer than three days.agent/agentChat.tsandagent/agentTransport.tsare deleted.contexts/AppContext.tsxbuilds the controller fromnew AgentChat({ sessionId, open })andagentChatTransport(chat, { adapt, images, reasoningEffort }), withactions: { edit: false, regenerate: false }. The transport sends the controller's messageId asrequestIdand a generated-UI action fromcustom.uiAction; a failed reply shows the kit's translated error.agent/conversation.ts(new, per app): theChat/ChatStatetypes overLocalMessage,chatStore(chat)foruseStateStore(typed for stream-chat'sStateStore; the SDK's store has the same shape), a React key per chat, andwhenUsed, which refreshes the drawer each time a new conversation's session is used (a first question that never reached the router has its session deleted, and the retry creates another).Tools.register'srunis(input, call)in 0.4 and the SDK stops waiting on a cancelled call itself, sodeviceTools.tsdrops the abort signal.ExpoCrewAssistant keeps in the app what the SDK doesn't do:
DISPLAY_TITLESfor the backend's tool steps, by wrappingadapt.awaitingAgent, now on the context, derived from whether a reply has shown).lastRequestfor "Try again" (questions, events and voice memos). A composer retry doesn't overwrite it, so a generated-UI action keeps itsuiAction.chat.use()once the router or backend has the request, so they're kept and listed, and a failed one isn't left behind.chat.prepare()when the session's socket is no longerlive.Checks
yarn lintyarn workspace expochatgptsample typecheck/yarn workspace expocrewassistant typecheck