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
Replies: 2 comments
|
after change and save it start working 2026-04-28.17-24-23.mp4 |
0 replies
|
We've added support and docs for reaxt native! |
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 👆
All reactions