forked from Leaf/amber-ui
改进 首页
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 收藏的助理列表
|
||||
* @param {number} [page]
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async apiV1AssistantsFavoritesGet(page?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ApiV1AssistantsFavoritesGet200Response>> {
|
||||
const localVarAxiosArgs = await localVarAxiosParamCreator.apiV1AssistantsFavoritesGet(page, options);
|
||||
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
||||
const localVarOperationServerBasePath = operationServerMap['AssistantApi.apiV1AssistantsFavoritesGet']?.[localVarOperationServerIndex]?.url;
|
||||
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 获取 Assistant 列表
|
||||
@ -2901,15 +3211,42 @@ export const AssistantApiFp = function(configuration?: Configuration) {
|
||||
/**
|
||||
*
|
||||
* @summary 获取公开的助理列表
|
||||
* @param {number} [page]
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async apiV1AssistantsPublicGet(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ApiV1AssistantsGet200Response>> {
|
||||
const localVarAxiosArgs = await localVarAxiosParamCreator.apiV1AssistantsPublicGet(options);
|
||||
async apiV1AssistantsPublicGet(page?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ApiV1AssistantsFavoritesGet200Response>> {
|
||||
const localVarAxiosArgs = await localVarAxiosParamCreator.apiV1AssistantsPublicGet(page, options);
|
||||
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
||||
const localVarOperationServerBasePath = operationServerMap['AssistantApi.apiV1AssistantsPublicGet']?.[localVarOperationServerIndex]?.url;
|
||||
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 取消收藏助理
|
||||
* @param {number} id
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async apiV1AssistantsPublicIdDelete(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ApiV1AssistantsPublicIdPost200Response>> {
|
||||
const localVarAxiosArgs = await localVarAxiosParamCreator.apiV1AssistantsPublicIdDelete(id, options);
|
||||
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
||||
const localVarOperationServerBasePath = operationServerMap['AssistantApi.apiV1AssistantsPublicIdDelete']?.[localVarOperationServerIndex]?.url;
|
||||
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 收藏助理
|
||||
* @param {number} id
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async apiV1AssistantsPublicIdPost(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ApiV1AssistantsPublicIdPost200Response>> {
|
||||
const localVarAxiosArgs = await localVarAxiosParamCreator.apiV1AssistantsPublicIdPost(id, options);
|
||||
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
||||
const localVarOperationServerBasePath = operationServerMap['AssistantApi.apiV1AssistantsPublicIdPost']?.[localVarOperationServerIndex]?.url;
|
||||
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
@ -2920,6 +3257,16 @@ export const AssistantApiFp = function(configuration?: Configuration) {
|
||||
export const AssistantApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
|
||||
const localVarFp = AssistantApiFp(configuration)
|
||||
return {
|
||||
/**
|
||||
*
|
||||
* @summary 收藏的助理列表
|
||||
* @param {number} [page]
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
apiV1AssistantsFavoritesGet(page?: number, options?: RawAxiosRequestConfig): AxiosPromise<ApiV1AssistantsFavoritesGet200Response> {
|
||||
return localVarFp.apiV1AssistantsFavoritesGet(page, options).then((request) => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 获取 Assistant 列表
|
||||
@ -3057,11 +3404,32 @@ export const AssistantApiFactory = function (configuration?: Configuration, base
|
||||
/**
|
||||
*
|
||||
* @summary 获取公开的助理列表
|
||||
* @param {number} [page]
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
apiV1AssistantsPublicGet(options?: RawAxiosRequestConfig): AxiosPromise<ApiV1AssistantsGet200Response> {
|
||||
return localVarFp.apiV1AssistantsPublicGet(options).then((request) => request(axios, basePath));
|
||||
apiV1AssistantsPublicGet(page?: number, options?: RawAxiosRequestConfig): AxiosPromise<ApiV1AssistantsFavoritesGet200Response> {
|
||||
return localVarFp.apiV1AssistantsPublicGet(page, options).then((request) => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 取消收藏助理
|
||||
* @param {number} id
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
apiV1AssistantsPublicIdDelete(id: number, options?: RawAxiosRequestConfig): AxiosPromise<ApiV1AssistantsPublicIdPost200Response> {
|
||||
return localVarFp.apiV1AssistantsPublicIdDelete(id, options).then((request) => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 收藏助理
|
||||
* @param {number} id
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
apiV1AssistantsPublicIdPost(id: number, options?: RawAxiosRequestConfig): AxiosPromise<ApiV1AssistantsPublicIdPost200Response> {
|
||||
return localVarFp.apiV1AssistantsPublicIdPost(id, options).then((request) => request(axios, basePath));
|
||||
},
|
||||
};
|
||||
};
|
||||
@ -3073,6 +3441,18 @@ export const AssistantApiFactory = function (configuration?: Configuration, base
|
||||
* @extends {BaseAPI}
|
||||
*/
|
||||
export class AssistantApi extends BaseAPI {
|
||||
/**
|
||||
*
|
||||
* @summary 收藏的助理列表
|
||||
* @param {number} [page]
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
* @memberof AssistantApi
|
||||
*/
|
||||
public apiV1AssistantsFavoritesGet(page?: number, options?: RawAxiosRequestConfig) {
|
||||
return AssistantApiFp(this.configuration).apiV1AssistantsFavoritesGet(page, options).then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @summary 获取 Assistant 列表
|
||||
@ -3236,12 +3616,37 @@ export class AssistantApi extends BaseAPI {
|
||||
/**
|
||||
*
|
||||
* @summary 获取公开的助理列表
|
||||
* @param {number} [page]
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
* @memberof AssistantApi
|
||||
*/
|
||||
public apiV1AssistantsPublicGet(options?: RawAxiosRequestConfig) {
|
||||
return AssistantApiFp(this.configuration).apiV1AssistantsPublicGet(options).then((request) => request(this.axios, this.basePath));
|
||||
public apiV1AssistantsPublicGet(page?: number, options?: RawAxiosRequestConfig) {
|
||||
return AssistantApiFp(this.configuration).apiV1AssistantsPublicGet(page, options).then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @summary 取消收藏助理
|
||||
* @param {number} id
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
* @memberof AssistantApi
|
||||
*/
|
||||
public apiV1AssistantsPublicIdDelete(id: number, options?: RawAxiosRequestConfig) {
|
||||
return AssistantApiFp(this.configuration).apiV1AssistantsPublicIdDelete(id, options).then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @summary 收藏助理
|
||||
* @param {number} id
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
* @memberof AssistantApi
|
||||
*/
|
||||
public apiV1AssistantsPublicIdPost(id: number, options?: RawAxiosRequestConfig) {
|
||||
return AssistantApiFp(this.configuration).apiV1AssistantsPublicIdPost(id, options).then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
}
|
||||
|
||||
@ -6226,3 +6631,104 @@ export class ToolApi extends BaseAPI {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* UsageApi - axios parameter creator
|
||||
* @export
|
||||
*/
|
||||
export const UsageApiAxiosParamCreator = function (configuration?: Configuration) {
|
||||
return {
|
||||
/**
|
||||
*
|
||||
* @summary 获取站点 Usage
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
apiV1UsageGet: async (options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||
const localVarPath = `/api/v1/usage`;
|
||||
// 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;
|
||||
|
||||
|
||||
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
||||
|
||||
return {
|
||||
url: toPathString(localVarUrlObj),
|
||||
options: localVarRequestOptions,
|
||||
};
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* UsageApi - functional programming interface
|
||||
* @export
|
||||
*/
|
||||
export const UsageApiFp = function(configuration?: Configuration) {
|
||||
const localVarAxiosParamCreator = UsageApiAxiosParamCreator(configuration)
|
||||
return {
|
||||
/**
|
||||
*
|
||||
* @summary 获取站点 Usage
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async apiV1UsageGet(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ApiV1UsageGet200Response>> {
|
||||
const localVarAxiosArgs = await localVarAxiosParamCreator.apiV1UsageGet(options);
|
||||
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
||||
const localVarOperationServerBasePath = operationServerMap['UsageApi.apiV1UsageGet']?.[localVarOperationServerIndex]?.url;
|
||||
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* UsageApi - factory interface
|
||||
* @export
|
||||
*/
|
||||
export const UsageApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
|
||||
const localVarFp = UsageApiFp(configuration)
|
||||
return {
|
||||
/**
|
||||
*
|
||||
* @summary 获取站点 Usage
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
apiV1UsageGet(options?: RawAxiosRequestConfig): AxiosPromise<ApiV1UsageGet200Response> {
|
||||
return localVarFp.apiV1UsageGet(options).then((request) => request(axios, basePath));
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* UsageApi - object-oriented interface
|
||||
* @export
|
||||
* @class UsageApi
|
||||
* @extends {BaseAPI}
|
||||
*/
|
||||
export class UsageApi extends BaseAPI {
|
||||
/**
|
||||
*
|
||||
* @summary 获取站点 Usage
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
* @memberof UsageApi
|
||||
*/
|
||||
public apiV1UsageGet(options?: RawAxiosRequestConfig) {
|
||||
return UsageApiFp(this.configuration).apiV1UsageGet(options).then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -44,7 +44,6 @@ const onScroll = (e: Event) => {
|
||||
|
||||
<template>
|
||||
<Header
|
||||
v-if="userStore.logined"
|
||||
style="
|
||||
min-height: var(--header-height);
|
||||
position: fixed;
|
||||
@ -54,48 +53,33 @@ const onScroll = (e: Event) => {
|
||||
"
|
||||
></Header>
|
||||
|
||||
<n-layout
|
||||
<!-- <n-layout
|
||||
:native-scrollbar="isMobile"
|
||||
position="absolute"
|
||||
:style="userStore.logined ? 'margin-top: var(--header-height)' : ''"
|
||||
ref="mainContainer"
|
||||
:on-scroll="onScroll"
|
||||
></n-layout> -->
|
||||
<n-layout
|
||||
:native-scrollbar="isMobile"
|
||||
position="absolute"
|
||||
style="margin-top: var(--header-height)"
|
||||
ref="mainContainer"
|
||||
:on-scroll="onScroll"
|
||||
>
|
||||
<!-- <n-layout-sider
|
||||
v-if="userStore.logined && !isMobile"
|
||||
:collapsed-width="0"
|
||||
:native-scrollbar="false"
|
||||
:show-collapsed-content="false"
|
||||
:width="240"
|
||||
bordered
|
||||
collapse-mode="width"
|
||||
show-trigger="arrow-circle"
|
||||
class="select-none"
|
||||
@collapse="menuCollapsed.left = true"
|
||||
@expand="menuCollapsed.left = false"
|
||||
>
|
||||
<Menu v-show="!isMobile"></Menu>
|
||||
</n-layout-sider> -->
|
||||
<n-back-top v-if="!isMobile" :right="100" />
|
||||
<!-- <n-back-top v-if="!isMobile" :right="100" /> -->
|
||||
|
||||
<n-layout :native-scrollbar="isMobile">
|
||||
<div class="!pt-2">
|
||||
<router-view :key="route.path"> </router-view>
|
||||
</div>
|
||||
|
||||
<!-- <Guest v-if="!userStore.logined && currentRoute != '/auth/login'" />
|
||||
<Container v-else /> -->
|
||||
<Guest v-if="!userStore.logined && !currentRoute?.startsWith('/auth')" />
|
||||
<!-- <Guest v-if="!userStore.logined && !currentRoute?.startsWith('/auth')" />
|
||||
<div v-else :class="userStore.logined ? 'pt-2' : ''">
|
||||
<!-- <div style="height: calc(var(--header-height)*2)"></div> -->
|
||||
|
||||
<router-view :key="route.path"> </router-view>
|
||||
|
||||
<!-- <Container /> -->
|
||||
<!-- <div class="p-4 pt-0 pb-0 mb-0 h-screen">
|
||||
<router-view v-slot="{ Component }" :key="route.path">
|
||||
<transition mode="out-in" name="fade">
|
||||
<component :is="Component" />
|
||||
</transition>
|
||||
</router-view>
|
||||
</div> -->
|
||||
</div>
|
||||
</div> -->
|
||||
</n-layout>
|
||||
</n-layout>
|
||||
</template>
|
||||
|
@ -30,7 +30,10 @@
|
||||
closable
|
||||
:native-scrollbar="false"
|
||||
>
|
||||
<LeftSettings></LeftSettings>
|
||||
<LeftSettings v-if="userStore.logined"></LeftSettings>
|
||||
<div v-else>
|
||||
要使用 Amberlet,请先登录。
|
||||
</div>
|
||||
</n-drawer-content>
|
||||
</n-drawer>
|
||||
<div
|
||||
@ -77,47 +80,57 @@
|
||||
|
||||
<n-grid-item class="flex items-center justify-end mr-1.5">
|
||||
<!-- 右侧 -->
|
||||
<!-- 新对话 -->
|
||||
<n-tooltip trigger="hover">
|
||||
<template #trigger>
|
||||
<n-icon class="text-2xl mr-4 cursor-pointer" @click="backToHome">
|
||||
<AddOutline />
|
||||
</n-icon>
|
||||
</template>
|
||||
<span> 新对话 </span>
|
||||
</n-tooltip>
|
||||
|
||||
<!-- 助理选择 -->
|
||||
<n-popover
|
||||
:placement="userPlacement"
|
||||
class="w-full"
|
||||
trigger="click"
|
||||
style="padding: 0"
|
||||
>
|
||||
<template #trigger>
|
||||
<n-icon class="text-2xl mr-4 cursor-pointer">
|
||||
<PersonOutline />
|
||||
</n-icon>
|
||||
</template>
|
||||
<AssistantMenu />
|
||||
</n-popover>
|
||||
<!-- 用户弹出 -->
|
||||
<n-popover
|
||||
:placement="userPlacement"
|
||||
class="w-full"
|
||||
trigger="click"
|
||||
style="padding: 0"
|
||||
>
|
||||
<template #trigger>
|
||||
<n-avatar
|
||||
round
|
||||
size="medium"
|
||||
:src="userStore.user.avatar"
|
||||
class="mr-2 cursor-pointer"
|
||||
/>
|
||||
</template>
|
||||
<UserMenu class="select-none" />
|
||||
</n-popover>
|
||||
<div v-if="userStore.logined">
|
||||
<!-- 新对话 -->
|
||||
<n-tooltip trigger="hover">
|
||||
<template #trigger>
|
||||
<n-icon
|
||||
class="text-2xl mr-4 cursor-pointer"
|
||||
@click="backToHome"
|
||||
>
|
||||
<AddOutline />
|
||||
</n-icon>
|
||||
</template>
|
||||
<span> 新对话 </span>
|
||||
</n-tooltip>
|
||||
|
||||
<!-- 助理选择 -->
|
||||
<n-popover
|
||||
:placement="userPlacement"
|
||||
class="w-full"
|
||||
trigger="click"
|
||||
style="padding: 0"
|
||||
>
|
||||
<template #trigger>
|
||||
<n-icon class="text-2xl mr-4 cursor-pointer">
|
||||
<PersonOutline />
|
||||