mirror of
https://github.com/voideditor/void
synced 2026-05-23 01:18:25 +00:00
update azure
This commit is contained in:
parent
aafe556333
commit
e771edbe2e
1 changed files with 1 additions and 5 deletions
|
|
@ -8,7 +8,6 @@
|
|||
import Anthropic from '@anthropic-ai/sdk';
|
||||
import { Ollama } from 'ollama';
|
||||
import OpenAI, { ClientOptions, AzureOpenAI } from 'openai';
|
||||
import { getBearerTokenProvider, DefaultAzureCredential } from '@azure/identity';
|
||||
import { MistralCore } from '@mistralai/mistralai/core.js';
|
||||
import { fimComplete } from '@mistralai/mistralai/funcs/fimComplete.js';
|
||||
import { Tool as GeminiTool, FunctionDeclaration, GoogleGenAI, ThinkingConfig, Schema, Type } from '@google/genai';
|
||||
|
|
@ -115,11 +114,8 @@ const newOpenAICompatibleSDK = async ({ settingsOfProvider, providerName, includ
|
|||
}
|
||||
else if (providerName === 'microsoftAzure') {
|
||||
// https://learn.microsoft.com/en-us/rest/api/aifoundry/model-inference/get-chat-completions/get-chat-completions?view=rest-aifoundry-model-inference-2024-05-01-preview&tabs=HTTP
|
||||
const credential = new DefaultAzureCredential()
|
||||
const thisConfig = settingsOfProvider[providerName]
|
||||
const scope = thisConfig.project
|
||||
const azureADTokenProvider = getBearerTokenProvider(credential, scope)
|
||||
return new AzureOpenAI({ azureADTokenProvider, apiVersion: thisConfig.azureApiVersion })
|
||||
return new AzureOpenAI({ apiKey: thisConfig.apiKey, apiVersion: thisConfig.azureApiVersion, project: thisConfig.project })
|
||||
}
|
||||
|
||||
else if (providerName === 'deepseek') {
|
||||
|
|
|
|||
Loading…
Reference in a new issue