Anyone help me to implement connection adapter for react native. I have already do it but after tool calling follow up message not appear and isLoading keep true , new message not sending. #513
Unanswered
devshahoriar
asked this question in
Q&A
Replies: 1 comment
-
|
after change and save it start working 2026-04-28.17-24-23.mp4 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
import { type StreamChunk } from '@tanstack/ai'
import { type ConnectionAdapter } from '@tanstack/ai-react'
import EventSource from 'react-native-sse'
const isTerminalChunk = (chunk: StreamChunk) => {
console.log(JSON.stringify(chunk,null,2))
if (chunk.type === 'RUN_ERROR') {
return true
}
if (chunk.type === 'RUN_FINISHED') {
return chunk.finishReason !== 'tool_calls'
}
return false
}
export const createReactNativeSseConnection = (
url: string
): ConnectionAdapter => ({
connect(messages, data, abortSignal) {
return (async function* () {
const queue: StreamChunk[] = []
let resolver: ((value: StreamChunk | null) => void) | null = null
let done = false
let error: Error | null = null
},
})
This is my code 👆
Beta Was this translation helpful? Give feedback.
All reactions