refactor: migrate to new providers package (#846)
This commit is contained in:
@@ -30,7 +30,7 @@
|
||||
"@stdlib/string-base-kebabcase": "^0.2.2",
|
||||
"@vueuse/core": "^14.1.0",
|
||||
"@vueuse/shared": "^14.1.0",
|
||||
"@xsai-ext/shared-providers": "catalog:",
|
||||
"@xsai-ext/providers": "catalog:",
|
||||
"@xsai/generate-speech": "catalog:",
|
||||
"@xsai/stream-transcription": "0.4.0-beta.8",
|
||||
"animejs": "^4.2.2",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import type { SpeechProviderWithExtraOptions } from '@xsai-ext/shared-providers'
|
||||
import type { SpeechProviderWithExtraOptions } from '@xsai-ext/providers/utils'
|
||||
|
||||
import {
|
||||
Alert,
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import type { SpeechProviderWithExtraOptions } from '@xsai-ext/shared-providers'
|
||||
import type { SpeechProviderWithExtraOptions } from '@xsai-ext/providers/utils'
|
||||
import type { UnElevenLabsOptions } from 'unspeech'
|
||||
|
||||
import {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import type { SpeechProvider } from '@xsai-ext/shared-providers'
|
||||
import type { SpeechProvider } from '@xsai-ext/providers/utils'
|
||||
|
||||
import {
|
||||
SpeechPlayground,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import type { SpeechProviderWithExtraOptions } from '@xsai-ext/shared-providers'
|
||||
import type { SpeechProviderWithExtraOptions } from '@xsai-ext/providers/utils'
|
||||
import type { UnElevenLabsOptions } from 'unspeech'
|
||||
|
||||
import {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import type { SpeechProvider } from '@xsai-ext/shared-providers'
|
||||
import type { SpeechProvider } from '@xsai-ext/providers/utils'
|
||||
|
||||
import {
|
||||
SpeechPlayground,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import type { SpeechProviderWithExtraOptions } from '@xsai-ext/shared-providers'
|
||||
import type { SpeechProviderWithExtraOptions } from '@xsai-ext/providers/utils'
|
||||
import type { UnMicrosoftOptions } from 'unspeech'
|
||||
|
||||
import {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import type { SpeechProvider } from '@xsai-ext/shared-providers'
|
||||
import type { SpeechProvider } from '@xsai-ext/providers/utils'
|
||||
|
||||
import {
|
||||
SpeechPlayground,
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import type { RemovableRef } from '@vueuse/core'
|
||||
import type { SpeechProvider } from '@xsai-ext/shared-providers'
|
||||
import type { SpeechProvider } from '@xsai-ext/providers/utils'
|
||||
|
||||
import {
|
||||
Alert,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import type { SpeechProviderWithExtraOptions } from '@xsai-ext/shared-providers'
|
||||
import type { SpeechProviderWithExtraOptions } from '@xsai-ext/providers/utils'
|
||||
import type { UnElevenLabsOptions } from 'unspeech'
|
||||
|
||||
import {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import type { SpeechProviderWithExtraOptions } from '@xsai-ext/shared-providers'
|
||||
import type { SpeechProviderWithExtraOptions } from '@xsai-ext/providers/utils'
|
||||
import type { UnElevenLabsOptions } from 'unspeech'
|
||||
|
||||
import {
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
import type { HearingTranscriptionResult } from '@proj-airi/stage-ui/stores/modules/hearing'
|
||||
import type { ServerEvent, ServerEvents } from '@proj-airi/stage-ui/stores/providers/aliyun'
|
||||
import type { RemovableRef } from '@vueuse/core'
|
||||
import type { TranscriptionProviderWithExtraOptions } from '@xsai-ext/shared-providers'
|
||||
import type { TranscriptionProviderWithExtraOptions } from '@xsai-ext/providers/utils'
|
||||
|
||||
import vadWorkletUrl from '@proj-airi/stage-ui/workers/vad/process.worklet?worker&url'
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import type { RemovableRef } from '@vueuse/core'
|
||||
import type { TranscriptionProviderWithExtraOptions } from '@xsai-ext/shared-providers'
|
||||
import type { TranscriptionProviderWithExtraOptions } from '@xsai-ext/providers/utils'
|
||||
|
||||
import {
|
||||
Alert,
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import type { TranscriptionProviderWithExtraOptions } from '@xsai-ext/shared-providers'
|
||||
import type { TranscriptionProviderWithExtraOptions } from '@xsai-ext/providers/utils'
|
||||
|
||||
import {
|
||||
TranscriptionPlayground,
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import type { RemovableRef } from '@vueuse/core'
|
||||
import type { TranscriptionProviderWithExtraOptions } from '@xsai-ext/shared-providers'
|
||||
import type { TranscriptionProviderWithExtraOptions } from '@xsai-ext/providers/utils'
|
||||
|
||||
import {
|
||||
Alert,
|
||||
|
||||
@@ -87,9 +87,7 @@
|
||||
"@vueuse/core": "^14.1.0",
|
||||
"@vueuse/motion": "^3.0.3",
|
||||
"@vueuse/shared": "^14.1.0",
|
||||
"@xsai-ext/providers-cloud": "catalog:",
|
||||
"@xsai-ext/providers-local": "catalog:",
|
||||
"@xsai-ext/shared-providers": "catalog:",
|
||||
"@xsai-ext/providers": "catalog:",
|
||||
"@xsai-transformers/embed": "^0.0.11",
|
||||
"@xsai-transformers/shared": "^0.0.11",
|
||||
"@xsai/embed": "catalog:",
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import type { DuckDBWasmDrizzleDatabase } from '@proj-airi/drizzle-duckdb-wasm'
|
||||
import type { Live2DLipSync, Live2DLipSyncOptions } from '@proj-airi/model-driver-lipsync'
|
||||
import type { Profile } from '@proj-airi/model-driver-lipsync/shared/wlipsync'
|
||||
import type { SpeechProviderWithExtraOptions } from '@xsai-ext/shared-providers'
|
||||
import type { SpeechProviderWithExtraOptions } from '@xsai-ext/providers/utils'
|
||||
import type { UnElevenLabsOptions } from 'unspeech'
|
||||
|
||||
import type { TextSegmentationItem } from '../../composables/queues'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { ChatProvider } from '@xsai-ext/shared-providers'
|
||||
import type { ChatProvider } from '@xsai-ext/providers/utils'
|
||||
import type { CommonContentPart, Message, SystemMessage, ToolMessage } from '@xsai/shared-chat'
|
||||
|
||||
import type { StreamEvent, StreamOptions } from '../stores/llm'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { env } from 'node:process'
|
||||
|
||||
import { createOpenRouter } from '@xsai-ext/providers-cloud'
|
||||
import { createOpenRouter } from '@xsai-ext/providers/create'
|
||||
import { describe, expect, it } from 'vitest'
|
||||
|
||||
import { attemptForToolsCompatibilityDiscovery } from './llm'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { ChatProvider } from '@xsai-ext/shared-providers'
|
||||
import type { ChatProvider } from '@xsai-ext/providers/utils'
|
||||
import type { CommonContentPart, CompletionToolCall, Message, Tool } from '@xsai/shared-chat'
|
||||
|
||||
import { listModels } from '@xsai/model'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { TranscriptionProviderWithExtraOptions } from '@xsai-ext/shared-providers'
|
||||
import type { TranscriptionProviderWithExtraOptions } from '@xsai-ext/providers/utils'
|
||||
import type { WithUnknown } from '@xsai/shared'
|
||||
import type { StreamTranscriptionResult, StreamTranscriptionOptions as XSAIStreamTranscriptionOptions } from '@xsai/stream-transcription'
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { SpeechProviderWithExtraOptions } from '@xsai-ext/shared-providers'
|
||||
import type { SpeechProviderWithExtraOptions } from '@xsai-ext/providers/utils'
|
||||
|
||||
import type { VoiceInfo } from '../providers'
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import type {
|
||||
SpeechProviderWithExtraOptions,
|
||||
TranscriptionProvider,
|
||||
TranscriptionProviderWithExtraOptions,
|
||||
} from '@xsai-ext/shared-providers'
|
||||
} from '@xsai-ext/providers/utils'
|
||||
import type { ProgressInfo } from '@xsai-transformers/shared/types'
|
||||
import type {
|
||||
UnAlibabaCloudOptions,
|
||||
@@ -22,31 +22,29 @@ import type { AliyunRealtimeSpeechExtraOptions } from './providers/aliyun/stream
|
||||
import { isStageTamagotchi, isUrl } from '@proj-airi/stage-shared'
|
||||
import { computedAsync, useLocalStorage } from '@vueuse/core'
|
||||
import {
|
||||
createAzure,
|
||||
createCerebras,
|
||||
createDeepSeek,
|
||||
createFireworks,
|
||||
createGoogleGenerativeAI,
|
||||
createMistral,
|
||||
createMoonshot,
|
||||
createMoonshotai,
|
||||
createNovita,
|
||||
createOllama,
|
||||
createOpenAI,
|
||||
createOpenRouter,
|
||||
createPerplexity,
|
||||
createTogetherAI,
|
||||
createWorkersAI,
|
||||
createXAI,
|
||||
} from '@xsai-ext/providers-cloud'
|
||||
import { createOllama, createPlayer2 } from '@xsai-ext/providers-local'
|
||||
createXai,
|
||||
} from '@xsai-ext/providers/create'
|
||||
import { createAzure, createPlayer2, createWorkersAI } from '@xsai-ext/providers/special/create'
|
||||
import {
|
||||
createChatProvider,
|
||||
createEmbedProvider,
|
||||
createMetadataProvider,
|
||||
createModelProvider,
|
||||
createSpeechProvider,
|
||||
createTranscriptionProvider,
|
||||
merge,
|
||||
} from '@xsai-ext/shared-providers'
|
||||
} from '@xsai-ext/providers/utils'
|
||||
import { listModels } from '@xsai/model'
|
||||
import { isWebGPUSupported } from 'gpuu/webgpu'
|
||||
import { defineStore } from 'pinia'
|
||||
@@ -208,7 +206,6 @@ function createAnthropic(apiKey: string, baseURL: string = 'https://api.anthropi
|
||||
}
|
||||
|
||||
return merge(
|
||||
createMetadataProvider('anthropic'),
|
||||
/** @see {@link https://docs.anthropic.com/en/docs/about-claude/models/all-models} */
|
||||
createChatProvider({ apiKey, fetch: anthropicFetch, baseURL }),
|
||||
createModelProvider({ apiKey, fetch: anthropicFetch, baseURL }),
|
||||
@@ -1501,7 +1498,7 @@ export const useProvidersStore = defineStore('providers', () => {
|
||||
icon: 'i-lobe-icons:xai',
|
||||
description: 'x.ai',
|
||||
defaultBaseUrl: 'https://api.x.ai/v1/',
|
||||
creator: createXAI,
|
||||
creator: createXai,
|
||||
validation: ['health', 'model_list'],
|
||||
}),
|
||||
'vllm': {
|
||||
@@ -1709,7 +1706,7 @@ export const useProvidersStore = defineStore('providers', () => {
|
||||
icon: 'i-lobe-icons:moonshot',
|
||||
description: 'moonshot.ai',
|
||||
defaultBaseUrl: 'https://api.moonshot.ai/v1/',
|
||||
creator: createMoonshot,
|
||||
creator: createMoonshotai,
|
||||
validation: ['health', 'model_list'],
|
||||
}),
|
||||
'modelscope': buildOpenAICompatibleProvider({
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { SpeechProviderWithExtraOptions } from '@xsai-ext/shared-providers'
|
||||
import type { SpeechProviderWithExtraOptions } from '@xsai-ext/providers/utils'
|
||||
import type { CommonRequestOptions } from '@xsai/shared'
|
||||
import type { StreamTranscriptionDelta, StreamTranscriptionResult } from '@xsai/stream-transcription'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user