This commit is contained in:
parent
0068d9a0e9
commit
2b771db5dd
157
api/swagger.yaml
157
api/swagger.yaml
@ -263,6 +263,25 @@ definitions:
|
|||||||
user_id:
|
user_id:
|
||||||
type: string
|
type: string
|
||||||
type: object
|
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:
|
schema.AddPublicChatMessageRequest:
|
||||||
properties:
|
properties:
|
||||||
assistant_key:
|
assistant_key:
|
||||||
@ -325,6 +344,15 @@ definitions:
|
|||||||
required:
|
required:
|
||||||
- library_id
|
- library_id
|
||||||
type: object
|
type: object
|
||||||
|
schema.AssistantPublic:
|
||||||
|
properties:
|
||||||
|
description:
|
||||||
|
type: string
|
||||||
|
id:
|
||||||
|
type: integer
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
schema.AssistantUpdateRequest:
|
schema.AssistantUpdateRequest:
|
||||||
properties:
|
properties:
|
||||||
description:
|
description:
|
||||||
@ -353,6 +381,11 @@ definitions:
|
|||||||
prompt:
|
prompt:
|
||||||
maxLength: 512
|
maxLength: 512
|
||||||
type: string
|
type: string
|
||||||
|
public:
|
||||||
|
enum:
|
||||||
|
- true
|
||||||
|
- false
|
||||||
|
type: boolean
|
||||||
temperature:
|
temperature:
|
||||||
enum:
|
enum:
|
||||||
- 0.1
|
- 0.1
|
||||||
@ -590,6 +623,13 @@ definitions:
|
|||||||
success:
|
success:
|
||||||
type: boolean
|
type: boolean
|
||||||
type: object
|
type: object
|
||||||
|
schema.SiteUsageResponse:
|
||||||
|
properties:
|
||||||
|
month_tokens:
|
||||||
|
type: integer
|
||||||
|
month_tool_calls:
|
||||||
|
type: integer
|
||||||
|
type: object
|
||||||
schema.TokenUsage:
|
schema.TokenUsage:
|
||||||
properties:
|
properties:
|
||||||
completion_tokens:
|
completion_tokens:
|
||||||
@ -1125,10 +1165,14 @@ paths:
|
|||||||
summary: 绑定 Tool
|
summary: 绑定 Tool
|
||||||
tags:
|
tags:
|
||||||
- assistant
|
- assistant
|
||||||
/api/v1/assistants/public:
|
/api/v1/assistants/favorites:
|
||||||
get:
|
get:
|
||||||
consumes:
|
consumes:
|
||||||
- application/json
|
- application/json
|
||||||
|
parameters:
|
||||||
|
- in: query
|
||||||
|
name: page
|
||||||
|
type: integer
|
||||||
produces:
|
produces:
|
||||||
- application/json
|
- application/json
|
||||||
responses:
|
responses:
|
||||||
@ -1139,9 +1183,36 @@ paths:
|
|||||||
- $ref: '#/definitions/schema.ResponseBody'
|
- $ref: '#/definitions/schema.ResponseBody'
|
||||||
- properties:
|
- properties:
|
||||||
data:
|
data:
|
||||||
items:
|
$ref: '#/definitions/page.PagedResult-schema_AssistantPublic'
|
||||||
$ref: '#/definitions/entity.Assistant'
|
type: object
|
||||||
type: array
|
"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
|
type: object
|
||||||
"400":
|
"400":
|
||||||
description: Bad Request
|
description: Bad Request
|
||||||
@ -1152,6 +1223,65 @@ paths:
|
|||||||
summary: 获取公开的助理列表
|
summary: 获取公开的助理列表
|
||||||
tags:
|
tags:
|
||||||
- assistant
|
- 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:
|
/api/v1/chat_public:
|
||||||
get:
|
get:
|
||||||
consumes:
|
consumes:
|
||||||
@ -2347,6 +2477,25 @@ paths:
|
|||||||
summary: 校验 Discovery 语法
|
summary: 校验 Discovery 语法
|
||||||
tags:
|
tags:
|
||||||
- tool
|
- 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:
|
securityDefinitions:
|
||||||
ApiKeyAuth:
|
ApiKeyAuth:
|
||||||
in: header
|
in: header
|
||||||
|
520
src/api/api.ts
520
src/api/api.ts
@ -23,6 +23,37 @@ import type { RequestArgs } from './base';
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError, operationServerMap } from './base';
|
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
|
* @export
|
||||||
@ -209,6 +240,37 @@ export interface ApiV1AssistantsPost200Response {
|
|||||||
*/
|
*/
|
||||||
'success'?: boolean;
|
'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
|
* @export
|
||||||
@ -631,6 +693,37 @@ export interface ApiV1ToolsPost200Response {
|
|||||||
*/
|
*/
|
||||||
'success'?: boolean;
|
'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
|
* @export
|
||||||
@ -1333,6 +1426,43 @@ export interface EntityTool {
|
|||||||
*/
|
*/
|
||||||
'user_id'?: string;
|
'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
|
* @export
|
||||||
@ -1425,6 +1555,31 @@ export interface SchemaAssistantLibraryRequest {
|
|||||||
*/
|
*/
|
||||||
'library_id': number;
|
'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
|
* @export
|
||||||
@ -1473,6 +1628,12 @@ export interface SchemaAssistantUpdateRequest {
|
|||||||
* @memberof SchemaAssistantUpdateRequest
|
* @memberof SchemaAssistantUpdateRequest
|
||||||
*/
|
*/
|
||||||
'prompt'?: string;
|
'prompt'?: string;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {boolean}
|
||||||
|
* @memberof SchemaAssistantUpdateRequest
|
||||||
|
*/
|
||||||
|
'public'?: boolean;
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @type {number}
|
* @type {number}
|
||||||
@ -1973,6 +2134,25 @@ export interface SchemaResponseBody {
|
|||||||
*/
|
*/
|
||||||
'success'?: boolean;
|
'success'?: boolean;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface SchemaSiteUsageResponse
|
||||||
|
*/
|
||||||
|
export interface SchemaSiteUsageResponse {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof SchemaSiteUsageResponse
|
||||||
|
*/
|
||||||
|
'month_tokens'?: number;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof SchemaSiteUsageResponse
|
||||||
|
*/
|
||||||
|
'month_tool_calls'?: number;
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @export
|
* @export
|
||||||
@ -2179,6 +2359,44 @@ export interface SchemaToolDiscoveryOutputFunctions {
|
|||||||
*/
|
*/
|
||||||
export const AssistantApiAxiosParamCreator = function (configuration?: Configuration) {
|
export const AssistantApiAxiosParamCreator = function (configuration?: Configuration) {
|
||||||
return {
|
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 列表
|
* @summary 获取 Assistant 列表
|
||||||
@ -2685,10 +2903,11 @@ export const AssistantApiAxiosParamCreator = function (configuration?: Configura
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @summary 获取公开的助理列表
|
* @summary 获取公开的助理列表
|
||||||
|
* @param {number} [page]
|
||||||
* @param {*} [options] Override http request option.
|
* @param {*} [options] Override http request option.
|
||||||
* @throws {RequiredError}
|
* @throws {RequiredError}
|
||||||
*/
|
*/
|
||||||
apiV1AssistantsPublicGet: async (options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
apiV1AssistantsPublicGet: async (page?: number, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||||
const localVarPath = `/api/v1/assistants/public`;
|
const localVarPath = `/api/v1/assistants/public`;
|
||||||
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||||
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
||||||
@ -2704,6 +2923,84 @@ export const AssistantApiAxiosParamCreator = function (configuration?: Configura
|
|||||||
// authentication ApiKeyAuth required
|
// authentication ApiKeyAuth required
|
||||||
await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)
|
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);
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||||
@ -2725,6 +3022,19 @@ export const AssistantApiAxiosParamCreator = function (configuration?: Configura
|
|||||||
export const AssistantApiFp = function(configuration?: Configuration) {
|
export const AssistantApiFp = function(configuration?: Configuration) {
|
||||||
const localVarAxiosParamCreator = AssistantApiAxiosParamCreator(configuration)
|
const localVarAxiosParamCreator = AssistantApiAxiosParamCreator(configuration)
|
||||||
return {
|
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 列表
|
* @summary 获取 Assistant 列表
|
||||||
@ -2901,15 +3211,42 @@ export const AssistantApiFp = function(configuration?: Configuration) {
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @summary 获取公开的助理列表
|
* @summary 获取公开的助理列表
|
||||||
|
* @param {number} [page]
|
||||||
* @param {*} [options] Override http request option.
|
* @param {*} [options] Override http request option.
|
||||||
* @throws {RequiredError}
|
* @throws {RequiredError}
|
||||||
*/
|
*/
|
||||||
async apiV1AssistantsPublicGet(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ApiV1AssistantsGet200Response>> {
|
async apiV1AssistantsPublicGet(page?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ApiV1AssistantsFavoritesGet200Response>> {
|
||||||
const localVarAxiosArgs = await localVarAxiosParamCreator.apiV1AssistantsPublicGet(options);
|
const localVarAxiosArgs = await localVarAxiosParamCreator.apiV1AssistantsPublicGet(page, options);
|
||||||
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
||||||
const localVarOperationServerBasePath = operationServerMap['AssistantApi.apiV1AssistantsPublicGet']?.[localVarOperationServerIndex]?.url;
|
const localVarOperationServerBasePath = operationServerMap['AssistantApi.apiV1AssistantsPublicGet']?.[localVarOperationServerIndex]?.url;
|
||||||
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
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) {
|
export const AssistantApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
|
||||||
const localVarFp = AssistantApiFp(configuration)
|
const localVarFp = AssistantApiFp(configuration)
|
||||||
return {
|
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 列表
|
* @summary 获取 Assistant 列表
|
||||||
@ -3057,11 +3404,32 @@ export const AssistantApiFactory = function (configuration?: Configuration, base
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @summary 获取公开的助理列表
|
* @summary 获取公开的助理列表
|
||||||
|
* @param {number} [page]
|
||||||
* @param {*} [options] Override http request option.
|
* @param {*} [options] Override http request option.
|
||||||
* @throws {RequiredError}
|
* @throws {RequiredError}
|
||||||
*/
|
*/
|
||||||
apiV1AssistantsPublicGet(options?: RawAxiosRequestConfig): AxiosPromise<ApiV1AssistantsGet200Response> {
|
apiV1AssistantsPublicGet(page?: number, options?: RawAxiosRequestConfig): AxiosPromise<ApiV1AssistantsFavoritesGet200Response> {
|
||||||
return localVarFp.apiV1AssistantsPublicGet(options).then((request) => request(axios, basePath));
|
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}
|
* @extends {BaseAPI}
|
||||||
*/
|
*/
|
||||||
export class AssistantApi 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 列表
|
* @summary 获取 Assistant 列表
|
||||||
@ -3236,12 +3616,37 @@ export class AssistantApi extends BaseAPI {
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @summary 获取公开的助理列表
|
* @summary 获取公开的助理列表
|
||||||
|
* @param {number} [page]
|
||||||
* @param {*} [options] Override http request option.
|
* @param {*} [options] Override http request option.
|
||||||
* @throws {RequiredError}
|
* @throws {RequiredError}
|
||||||
* @memberof AssistantApi
|
* @memberof AssistantApi
|
||||||
*/
|
*/
|
||||||
public apiV1AssistantsPublicGet(options?: RawAxiosRequestConfig) {
|
public apiV1AssistantsPublicGet(page?: number, options?: RawAxiosRequestConfig) {
|
||||||
return AssistantApiFp(this.configuration).apiV1AssistantsPublicGet(options).then((request) => request(this.axios, this.basePath));
|
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>
|
<template>
|
||||||
<Header
|
<Header
|
||||||
v-if="userStore.logined"
|
|
||||||
style="
|
style="
|
||||||
min-height: var(--header-height);
|
min-height: var(--header-height);
|
||||||
position: fixed;
|
position: fixed;
|
||||||
@ -54,48 +53,33 @@ const onScroll = (e: Event) => {
|
|||||||
"
|
"
|
||||||
></Header>
|
></Header>
|
||||||
|
|
||||||
<n-layout
|
<!-- <n-layout
|
||||||
:native-scrollbar="isMobile"
|
:native-scrollbar="isMobile"
|
||||||
position="absolute"
|
position="absolute"
|
||||||
:style="userStore.logined ? 'margin-top: var(--header-height)' : ''"
|
:style="userStore.logined ? 'margin-top: var(--header-height)' : ''"
|
||||||
ref="mainContainer"
|
ref="mainContainer"
|
||||||
:on-scroll="onScroll"
|
: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
|
<!-- <n-back-top v-if="!isMobile" :right="100" /> -->
|
||||||
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-layout :native-scrollbar="isMobile">
|
<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'" />
|
<!-- <Guest v-if="!userStore.logined && currentRoute != '/auth/login'" />
|
||||||
<Container v-else /> -->
|
<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 v-else :class="userStore.logined ? 'pt-2' : ''">
|
||||||
<!-- <div style="height: calc(var(--header-height)*2)"></div> -->
|
|
||||||
|
|
||||||
<router-view :key="route.path"> </router-view>
|
<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>
|
||||||
</n-layout>
|
</n-layout>
|
||||||
</template>
|
</template>
|
||||||
|
@ -30,7 +30,10 @@
|
|||||||
closable
|
closable
|
||||||
:native-scrollbar="false"
|
:native-scrollbar="false"
|
||||||
>
|
>
|
||||||
<LeftSettings></LeftSettings>
|
<LeftSettings v-if="userStore.logined"></LeftSettings>
|
||||||
|
<div v-else>
|
||||||
|
要使用 Amberlet,请先登录。
|
||||||
|
</div>
|
||||||
</n-drawer-content>
|
</n-drawer-content>
|
||||||
</n-drawer>
|
</n-drawer>
|
||||||
<div
|
<div
|
||||||
@ -77,10 +80,15 @@
|
|||||||
|
|
||||||
<n-grid-item class="flex items-center justify-end mr-1.5">
|
<n-grid-item class="flex items-center justify-end mr-1.5">
|
||||||
<!-- 右侧 -->
|
<!-- 右侧 -->
|
||||||
|
|
||||||
|
<div v-if="userStore.logined">
|
||||||
<!-- 新对话 -->
|
<!-- 新对话 -->
|
||||||
<n-tooltip trigger="hover">
|
<n-tooltip trigger="hover">
|
||||||
<template #trigger>
|
<template #trigger>
|
||||||
<n-icon class="text-2xl mr-4 cursor-pointer" @click="backToHome">
|
<n-icon
|
||||||
|
class="text-2xl mr-4 cursor-pointer"
|
||||||
|
@click="backToHome"
|
||||||
|
>
|
||||||
<AddOutline />
|
<AddOutline />
|
||||||
</n-icon>
|
</n-icon>
|
||||||
</template>
|
</template>
|
||||||
@ -118,6 +126,11 @@
|
|||||||
</template>
|
</template>
|
||||||
<UserMenu class="select-none" />
|
<UserMenu class="select-none" />
|
||||||
</n-popover>
|
</n-popover>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-else class="mr-2">
|
||||||
|
<n-button @click="gotoLogin" strong secondary type="primary"> 登录 </n-button>
|
||||||
|
</div>
|
||||||
</n-grid-item>
|
</n-grid-item>
|
||||||
</n-grid>
|
</n-grid>
|
||||||
</n-layout-header>
|
</n-layout-header>
|
||||||
@ -165,4 +178,10 @@ if (isMobile.value) {
|
|||||||
const backToHome = () => {
|
const backToHome = () => {
|
||||||
router.push("/");
|
router.push("/");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
const gotoLogin = () => {
|
||||||
|
router.push("/auth/login");
|
||||||
|
};
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
147
src/pages/Guest.vue
Normal file
147
src/pages/Guest.vue
Normal file
@ -0,0 +1,147 @@
|
|||||||
|
<template>
|
||||||
|
<div class="p-4">
|
||||||
|
<div class="mt-5">
|
||||||
|
<n-grid x-gap="14" cols="2 s:3 m:4 l:5" responsive="screen">
|
||||||
|
<n-gi
|
||||||
|
class="mt-3 from-green-200 to-green-300 rounded-lg p-4 text-black"
|
||||||
|
>
|
||||||
|
<h3 class="text-2xl">Leaflow Amber</h3>
|
||||||
|
<p class=" mt-3">
|
||||||
|
Amber 是一个全新的智能体平台,是我们 LeaFlow
|
||||||
|
生态里面重要的一环,也是我们自脱离莱云之后全新的尝试。 Leaflow Amber
|
||||||
|
目前仍然处于测试阶段, 不代表最终品质。
|
||||||
|
</p>
|
||||||
|
<p
|
||||||
|
v-if="
|
||||||
|
siteUsage.month_tokens &&
|
||||||
|
siteUsage.month_tool_calls &&
|
||||||
|
siteUsage.month_tokens > 0 &&
|
||||||
|
siteUsage.month_tool_calls
|
||||||
|
"
|
||||||
|
>
|
||||||
|
我们本月共处理了 {{ siteUsage.month_tokens }} Token, 发起了
|
||||||
|
{{ siteUsage.month_tool_calls }} 次工具调用。
|
||||||
|
</p>
|
||||||
|
</n-gi>
|
||||||
|
<n-gi
|
||||||
|
class="mt-3 from-cyan-500 to-blue-500 rounded-lg p-4 "
|
||||||
|
>
|
||||||
|
<h3 class="text-2xl">💬 对话优化引擎</h3>
|
||||||
|
|
||||||
|
<p class="mt-3">
|
||||||
|
Amber
|
||||||
|
的对话优化引擎无与伦比。我们独特的对话功能支持多个助理并行工作,您可以通过输入
|
||||||
|
@
|
||||||
|
或点击右上角的“切换助理”选项,轻松指定下一个回复的助理。所有助理共享一个上下文,彼此了解每个操作,为您提供流畅一致的对话体验。与一些只能处理单一对话的竞品相比,Amber
|
||||||
|
的多助理协作系统显得更为智能和高效。在重大决策型的使用场景中,你可以通过
|
||||||
|
Amber 对话引擎去得到 N 个 Second Opinion。 Amber
|
||||||
|
为聊天场景做了很多的优化,它将更能处理您日常生活中的问题。
|
||||||
|
</p>
|
||||||
|
</n-gi>
|
||||||
|
<n-gi
|
||||||
|
class="mt-3 from-cyan-500 to-blue-500 rounded-lg p-4 "
|
||||||
|
>
|
||||||
|
<h3 class="text-2xl">🛠️ 客制化</h3>
|
||||||
|
|
||||||
|
<p class="mt-3">
|
||||||
|
Amber 具备了目前主流 LLM
|
||||||
|
对话平台都拥有的高自由度智能体自定义功能,用户可以自定义提示词,绑定工具,以完成复杂任务并优化工作流。例如,您可以设置助理在每天早上自动为您生成当天的工作清单,或者在您需要时快速调用数据分析工具。我们的助理不仅能执行简单的任务,还能实现多步骤的复杂操作,并与知识库无缝集成,说它是您高效工作的得力助手,绝不为过。
|
||||||
|
💪
|
||||||
|
</p>
|
||||||
|
</n-gi>
|
||||||
|
<n-gi
|
||||||
|
class="mt-3 from-cyan-500 to-blue-500 rounded-lg p-4 "
|
||||||
|
>
|
||||||
|
<h3 class="text-2xl">🧠 记忆</h3>
|
||||||
|
|
||||||
|
<p class="mt-3">
|
||||||
|
Amber
|
||||||
|
通过采样您的对话内容生成记忆,这些记忆是碎片化的,但对话中共享。您可以随时清除所有记忆,确保数据的灵活管理。Amber
|
||||||
|
会收集您的消息,并且根据消息推断您的喜好。记忆的内容您完全可以控制,甚至禁用助理的记忆。助理将会根据您的记忆来改变响应的结果,您喜欢什么,您直接在对话中说明即可(Amber
|
||||||
|
会从第二条消息开始学习记忆) ❤️
|
||||||
|
</p>
|
||||||
|
</n-gi>
|
||||||
|
<n-gi
|
||||||
|
class="mt-3 from-cyan-500 to-blue-500 rounded-lg p-4 "
|
||||||
|
>
|
||||||
|
<h3 class="text-2xl">🔗 API</h3>
|
||||||
|
|
||||||
|
<p class="mt-3">
|
||||||
|
我们提供强大的助理 API,支持兼容 OpenAI 格式的应用接入 Amber。通过
|
||||||
|
Chat Completion API,您可以直接调用 Amber
|
||||||
|
的工具、记忆以及知识库功能。例如,一个开发者可以轻松地将 Amber
|
||||||
|
集成到他们的客服系统中,自动处理常见问题并提供高效的解决方案。相较于其他平台,我们的
|
||||||
|
API 更具灵活性和扩展性,让您的应用赋予更多可能。不仅仅在 Amber
|
||||||
|
系统的本身,您也可以通过我们 Leaflow 平台的 UserLand,解锁更多高阶
|
||||||
|
API 玩法! 🚀
|
||||||
|
</p>
|
||||||
|
<p class="mt-3">
|
||||||
|
如果您要使用 Amber API,请查看此链接:<n-a
|
||||||
|
target="_blank"
|
||||||
|
href="https://amber-api.leaflow.cn/swagger/index.html"
|
||||||
|
>Amber API</n-a
|
||||||
|
>
|
||||||
|
</p>
|
||||||
|
</n-gi>
|
||||||
|
<n-gi
|
||||||
|
class="mt-3 from-cyan-500 to-blue-500 rounded-lg p-4 "
|
||||||
|
>
|
||||||
|
<h3 class="text-2xl">🛠️ 工具集成</h3>
|
||||||
|
|
||||||
|
<p class="mt-3">
|
||||||
|
我们的工具功能拥有极大的扩展性,且工具系统拥有更多的对话控制功能,所以目前不兼容
|
||||||
|
OpenAI
|
||||||
|
新版本的格式。工具可以助您高效完成各类任务。例如,您可以将自己的应用或者
|
||||||
|
Home Assistant 接入 Amber,随后在对话中控制它。Amber
|
||||||
|
的记忆功能将会记住你的喜好(接入教程和详细文档将在近期提供)。 📈
|
||||||
|
</p>
|
||||||
|
</n-gi>
|
||||||
|
<n-gi
|
||||||
|
class="mt-3 from-cyan-500 to-blue-500 rounded-lg p-4 "
|
||||||
|
>
|
||||||
|
<h3 class="text-2xl">📚 文档管理</h3>
|
||||||
|
|
||||||
|
<p class="mt-3">
|
||||||
|
文档管理是 Amber
|
||||||
|
知识库的核心功能之一。对话中上传的文件将自动保存至知识库,您只需设置助理关联知识库,即可实现快速检索和使用。假设您是一位项目经理,您可以在对话中上传项目计划书,并在需要时快速检索相关内容。Amber
|
||||||
|
在您发送消息时,将会自动搜索资料库。此外,我们正在开发桌面端软件,该软件可以根据您的需要同步文档至
|
||||||
|
Amber,以便随时调用🗂️。 Amber
|
||||||
|
不会长期保存您的文档的源文件,我们不建议您上传具有机密性的文档。
|
||||||
|
</p>
|
||||||
|
</n-gi>
|
||||||
|
<n-gi
|
||||||
|
class="mt-3 from-cyan-500 to-blue-500 rounded-lg p-4 "
|
||||||
|
>
|
||||||
|
<h3 class="text-2xl">👋 一起加入</h3>
|
||||||
|
<p class="mt-3">
|
||||||
|
我们提供了 WP Amber,此 WordPress 插件可以将 Amber
|
||||||
|
放到你的博客中,让您的访客通过助理来总结并解释文章等。
|
||||||
|
</p>
|
||||||
|
<n-image :src="grouppng" width="150" height="300" />
|
||||||
|
</n-gi>
|
||||||
|
</n-grid>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import router from "../router";
|
||||||
|
import { useUserStore } from "../stores/user";
|
||||||
|
import grouppng from "@/assets/images/group.png";
|
||||||
|
import { SchemaSiteUsageResponse } from "@/api";
|
||||||
|
import getApi from "@/plugins/api";
|
||||||
|
|
||||||
|
const userStore = useUserStore();
|
||||||
|
const siteUsage: Ref<SchemaSiteUsageResponse> = ref({});
|
||||||
|
|
||||||
|
const login = () => {
|
||||||
|
router.push("/auth/login");
|
||||||
|
};
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
const r = (await getApi().Usage.apiV1UsageGet()).data.data;
|
||||||
|
if (r) {
|
||||||
|
siteUsage.value = r;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
@ -1,46 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="flex items-center align-center justify-center h-screen">
|
|
||||||
<div class="text-center">
|
|
||||||
<div class="mt-5 !ml-2">
|
|
||||||
<n-image :src="leaflowpng" width="200" />
|
|
||||||
<n-h1> 满身星光,不负众望 </n-h1>
|
|
||||||
</div>
|
|
||||||
<br />
|
|
||||||
<n-button v-if="!userStore.logined" type="primary" @click="login">
|
|
||||||
登录
|
|
||||||
</n-button>
|
|
||||||
|
|
||||||
<n-modal v-model:show="showModal" :mask-closable="false" preset="dialog" transform-origin="center">
|
|
||||||
<template #header>
|
|
||||||
<div>公告</div>
|
|
||||||
</template>
|
|
||||||
<div class="text-center">
|
|
||||||
<n-h6>
|
|
||||||
Leaflow Amber 目前仍然处于测试阶段,
|
|
||||||
<br />
|
|
||||||
不代表最终品质。
|
|
||||||
</n-h6>
|
|
||||||
<n-image :src="grouppng" width="300" />
|
|
||||||
</div>
|
|
||||||
<template #action>
|
|
||||||
<n-button type="primary" @click="showModal = false">确定</n-button>
|
|
||||||
</template>
|
|
||||||
</n-modal>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup lang="ts">
|
|
||||||
import router from "../../router";
|
|
||||||
import { useUserStore } from "../../stores/user";
|
|
||||||
import leaflowpng from "@/assets/images/leaflow.png"
|
|
||||||
import grouppng from "@/assets/images/group.png"
|
|
||||||
|
|
||||||
const userStore = useUserStore();
|
|
||||||
|
|
||||||
const login = () => {
|
|
||||||
router.push("/auth/login");
|
|
||||||
};
|
|
||||||
|
|
||||||
const showModal = ref(true);
|
|
||||||
</script>
|
|
@ -1,5 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
<Chat />
|
<Chat v-if="userStore.logined" />
|
||||||
|
<Guest v-else />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped></style>
|
<script setup lang="ts">
|
||||||
|
import Guest from "@/pages/Guest.vue";
|
||||||
|
import { useUserStore } from "@/stores/user";
|
||||||
|
|
||||||
|
const userStore = useUserStore();
|
||||||
|
</script>
|
||||||
|
@ -8,6 +8,7 @@ import {
|
|||||||
MemoiresApi,
|
MemoiresApi,
|
||||||
PingApi,
|
PingApi,
|
||||||
ToolApi,
|
ToolApi,
|
||||||
|
UsageApi
|
||||||
} from "../api";
|
} from "../api";
|
||||||
import config from "../config/config";
|
import config from "../config/config";
|
||||||
|
|
||||||
@ -24,7 +25,8 @@ interface Api {
|
|||||||
ChatPublic: ChatPublicApi;
|
ChatPublic: ChatPublicApi;
|
||||||
Library: LibrariesApi;
|
Library: LibrariesApi;
|
||||||
Memory: MemoiresApi;
|
Memory: MemoiresApi;
|
||||||
conf: Configuration
|
conf: Configuration;
|
||||||
|
Usage: UsageApi
|
||||||
}
|
}
|
||||||
|
|
||||||
let api: Api | null = null; // 使用联合类型来表示初始状态可能是 null
|
let api: Api | null = null; // 使用联合类型来表示初始状态可能是 null
|
||||||
@ -56,7 +58,8 @@ const getApi = () => {
|
|||||||
ChatPublic: new ChatPublicApi(conf, undefined, axios),
|
ChatPublic: new ChatPublicApi(conf, undefined, axios),
|
||||||
Library: new LibrariesApi(conf, undefined, axios),
|
Library: new LibrariesApi(conf, undefined, axios),
|
||||||
Memory: new MemoiresApi(conf, undefined, axios),
|
Memory: new MemoiresApi(conf, undefined, axios),
|
||||||
conf: conf
|
Usage: new UsageApi(conf, undefined, axios),
|
||||||
|
conf: conf,
|
||||||
};
|
};
|
||||||
|
|
||||||
return api;
|
return api;
|
||||||
|
2
src/typed-router.d.ts
vendored
2
src/typed-router.d.ts
vendored
@ -29,6 +29,6 @@ declare module 'vue-router/auto-routes' {
|
|||||||
'/errors/404': RouteRecordInfo<'/errors/404', '/errors/404', Record<never, never>, Record<never, never>>,
|
'/errors/404': RouteRecordInfo<'/errors/404', '/errors/404', Record<never, never>, Record<never, never>>,
|
||||||
'/errors/500': RouteRecordInfo<'/errors/500', '/errors/500', Record<never, never>, Record<never, never>>,
|
'/errors/500': RouteRecordInfo<'/errors/500', '/errors/500', Record<never, never>, Record<never, never>>,
|
||||||
'/errors/Base': RouteRecordInfo<'/errors/Base', '/errors/Base', Record<never, never>, Record<never, never>>,
|
'/errors/Base': RouteRecordInfo<'/errors/Base', '/errors/Base', Record<never, never>, Record<never, never>>,
|
||||||
'/guest/': RouteRecordInfo<'/guest/', '/guest', Record<never, never>, Record<never, never>>,
|
'/Guest': RouteRecordInfo<'/Guest', '/Guest', Record<never, never>, Record<never, never>>,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user