-
Notifications
You must be signed in to change notification settings - Fork 218
New issue
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
fix: ai sdk #323
fix: ai sdk #323
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import { Anthropic } from '@ai-sdk/anthropic'; | ||
import { createAnthropic } from '@ai-sdk/anthropic'; | ||
|
||
export const anthropic = new Anthropic({ | ||
export const anthropic = createAnthropic({ | ||
apiKey: process.env.ANTHROPIC_API_KEY ?? '', | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import { Google } from '@ai-sdk/google'; | ||
import { createGoogleGenerativeAI } from '@ai-sdk/google'; | ||
|
||
export const google = new Google({ | ||
export const google = createGoogleGenerativeAI({ | ||
apiKey: process.env.GOOGLE_API_KEY ?? '', | ||
// baseURL: process.env.OPENAI_API_ENDPOINT ?? '', | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import { OpenAI } from '@ai-sdk/openai'; | ||
import { createOpenAI } from '@ai-sdk/openai'; | ||
|
||
export const openai = new OpenAI({ | ||
export const openai = createOpenAI({ | ||
apiKey: process.env.OPENAI_API_KEY ?? '', | ||
// baseURL: process.env.OPENAI_API_ENDPOINT ?? '', | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { OpenAI } from '@ai-sdk/openai'; | ||
import { createOpenAI } from '@ai-sdk/openai'; | ||
import { experimental_streamObject, ExperimentalMessage } from 'ai'; | ||
import { createStreamableUI, createStreamableValue } from 'ai/rsc'; | ||
import { z } from 'zod'; | ||
|
@@ -26,7 +26,7 @@ export const clarifier = async (uiStream: ReturnType<typeof createStreamableUI>, | |
|
||
let clarifierResponse: TClarifier = {}; | ||
|
||
const openai = new OpenAI({ | ||
const openai = createOpenAI({ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. question (code_refinement): Check consistency of API key and endpoint usage in |
||
apiKey: currentProviderSettings?.OpenAI?.apiKey ?? process.env.OPENAI_API_KEY ?? '', | ||
// baseURL: currentProviderSettings?.OpenAI?.endpoint ?? process.env.OPENAI_API_ENDPOINT ?? 'https://api.openai.com/v1', | ||
}); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { OpenAI } from '@ai-sdk/openai'; | ||
import { createOpenAI } from '@ai-sdk/openai'; | ||
import { experimental_streamObject, ExperimentalMessage } from 'ai'; | ||
import { createStreamableUI, createStreamableValue } from 'ai/rsc'; | ||
import { z } from 'zod'; | ||
|
@@ -20,7 +20,7 @@ export const illustrator = async (uiStream: ReturnType<typeof createStreamableUI | |
|
||
uiStream.append(<Related relatedQueries={objectStream.value} />); | ||
|
||
const openai = new OpenAI({ | ||
const openai = createOpenAI({ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. question (code_refinement): Validate that |
||
apiKey: currentProviderSettings?.OpenAI?.apiKey ?? process.env.OPENAI_API_KEY ?? '', | ||
// baseURL: currentProviderSettings?.OpenAI?.endpoint ?? process.env.OPENAI_API_ENDPOINT ?? 'https://api.openai.com/v1', | ||
}); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question (code_refinement): Check if
createOpenAI
supports all previous functionalities ofOpenAI
class.