Open arvindanta opened 2 weeks ago
Same here 🙏
Have the same issue here, but mine is triggered by hitting the Azure content filter.
const result = streamText({
model: createAzure({
baseURL: process.env.LLM_API_CHAT_URL,
apiKey: process.env.LLM_API_KEY,
})('gpt-4o'),
system: `You are a helpful assistant.`,
messages,
});
will throw the ⨯ Error: failed to pipe response
message from above w/ a slightly different response body . None of the callbacks are triggered. I would have expected onFinish()
would be called with event.finishReason === 'content-filter'
or in the original case, with event.finishReason === 'length'
. However there seems to be no way to catch the error -- as mentioned, try/catch doesn't work and even getErrorMessage()
is not called.
On the client I see POST http://localhost:3000/api/chat net::ERR_EMPTY_RESPONSE
from the API call and then client-side useChat()
onError()
gets called with a generic onError TypeError: Failed to fetch
.
Hopefully there is some way to catch or expose the underlying error.
Description
Am getting the below error
Code example
I tried using
try/catch
but unable to catch the error. How can i handle manual retries ?.AI provider
@ai-sdk/azure - 0.0.52
Additional context
No response