mirror of
https://github.com/voideditor/void
synced 2026-05-24 09:58:23 +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 Anthropic from '@anthropic-ai/sdk';
|
||||||
import { Ollama } from 'ollama';
|
import { Ollama } from 'ollama';
|
||||||
import OpenAI, { ClientOptions, AzureOpenAI } from 'openai';
|
import OpenAI, { ClientOptions, AzureOpenAI } from 'openai';
|
||||||
import { getBearerTokenProvider, DefaultAzureCredential } from '@azure/identity';
|
|
||||||
import { MistralCore } from '@mistralai/mistralai/core.js';
|
import { MistralCore } from '@mistralai/mistralai/core.js';
|
||||||
import { fimComplete } from '@mistralai/mistralai/funcs/fimComplete.js';
|
import { fimComplete } from '@mistralai/mistralai/funcs/fimComplete.js';
|
||||||
import { Tool as GeminiTool, FunctionDeclaration, GoogleGenAI, ThinkingConfig, Schema, Type } from '@google/genai';
|
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') {
|
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
|
// 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 thisConfig = settingsOfProvider[providerName]
|
||||||
const scope = thisConfig.project
|
return new AzureOpenAI({ apiKey: thisConfig.apiKey, apiVersion: thisConfig.azureApiVersion, project: thisConfig.project })
|
||||||
const azureADTokenProvider = getBearerTokenProvider(credential, scope)
|
|
||||||
return new AzureOpenAI({ azureADTokenProvider, apiVersion: thisConfig.azureApiVersion })
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (providerName === 'deepseek') {
|
else if (providerName === 'deepseek') {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue