-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a6976ad
commit 555b915
Showing
11 changed files
with
90 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
export { embed, embed as default, type EmbedOptions, type EmbedResponseUsage, type EmbedResult } from './utils/embed' | ||
export { embed as default, embed, type EmbedOptions, type EmbedResponseUsage, type EmbedResult } from './utils/embed' | ||
export { embedMany, type EmbedManyOptions, type EmbedManyResult } from './utils/embed-many' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,31 @@ | ||
import type { CommonRequestOptions } from '@xsai/shared' | ||
|
||
/** T: required apiKey */ | ||
export type ProviderOptions<T extends boolean = false> = | ||
T extends true | ||
? Partial<Omit<ProviderResult, 'apiKey'>> & Required<Pick<ProviderResult, 'apiKey'>> | ||
: Partial<ProviderResult> | ||
|
||
export type ProviderResult = Omit<CommonRequestOptions, 'model'> & Partial<Pick<CommonRequestOptions, 'model'>> | ||
|
||
export interface ChatProvider<T extends string = string> { | ||
chat: (model: ({} & string) | T) => CommonRequestOptions | ||
chat: (model: (string & {}) | T) => CommonRequestOptions | ||
} | ||
|
||
export interface EmbedProvider<T extends string = string> { | ||
embed: (model: ({} & string) | T) => CommonRequestOptions | ||
embed: (model: (string & {}) | T) => CommonRequestOptions | ||
} | ||
|
||
export interface ModelProvider { | ||
model: () => ProviderResult | ||
} | ||
|
||
/** T: required apiKey */ | ||
export type ProviderOptions<T extends boolean = false> = | ||
T extends true | ||
? Partial<Omit<ProviderResult, 'apiKey'>> & Required<Pick<ProviderResult, 'apiKey'>> | ||
: Partial<ProviderResult> | ||
|
||
export type ProviderResult = Omit<CommonRequestOptions, 'model'> & Partial<Pick<CommonRequestOptions, 'model'>> | ||
|
||
export interface SpeechProvider<T extends string = string, T2 = undefined> { | ||
speech: T2 extends undefined | ||
? (model: ({} & string) | T) => CommonRequestOptions | ||
: (model: ({} & string) | T, extraOptions?: T2) => CommonRequestOptions & T2 | ||
? (model: (string & {}) | T) => CommonRequestOptions | ||
: (model: (string & {}) | T, extraOptions?: T2) => CommonRequestOptions & T2 | ||
} | ||
|
||
export interface TranscriptionProvider<T extends string = string> { | ||
transcription: (model: ({} & string) | T) => CommonRequestOptions | ||
transcription: (model: (string & {}) | T) => CommonRequestOptions | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export type FinishReason = 'content_filter' | 'error' | 'length' | 'other' | 'stop' | 'tool-calls' | ({} & string) | ||
export type FinishReason = 'content_filter' | 'error' | 'length' | 'other' | 'stop' | 'tool-calls' | (string & {}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters