This commit is contained in:
parent
0068d9a0e9
commit
2b771db5dd
157
api/swagger.yaml
157
api/swagger.yaml
@ -263,6 +263,25 @@ definitions:
|
||||
user_id:
|
||||
type: string
|
||||
type: object
|
||||
page.PagedResult-schema_AssistantPublic:
|
||||
properties:
|
||||
data:
|
||||
items:
|
||||
$ref: '#/definitions/schema.AssistantPublic'
|
||||
type: array
|
||||
page:
|
||||
description: 当前页码
|
||||
type: integer
|
||||
page_size:
|
||||
description: 每页大小
|
||||
type: integer
|
||||
total_count:
|
||||
description: 数据总条数
|
||||
type: integer
|
||||
total_pages:
|
||||
description: 总页数
|
||||
type: integer
|
||||
type: object
|
||||
schema.AddPublicChatMessageRequest:
|
||||
properties:
|
||||
assistant_key:
|
||||
@ -325,6 +344,15 @@ definitions:
|
||||
required:
|
||||
- library_id
|
||||
type: object
|
||||
schema.AssistantPublic:
|
||||
properties:
|
||||
description:
|
||||
type: string
|
||||
id:
|
||||
type: integer
|
||||
name:
|
||||
type: string
|
||||
type: object
|
||||
schema.AssistantUpdateRequest:
|
||||
properties:
|
||||
description:
|
||||
@ -353,6 +381,11 @@ definitions:
|
||||
prompt:
|
||||
maxLength: 512
|
||||
type: string
|
||||
public:
|
||||
enum:
|
||||
- true
|
||||
- false
|
||||
type: boolean
|
||||
temperature:
|
||||
enum:
|
||||
- 0.1
|
||||
@ -590,6 +623,13 @@ definitions:
|
||||
success:
|
||||
type: boolean
|
||||
type: object
|
||||
schema.SiteUsageResponse:
|
||||
properties:
|
||||
month_tokens:
|
||||
type: integer
|
||||
month_tool_calls:
|
||||
type: integer
|
||||
type: object
|
||||
schema.TokenUsage:
|
||||
properties:
|
||||
completion_tokens:
|
||||
@ -1125,10 +1165,14 @@ paths:
|
||||
summary: 绑定 Tool
|
||||
tags:
|
||||
- assistant
|
||||
/api/v1/assistants/public:
|
||||
/api/v1/assistants/favorites:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
parameters:
|
||||
- in: query
|
||||
name: page
|
||||
type: integer
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
@ -1139,9 +1183,36 @@ paths:
|
||||
- $ref: '#/definitions/schema.ResponseBody'
|
||||
- properties:
|
||||
data:
|
||||
items:
|
||||
$ref: '#/definitions/entity.Assistant'
|
||||
type: array
|
||||
$ref: '#/definitions/page.PagedResult-schema_AssistantPublic'
|
||||
type: object
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
$ref: '#/definitions/schema.ResponseBody'
|
||||
security:
|
||||
- ApiKeyAuth: []
|
||||
summary: 收藏的助理列表
|
||||
tags:
|
||||
- assistant
|
||||
/api/v1/assistants/public:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
parameters:
|
||||
- in: query
|
||||
name: page
|
||||
type: integer
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
allOf:
|
||||
- $ref: '#/definitions/schema.ResponseBody'
|
||||
- properties:
|
||||
data:
|
||||
$ref: '#/definitions/page.PagedResult-schema_AssistantPublic'
|
||||
type: object
|
||||
"400":
|
||||
description: Bad Request
|
||||
@ -1152,6 +1223,65 @@ paths:
|
||||
summary: 获取公开的助理列表
|
||||
tags:
|
||||
- assistant
|
||||
/api/v1/assistants/public/{id}:
|
||||
delete:
|
||||
consumes:
|
||||
- application/json
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
type: integer
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
allOf:
|
||||
- $ref: '#/definitions/schema.ResponseBody'
|
||||
- properties:
|
||||
data:
|
||||
$ref: '#/definitions/schema.AssistantPublic'
|
||||
type: object
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
$ref: '#/definitions/schema.ResponseBody'
|
||||
security:
|
||||
- ApiKeyAuth: []
|
||||
summary: 取消收藏助理
|
||||
tags:
|
||||
- assistant
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
type: integer
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
allOf:
|
||||
- $ref: '#/definitions/schema.ResponseBody'
|
||||
- properties:
|
||||
data:
|
||||
$ref: '#/definitions/schema.AssistantPublic'
|
||||
type: object
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
$ref: '#/definitions/schema.ResponseBody'
|
||||
security:
|
||||
- ApiKeyAuth: []
|
||||
summary: 收藏助理
|
||||
tags:
|
||||
- assistant
|
||||
/api/v1/chat_public:
|
||||
get:
|
||||
consumes:
|
||||
@ -2347,6 +2477,25 @@ paths:
|
||||
summary: 校验 Discovery 语法
|
||||
tags:
|
||||
- tool
|
||||
/api/v1/usage:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
allOf:
|
||||
- $ref: '#/definitions/schema.ResponseBody'
|
||||
- properties:
|
||||
data:
|
||||
$ref: '#/definitions/schema.SiteUsageResponse'
|
||||
type: object
|
||||
summary: 获取站点 Usage
|
||||
tags:
|
||||
- usage
|
||||
securityDefinitions:
|
||||
ApiKeyAuth:
|
||||
in: header
|
||||
|
520
src/api/api.ts
520
src/api/api.ts
@ -23,6 +23,37 @@ import type { RequestArgs } from './base';
|
||||
// @ts-ignore
|
||||
import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError, operationServerMap } from './base';
|
||||
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface ApiV1AssistantsFavoritesGet200Response
|
||||
*/
|
||||
export interface ApiV1AssistantsFavoritesGet200Response {
|
||||
/**
|
||||
*
|
||||
* @type {PagePagedResultSchemaAssistantPublic}
|
||||
* @memberof ApiV1AssistantsFavoritesGet200Response
|
||||
*/
|
||||
'data'?: PagePagedResultSchemaAssistantPublic;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ApiV1AssistantsFavoritesGet200Response
|
||||
*/
|
||||
'error'?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ApiV1AssistantsFavoritesGet200Response
|
||||
*/
|
||||
'message'?: string;
|
||||
/**
|
||||
*
|
||||
* @type {boolean}
|
||||
* @memberof ApiV1AssistantsFavoritesGet200Response
|
||||
*/
|
||||
'success'?: boolean;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
@ -209,6 +240,37 @@ export interface ApiV1AssistantsPost200Response {
|
||||
*/
|
||||
'success'?: boolean;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface ApiV1AssistantsPublicIdPost200Response
|
||||
*/
|
||||
export interface ApiV1AssistantsPublicIdPost200Response {
|
||||
/**
|
||||
*
|
||||
* @type {SchemaAssistantPublic}
|
||||
* @memberof ApiV1AssistantsPublicIdPost200Response
|
||||
*/
|
||||
'data'?: SchemaAssistantPublic;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ApiV1AssistantsPublicIdPost200Response
|
||||
*/
|
||||
'error'?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ApiV1AssistantsPublicIdPost200Response
|
||||
*/
|
||||
'message'?: string;
|
||||
/**
|
||||
*
|
||||
* @type {boolean}
|
||||
* @memberof ApiV1AssistantsPublicIdPost200Response
|
||||
*/
|
||||
'success'?: boolean;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
@ -631,6 +693,37 @@ export interface ApiV1ToolsPost200Response {
|
||||
*/
|
||||
'success'?: boolean;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface ApiV1UsageGet200Response
|
||||
*/
|
||||
export interface ApiV1UsageGet200Response {
|
||||
/**
|
||||
*
|
||||
* @type {SchemaSiteUsageResponse}
|
||||
* @memberof ApiV1UsageGet200Response
|
||||
*/
|
||||
'data'?: SchemaSiteUsageResponse;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ApiV1UsageGet200Response
|
||||
*/
|
||||
'error'?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ApiV1UsageGet200Response
|
||||
*/
|
||||
'message'?: string;
|
||||
/**
|
||||
*
|
||||
* @type {boolean}
|
||||
* @memberof ApiV1UsageGet200Response
|
||||
*/
|
||||
'success'?: boolean;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
@ -1333,6 +1426,43 @@ export interface EntityTool {
|
||||
*/
|
||||
'user_id'?: string;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface PagePagedResultSchemaAssistantPublic
|
||||
*/
|
||||
export interface PagePagedResultSchemaAssistantPublic {
|
||||
/**
|
||||
*
|
||||
* @type {Array<SchemaAssistantPublic>}
|
||||
* @memberof PagePagedResultSchemaAssistantPublic
|
||||
*/
|
||||
'data'?: Array<SchemaAssistantPublic>;
|
||||
/**
|
||||
* 当前页码
|
||||
* @type {number}
|
||||
* @memberof PagePagedResultSchemaAssistantPublic
|
||||
*/
|
||||
'page'?: number;
|
||||
/**
|
||||
* 每页大小
|
||||
* @type {number}
|
||||
* @memberof PagePagedResultSchemaAssistantPublic
|
||||
*/
|
||||
'page_size'?: number;
|
||||
/**
|
||||
* 数据总条数
|
||||
* @type {number}
|
||||
* @memberof PagePagedResultSchemaAssistantPublic
|
||||
*/
|
||||
'total_count'?: number;
|
||||
/**
|
||||
* 总页数
|
||||
* @type {number}
|
||||
* @memberof PagePagedResultSchemaAssistantPublic
|
||||
*/
|
||||
'total_pages'?: number;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
@ -1425,6 +1555,31 @@ export interface SchemaAssistantLibraryRequest {
|
||||
*/
|
||||
'library_id': number;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface SchemaAssistantPublic
|
||||
*/
|
||||
export interface SchemaAssistantPublic {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof SchemaAssistantPublic
|
||||
*/
|
||||
'description'?: string;
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof SchemaAssistantPublic
|
||||
*/
|
||||
'id'?: number;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof SchemaAssistantPublic
|
||||
*/
|
||||
'name'?: string;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
@ -1473,6 +1628,12 @@ export interface SchemaAssistantUpdateRequest {
|
||||
* @memberof SchemaAssistantUpdateRequest
|
||||
*/
|
||||
'prompt'?: string;
|
||||
/**
|
||||
*
|
||||
* @type {boolean}
|
||||
* @memberof SchemaAssistantUpdateRequest
|
||||
*/
|
||||
'public'?: boolean;
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
@ -1973,6 +2134,25 @@ export interface SchemaResponseBody {
|
||||
*/
|
||||
'success'?: boolean;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface SchemaSiteUsageResponse
|
||||
*/
|
||||
export interface SchemaSiteUsageResponse {
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof SchemaSiteUsageResponse
|
||||
*/
|
||||
'month_tokens'?: number;
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof SchemaSiteUsageResponse
|
||||
*/
|
||||
'month_tool_calls'?: number;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
@ -2179,6 +2359,44 @@ export interface SchemaToolDiscoveryOutputFunctions {
|
||||
*/
|
||||
export const AssistantApiAxiosParamCreator = function (configuration?: Configuration) {
|
||||
return {
|
||||
/**
|
||||
*
|
||||
* @summary 收藏的助理列表
|
||||
* @param {number} [page]
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
apiV1AssistantsFavoritesGet: async (page?: number, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||
const localVarPath = `/api/v1/assistants/favorites`;
|
||||
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
||||
let baseOptions;
|
||||
if (configuration) {
|
||||
baseOptions = configuration.baseOptions;
|
||||
}
|
||||
|
||||
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication ApiKeyAuth required
|
||||
await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)
|
||||
|
||||
if (page !== undefined) {
|
||||
localVarQueryParameter['page'] = page;
|
||||
}
|
||||
|
||||
|
||||
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
||||
|
||||
return {
|
||||
url: toPathString(localVarUrlObj),
|
||||
options: localVarRequestOptions,
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 获取 Assistant 列表
|
||||
@ -2685,10 +2903,11 @@ export const AssistantApiAxiosParamCreator = function (configuration?: Configura
|
||||
/**
|
||||
*
|
||||
* @summary 获取公开的助理列表
|
||||
* @param {number} [page]
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
apiV1AssistantsPublicGet: async (options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||
apiV1AssistantsPublicGet: async (page?: number, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||
const localVarPath = `/api/v1/assistants/public`;
|
||||
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
||||
@ -2704,6 +2923,84 @@ export const AssistantApiAxiosParamCreator = function (configuration?: Configura
|
||||
// authentication ApiKeyAuth required
|
||||
await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)
|
||||
|
||||
if (page !== undefined) {
|
||||
localVarQueryParameter['page'] = page;
|
||||
}
|
||||
|
||||
|
||||
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
||||
|
||||
return {
|
||||
url: toPathString(localVarUrlObj),
|
||||
options: localVarRequestOptions,
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 取消收藏助理
|
||||
* @param {number} id
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
apiV1AssistantsPublicIdDelete: async (id: number, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||
// verify required parameter 'id' is not null or undefined
|
||||
assertParamExists('apiV1AssistantsPublicIdDelete', 'id', id)
|
||||
const localVarPath = `/api/v1/assistants/public/{id}`
|
||||
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
|
||||
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
||||
let baseOptions;
|
||||
if (configuration) {
|
||||
baseOptions = configuration.baseOptions;
|
||||
}
|
||||
|
||||
const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options};
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication ApiKeyAuth required
|
||||
await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)
|
||||
|
||||
|
||||
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
||||
|
||||
return {
|
||||
url: toPathString(localVarUrlObj),
|
||||
options: localVarRequestOptions,
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 收藏助理
|
||||
* @param {number} id
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
apiV1AssistantsPublicIdPost: async (id: number, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||
// verify required parameter 'id' is not null or undefined
|
||||
assertParamExists('apiV1AssistantsPublicIdPost', 'id', id)
|
||||
const localVarPath = `/api/v1/assistants/public/{id}`
|
||||
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
|
||||
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
||||
let baseOptions;
|
||||
if (configuration) {
|
||||
baseOptions = configuration.baseOptions;
|
||||
}
|
||||
|
||||
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication ApiKeyAuth required
|
||||
await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)
|
||||
|
||||
|
||||
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||
@ -2725,6 +3022,19 @@ export const AssistantApiAxiosParamCreator = function (configuration?: Configura
|
||||
export const AssistantApiFp = function(configuration?: Configuration) {
|
||||
const localVarAxiosParamCreator = AssistantApiAxiosParamCreator(configuration)
|
||||
return {
|
||||
/**
|
||||
*
|
||||
* @summary 收藏的助理列表
|
||||