改进
This commit is contained in:
parent
ac3f01a11d
commit
dcbf07a6e4
@ -228,6 +228,8 @@ paths:
|
||||
description: Bad Request
|
||||
schema:
|
||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
||||
security:
|
||||
- ApiKeyAuth: []
|
||||
summary: 获取 Assistant 列表
|
||||
tags:
|
||||
- assistant
|
||||
@ -258,6 +260,8 @@ paths:
|
||||
description: Bad Request
|
||||
schema:
|
||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
||||
security:
|
||||
- ApiKeyAuth: []
|
||||
summary: 创建 Assistant
|
||||
tags:
|
||||
- assistant
|
||||
@ -290,6 +294,8 @@ paths:
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
||||
security:
|
||||
- ApiKeyAuth: []
|
||||
summary: 获取 Assistant 所绑定的 Tool
|
||||
tags:
|
||||
- assistant
|
||||
@ -325,6 +331,8 @@ paths:
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
||||
security:
|
||||
- ApiKeyAuth: []
|
||||
summary: 解绑 Tool
|
||||
tags:
|
||||
- assistant
|
||||
@ -359,6 +367,8 @@ paths:
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
||||
security:
|
||||
- ApiKeyAuth: []
|
||||
summary: 绑定 Tool
|
||||
tags:
|
||||
- assistant
|
||||
@ -452,6 +462,8 @@ paths:
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
||||
security:
|
||||
- ApiKeyAuth: []
|
||||
summary: Delete Chat
|
||||
tags:
|
||||
- chat
|
||||
@ -492,6 +504,8 @@ paths:
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
||||
security:
|
||||
- ApiKeyAuth: []
|
||||
summary: 查看聊天记录
|
||||
tags:
|
||||
- chat_message
|
||||
@ -544,6 +558,8 @@ paths:
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
||||
security:
|
||||
- ApiKeyAuth: []
|
||||
summary: 添加聊天记录
|
||||
tags:
|
||||
- chat_message
|
||||
@ -568,6 +584,8 @@ paths:
|
||||
description: Bad Request
|
||||
schema:
|
||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
||||
security:
|
||||
- ApiKeyAuth: []
|
||||
summary: Greet
|
||||
tags:
|
||||
- ping
|
||||
@ -646,6 +664,8 @@ paths:
|
||||
description: Bad Request
|
||||
schema:
|
||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
||||
security:
|
||||
- ApiKeyAuth: []
|
||||
summary: List Tool
|
||||
tags:
|
||||
- tool
|
||||
@ -678,6 +698,8 @@ paths:
|
||||
description: Bad Request
|
||||
schema:
|
||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
||||
security:
|
||||
- ApiKeyAuth: []
|
||||
summary: Create Tool
|
||||
tags:
|
||||
- tool
|
||||
@ -705,6 +727,8 @@ paths:
|
||||
description: Not Found
|
||||
schema:
|
||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
||||
security:
|
||||
- ApiKeyAuth: []
|
||||
summary: DeleteTool
|
||||
tags:
|
||||
- tool
|
||||
@ -738,6 +762,8 @@ paths:
|
||||
description: Not Found
|
||||
schema:
|
||||
$ref: '#/definitions/rag-new_internal_schema.ResponseBody'
|
||||
security:
|
||||
- ApiKeyAuth: []
|
||||
summary: Get Tool
|
||||
tags:
|
||||
- tool
|
||||
|
@ -891,6 +891,9 @@ export const AssistantApiAxiosParamCreator = function (configuration?: Configura
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication ApiKeyAuth required
|
||||
await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)
|
||||
|
||||
|
||||
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||
@ -925,6 +928,9 @@ export const AssistantApiAxiosParamCreator = function (configuration?: Configura
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication ApiKeyAuth required
|
||||
await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)
|
||||
|
||||
|
||||
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||
@ -963,6 +969,9 @@ export const AssistantApiAxiosParamCreator = function (configuration?: Configura
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication ApiKeyAuth required
|
||||
await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)
|
||||
|
||||
|
||||
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||
@ -1001,6 +1010,9 @@ export const AssistantApiAxiosParamCreator = function (configuration?: Configura
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication ApiKeyAuth required
|
||||
await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)
|
||||
|
||||
|
||||
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||
@ -1034,6 +1046,9 @@ export const AssistantApiAxiosParamCreator = function (configuration?: Configura
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication ApiKeyAuth required
|
||||
await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)
|
||||
|
||||
|
||||
|
||||
localVarHeaderParameter['Content-Type'] = 'application/json';
|
||||
@ -1318,6 +1333,9 @@ export const ChatApiAxiosParamCreator = function (configuration?: Configuration)
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication ApiKeyAuth required
|
||||
await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)
|
||||
|
||||
|
||||
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||
@ -1529,6 +1547,9 @@ export const ChatMessageApiAxiosParamCreator = function (configuration?: Configu
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication ApiKeyAuth required
|
||||
await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)
|
||||
|
||||
|
||||
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||
@ -1566,6 +1587,9 @@ export const ChatMessageApiAxiosParamCreator = function (configuration?: Configu
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication ApiKeyAuth required
|
||||
await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)
|
||||
|
||||
|
||||
|
||||
localVarHeaderParameter['Content-Type'] = 'application/json';
|
||||
@ -1787,6 +1811,9 @@ export const PingApiAxiosParamCreator = function (configuration?: Configuration)
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication ApiKeyAuth required
|
||||
await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)
|
||||
|
||||
|
||||
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||
@ -1888,6 +1915,9 @@ export const ToolApiAxiosParamCreator = function (configuration?: Configuration)
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication ApiKeyAuth required
|
||||
await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)
|
||||
|
||||
|
||||
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||
@ -1922,6 +1952,9 @@ export const ToolApiAxiosParamCreator = function (configuration?: Configuration)
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication ApiKeyAuth required
|
||||
await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)
|
||||
|
||||
|
||||
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||
@ -1956,6 +1989,9 @@ export const ToolApiAxiosParamCreator = function (configuration?: Configuration)
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication ApiKeyAuth required
|
||||
await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)
|
||||
|
||||
|
||||
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||
@ -1989,6 +2025,9 @@ export const ToolApiAxiosParamCreator = function (configuration?: Configuration)
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication ApiKeyAuth required
|
||||
await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)
|
||||
|
||||
|
||||
|
||||
localVarHeaderParameter['Content-Type'] = 'application/json';
|
||||
|
@ -24,6 +24,21 @@
|
||||
to="/"
|
||||
/>
|
||||
|
||||
<v-list-item
|
||||
prepend-icon="mdi-home"
|
||||
rounded="lg"
|
||||
title="助理"
|
||||
to="/assistants"
|
||||
/>
|
||||
|
||||
<v-list-item
|
||||
prepend-icon="mdi-home"
|
||||
rounded="lg"
|
||||
title="连通测试"
|
||||
to="/ping"
|
||||
/>
|
||||
|
||||
|
||||
<v-list-item
|
||||
v-show="!userStore.logined"
|
||||
prepend-icon="mdi-account"
|
||||
|
35
src/pages/assistants/index.vue
Normal file
35
src/pages/assistants/index.vue
Normal file
@ -0,0 +1,35 @@
|
||||
<template>
|
||||
<h3>你创建的助理</h3>
|
||||
|
||||
<div class="mt-3">
|
||||
<v-row>
|
||||
<v-col
|
||||
v-for="assistant in assistants.data"
|
||||
:key="assistant.id"
|
||||
cols="12"
|
||||
sm="6"
|
||||
md="4"
|
||||
>
|
||||
<v-card>
|
||||
<v-card-title>{{ assistant.name }}</v-card-title>
|
||||
<v-card-text>
|
||||
<!-- <p>Email: {{ assistant.email }}</p>
|
||||
<p>Phone: {{ assistant.phone }}</p> -->
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ApiV1AssistantsGet200Response } from "@/api";
|
||||
import { api } from "@/plugins/api";
|
||||
|
||||
let assistants: Ref<ApiV1AssistantsGet200Response> = ref({});
|
||||
|
||||
api.Assistant.apiV1AssistantsGet().then((res) => {
|
||||
assistants.value = res.data;
|
||||
console.log(assistants.value);
|
||||
});
|
||||
</script>
|
20
src/pages/ping/index.vue
Normal file
20
src/pages/ping/index.vue
Normal file
@ -0,0 +1,20 @@
|
||||
<template>
|
||||
<h3>Ping 与服务器连通性测试</h3>
|
||||
<div>
|
||||
<v-btn @click="greet()">Greet</v-btn>
|
||||
</div>
|
||||
|
||||
<p v-if="response != ''">服务器回应:{{ response }}</p>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { api } from "@/plugins/api";
|
||||
import { ref } from "vue";
|
||||
const response = ref("");
|
||||
|
||||
function greet() {
|
||||
api.Ping.apiV1PingGet().then((res) => {
|
||||
response.value = "用户 ID" + String(res.data.data?.userId) ?? "未登录";
|
||||
});
|
||||
}
|
||||
</script>
|
@ -1,26 +1,36 @@
|
||||
import {Configuration, ChatApi, AssistantApi, PingApi, ToolApi, ChatMessageApi,} from "@/api";
|
||||
import {
|
||||
Configuration,
|
||||
ChatApi,
|
||||
AssistantApi,
|
||||
PingApi,
|
||||
ToolApi,
|
||||
ChatMessageApi,
|
||||
} from "@/api";
|
||||
import { useConfigStore } from "@/stores/config";
|
||||
import { useUserStore } from "@/stores/user";
|
||||
|
||||
const configStore = useConfigStore()
|
||||
const userStore = useUserStore()
|
||||
const configStore = useConfigStore();
|
||||
const userStore = useUserStore();
|
||||
|
||||
const conf = new Configuration
|
||||
const conf = new Configuration();
|
||||
|
||||
conf.basePath = configStore.backend
|
||||
conf.apiKey = "Bearer " + userStore.id_token
|
||||
conf.basePath = configStore.backend;
|
||||
conf.apiKey = () => {
|
||||
return "Bearer " + userStore.id_token;
|
||||
}
|
||||
|
||||
|
||||
// userStore.$subscribe((mutation, state) => {
|
||||
// console.log(mutation);
|
||||
// conf.apiKey = "Bearer " + state.id_token;
|
||||
// });
|
||||
|
||||
const api = {
|
||||
Chat: new ChatApi(conf),
|
||||
Assistant: new AssistantApi(conf),
|
||||
Ping: new PingApi(conf),
|
||||
Tool: new ToolApi(conf),
|
||||
ChatMessage: new ChatMessageApi(conf),
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
export {
|
||||
api, conf
|
||||
}
|
||||
export { api, conf };
|
||||
|
2
src/typed-router.d.ts
vendored
2
src/typed-router.d.ts
vendored
@ -19,7 +19,9 @@ declare module 'vue-router/auto-routes' {
|
||||
*/
|
||||
export interface RouteNamedMap {
|
||||
'/': RouteRecordInfo<'/', '/', Record<never, never>, Record<never, never>>,
|
||||
'/assistants/': RouteRecordInfo<'/assistants/', '/assistants', Record<never, never>, Record<never, never>>,
|
||||
'/auth/callback': RouteRecordInfo<'/auth/callback', '/auth/callback', Record<never, never>, Record<never, never>>,
|
||||
'/auth/login': RouteRecordInfo<'/auth/login', '/auth/login', Record<never, never>, Record<never, never>>,
|
||||
'/ping/': RouteRecordInfo<'/ping/', '/ping', Record<never, never>, Record<never, never>>,
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user