We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using Azure OpenAI API via the createOpenAI method, and following the tutorial published by Vercel: https://sdk.vercel.ai/providers/ai-sdk-providers/openai
createOpenAI
I tried different API versions, based on this doc: https://learn.microsoft.com/en-us/azure/ai-services/openai/reference along with different Auzre OpenAI models (gpt-35-turbo and gpt-4).
'use server'; import { createOpenAI } from "@ai-sdk/openai"; import { generateObject } from "ai"; import { generateText } from "ai"; import { z } from "zod"; const openai = createOpenAI({ apiKey: process.env.AZURE_OPENAI_API_KEY, baseURL: "https://{resource}.openai.azure.com/openai/deployments/{deployment}/chat/completions?api-version=2024-02-01", }); export async function getNotifications(input: string) { "use server"; const { object: notifications } = await generateObject({ model: openai("gpt-4"), system: "You generate three notifications for a messages app.", prompt: input, schema: z.object({ notifications: z.array( z.object({ name: z.string().describe("Name of a fictional person."), message: z.string().describe("Do not use emojis or links."), minutesAgo: z.number(), }) ), }), }); return { notifications }; }
The above code generates responseBody: '{"error":{"code":"404","message": "Resource not found"}}' error message.
responseBody: '{"error":{"code":"404","message": "Resource not found"}}'
The text was updated successfully, but these errors were encountered:
404: Resource not found
Azure OpenAI is not supported as a provider for AI SDK Core yet.
Sorry, something went wrong.
Duplicates #1675
No branches or pull requests
Description
Using Azure OpenAI API via the
createOpenAI
method, and following the tutorial published by Vercel: https://sdk.vercel.ai/providers/ai-sdk-providers/openaiI tried different API versions, based on this doc: https://learn.microsoft.com/en-us/azure/ai-services/openai/reference along with different Auzre OpenAI models (gpt-35-turbo and gpt-4).
Code example
Additional context
The above code generates
responseBody: '{"error":{"code":"404","message": "Resource not found"}}'
error message.The text was updated successfully, but these errors were encountered: