MCPcopy Index your code
hub / github.com/TanStack/ai / findLatestRecipePart

Function findLatestRecipePart

examples/ts-react-native-chat/src/App.tsx:193–203  ·  view source on GitHub ↗
(
  messages: Array<UIMessage>,
)

Source from the content-addressed store, hash-verified

191}
192
193function findLatestRecipePart(
194 messages: Array<UIMessage>,
195): StructuredRecipePart | undefined {
196 for (const message of [...messages].reverse()) {
197 for (const part of [...message.parts].reverse()) {
198 if (part.type === 'structured-output') return part
199 }
200 }
201
202 return undefined
203}
204
205function isExpectedFetchStreamingError(error: Error | undefined): boolean {
206 if (!error) return false

Callers 1

AppFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected