You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
const context = await req.json();
const model = azure('azure-gpt-4o-mini');
const result = streamObject({
model,
schema: notificationSchema,
prompt:
`Generate 3 notifications for a messages app in this context:` + context,
});
return result.toTextStreamResponse();
If the stream encounters an error, then it throws an unhandledRejection and crashes the entire server. For example if it hits an API Call error like content filtering:
error: unhandledRejection: The response was filtered due to the prompt triggering Azure OpenAI's content management policy. Please modify your prompt and retry.
AI_APICallError: The response was filtered due to the prompt triggering Azure OpenAI's content management policy. Please modify your prompt and retry.
Not sure if possible with streams, but better exception handling such that errors gets caught in a try/catch or we can provide an onError callback would be greatly appreciated.
Use Cases
No response
Additional context
No response
The text was updated successfully, but these errors were encountered:
Feature Description
Following the object generation docs, and setting up streamObject on a bun server:
If the stream encounters an error, then it throws an
unhandledRejection
and crashes the entire server. For example if it hits an API Call error like content filtering:Not sure if possible with streams, but better exception handling such that errors gets caught in a try/catch or we can provide an
onError
callback would be greatly appreciated.Use Cases
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: