Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/components/settings/modelProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const ModelProvider = () => {
anthropic: 'claude-3-5-sonnet-20241022',
google: 'gemini-1.5-flash-latest',
azure: '',
groq: 'gemma-7b-it',
groq: 'gemma2-9b-it',
cohere: 'command-r-plus',
mistralai: 'mistral-large-latest',
perplexity: 'llama-3-sonar-large-32k-online',
Expand Down Expand Up @@ -637,8 +637,10 @@ const ModelProvider = () => {
})
}
>
<option value="gemma-7b-it">gemma-7b-it</option>
<option value="llama3-70b-8192">llama3-70b-8192</option>
<option value="gemma2-9b-it">gemma2-9b-it</option>
<option value="llama-3.3-70b-versatile">
llama-3.3-70b-versatile
</option>
<option value="llama3-8b-8192">llama3-8b-8192</option>
<option value="mixtral-8x7b-32768">mixtral-8x7b-32768</option>
</select>
Expand Down
4 changes: 0 additions & 4 deletions src/features/chat/vercelAIChat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ const getAIConfig = () => {
const ss = settingsStore.getState()
const aiService = ss.selectAIService as multiModalAIServiceKey

if (!multiModalAIServices.includes(aiService)) {
throw new Error('Invalid AI service')
}

const apiKeyName = `${aiService}Key` as const
const apiKey = ss[apiKeyName]

Expand Down
7 changes: 6 additions & 1 deletion src/features/stores/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ import {
AudioModeInputType,
} from '../constants/settings'

export const multiModalAIServices = ['openai', 'anthropic', 'google'] as const
export const multiModalAIServices = [
'openai',
'anthropic',
'google',
'azure',
] as const
export type multiModalAIServiceKey = (typeof multiModalAIServices)[number]

type multiModalAPIKeys = {
Expand Down
1 change: 1 addition & 0 deletions src/pages/api/convertSlide.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ async function createSlideLine(
openai: () => createOpenAI({ apiKey }),
anthropic: () => createAnthropic({ apiKey }),
google: () => createGoogleGenerativeAI({ apiKey }),
azure: () => {},
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Azure OpenAI Serviceの実装が不完全です

空の実装({})では、Azure OpenAI Serviceのリクエストを正しく処理できません。これにより、ランタイムエラーが発生する可能性があります。

以下のような実装を検討してください:

-    azure: () => {},
+    azure: () => createOpenAI({
+      apiKey,
+      azure: {
+        apiKey,
+        endpoint: process.env.AZURE_OPENAI_ENDPOINT,
+        deploymentName: process.env.AZURE_OPENAI_DEPLOYMENT_NAME
+      }
+    }),

また、必要な環境変数を.envファイルに追加することをお忘れなく:

AZURE_OPENAI_ENDPOINT=your-endpoint-here
AZURE_OPENAI_DEPLOYMENT_NAME=your-deployment-name-here

Committable suggestion skipped: line range outside the PR's diff.

}

const aiServiceInstance = aiServiceConfig[aiService as multiModalAIServiceKey]
Expand Down
Loading