| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312 |
- // @ts-ignore
- /* eslint-disable */
- import request from '@repo/api-client'
- /** 检查模型 POST /api/ai/model/check */
- export async function postModelCheck(
- body: {
- name: string
- type: string
- source: string
- provider: string
- api_key: string
- },
- options?: { [key: string]: any }
- ) {
- return request<{
- isSuccess: boolean
- code: number
- isAuthorized: boolean
- result?: Record<string, any>
- }>('/api/ai/model/check', {
- method: 'POST',
- headers: {
- 'Content-Type': 'application/json'
- },
- data: body,
- ...(options || {})
- })
- }
- /** 创建模型 POST /api/ai/model/create */
- export async function postModelCreate(
- body: {
- name: string
- title: string
- description: string
- type: string
- source: string
- provider: string
- base_url: string
- api_key: string
- custom_headers: Record<string, any>
- },
- options?: { [key: string]: any }
- ) {
- return request<{ isSuccess: boolean; code: number; isAuthorized: boolean }>(
- '/api/ai/model/create',
- {
- method: 'POST',
- headers: {
- 'Content-Type': 'application/json'
- },
- data: body,
- ...(options || {})
- }
- )
- }
- /** 更新凭证 POST /api/ai/model/credentials */
- export async function postModelCredentials(
- body: {
- id: string
- api_key: string
- },
- options?: { [key: string]: any }
- ) {
- return request<{ isSuccess: boolean; code: number; isAuthorized: boolean }>(
- '/api/ai/model/credentials',
- {
- method: 'POST',
- headers: {
- 'Content-Type': 'application/json'
- },
- data: body,
- ...(options || {})
- }
- )
- }
- /** 删除模型 POST /api/ai/model/delete */
- export async function postModelOpenApiDelete(
- body: {
- id: string
- },
- options?: { [key: string]: any }
- ) {
- return request<{ isSuccess: boolean; code: number; isAuthorized: boolean }>(
- '/api/ai/model/delete',
- {
- method: 'POST',
- headers: {
- 'Content-Type': 'application/json'
- },
- data: body,
- ...(options || {})
- }
- )
- }
- /** 删除凭证 POST /api/ai/model/delete_credentials */
- export async function postModelDeleteCredentials(
- body: {
- id: string
- },
- options?: { [key: string]: any }
- ) {
- return request<{ isSuccess: boolean; code: number; isAuthorized: boolean }>(
- '/api/ai/model/delete_credentials',
- {
- method: 'POST',
- headers: {
- 'Content-Type': 'application/json'
- },
- data: body,
- ...(options || {})
- }
- )
- }
- /** 模型详情 POST /api/ai/model/info */
- export async function postModelInfo(
- body: {
- id: string
- },
- options?: { [key: string]: any }
- ) {
- return request<{
- isSuccess: boolean
- code: number
- result: {
- creationTime: string
- creatorUserId: string
- description: string
- id: string
- isDeleted: boolean
- is_default: boolean
- name: string
- parameters: {
- api_key: string
- base_url: string
- embedding_parameters: { dimension: number; truncate_prompt_tokens: number }
- provider: string
- }
- provider: string
- source: string
- status: string
- title: string
- type: string
- updateTime: string
- }
- isAuthorized: boolean
- }>('/api/ai/model/info', {
- method: 'POST',
- headers: {
- 'Content-Type': 'application/json'
- },
- data: body,
- ...(options || {})
- })
- }
- /** 获取模型分页列表 POST /api/ai/model/pageList */
- export async function postModelPageList(
- body: {
- keyword: string
- type: string
- source: string
- pageIndex: number
- pageSize: number
- },
- options?: { [key: string]: any }
- ) {
- return request<{
- isSuccess: boolean
- code: number
- result: {
- currentPage: number
- hasNextPage: boolean
- hasPreviousPage: boolean
- model: {
- creationTime?: string
- creatorUserId?: string
- description?: string
- id?: string
- isDeleted?: boolean
- is_default?: boolean
- name?: string
- parameters: {
- api_key: string
- base_url: string
- embedding_parameters: { dimension: number; truncate_prompt_tokens: number }
- provider: string
- }
- provider?: string
- source?: string
- status?: string
- title?: string
- type?: string
- updateTime?: string
- }[]
- pageSize: number
- totalCount: number
- totalPages: number
- }
- isAuthorized: boolean
- }>('/api/ai/model/pageList', {
- method: 'POST',
- headers: {
- 'Content-Type': 'application/json'
- },
- data: body,
- ...(options || {})
- })
- }
- /** 根据模型类型获取支持的服务商列表及配置信息 POST /api/ai/model/providers */
- export async function postModelProviders(
- body: {
- model_type: string
- },
- options?: { [key: string]: any }
- ) {
- return request<{
- isSuccess: boolean
- code: number
- result: {
- defaultUrls: { chat: string; embedding: string; rerank: string; vllm: string }
- description: string
- label: string
- modelTypes: string[]
- value: string
- }[]
- isAuthorized: boolean
- }>('/api/ai/model/providers', {
- method: 'POST',
- headers: {
- 'Content-Type': 'application/json'
- },
- data: body,
- ...(options || {})
- })
- }
- /** 获取模型选择列表 POST /api/ai/model/selectList */
- export async function postModelSelectList(
- body: {
- keyword?: string
- type?: string
- },
- options?: { [key: string]: any }
- ) {
- return request<{
- isSuccess: boolean
- code: number
- result: {
- creationTime?: string
- creatorUserId?: string
- description?: string
- id?: string
- isDeleted?: boolean
- is_default?: boolean
- name?: string
- parameters: {
- api_key: string
- base_url: string
- embedding_parameters: { dimension: number; truncate_prompt_tokens: number }
- provider: string
- }
- provider?: string
- source?: string
- status?: string
- title?: string
- type?: string
- updateTime?: string
- }[]
- isAuthorized: boolean
- }>('/api/ai/model/selectList', {
- method: 'POST',
- headers: {
- 'Content-Type': 'application/json'
- },
- data: body,
- ...(options || {})
- })
- }
- /** 更新模型 POST /api/ai/model/update */
- export async function postModelUpdate(
- body: {
- id: string
- name: string
- title: string
- description: string
- base_url: string
- api_key: string
- custom_headers: Record<string, any>
- },
- options?: { [key: string]: any }
- ) {
- return request<{ isSuccess: boolean; code: number; isAuthorized: boolean }>(
- '/api/ai/model/update',
- {
- method: 'POST',
- headers: {
- 'Content-Type': 'application/json'
- },
- data: body,
- ...(options || {})
- }
- )
- }
|