I was looking at this part of the document on using onFinish callback. https://ai-sdk.dev/docs/reference/ai-sdk-core/stream-text#on-finish The document provides that the callback function take a parameter of OnFinishResult type. Can anyone please help me understand how to import this type? I'd be useful if I write the callback in other places than the inline function.
Currently my IDE is suggesting type "any".
async function onFinishCallback(result: any): Promise<void> { // This function is called when the AI has finished generating a response. console.log('AI response finished:', result); }const result = streamText({ model: google('gemini-2.5-flash-preview-05-20'), system: 'you are an assistant.', messages, providerOptions: /*something*/, onFinish: onFinishCallback, });