Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
1a83283
chatbot interface joint debugging
FU-design Sep 13, 2024
5c419d8
Merge remote-tracking branch 'origin/main' into dev_chatbot
FU-design Sep 13, 2024
45772cc
add chatbot API integration
FU-design Sep 14, 2024
db83b5b
Merge branch 'dev_chatbot' of https://github.com/FU-design/bigtop-man…
FU-design Sep 14, 2024
4613dfb
add chatbot API integration
FU-design Sep 14, 2024
7667a03
add chatbot API integration
FU-design Sep 14, 2024
aea36b1
debugging ai
FU-design Sep 14, 2024
9382c79
debugging ai
FU-design Sep 14, 2024
4fe9a1d
Merge remote-tracking branch 'origin/main' into dev_chatbot
FU-design Sep 18, 2024
40eecd5
add delplatform and delChatThread api
FU-design Sep 18, 2024
a19be7f
complete chatbot api access
FU-design Sep 18, 2024
c97570c
update locales
FU-design Sep 19, 2024
ec724df
add license for chatbot
FU-design Sep 19, 2024
c1a7b7e
add license for chatbot
FU-design Sep 19, 2024
b6a9fb3
improve style in chatbot
FU-design Sep 19, 2024
0cf9a80
fix paramter missing
FU-design Sep 19, 2024
3aa2f2e
add license for svg
FU-design Sep 19, 2024
50ff6c3
remove descriptions
FU-design Sep 19, 2024
23279b5
perfecting streaming printing
FU-design Sep 19, 2024
d56850f
refact chatbot to chatbotImprove
FU-design Sep 23, 2024
b2db63b
improve use-chat-bot
FU-design Sep 24, 2024
22ea0e0
complete chatbot
FU-design Sep 24, 2024
fe27c09
Merge remote-tracking branch 'origin/main' into dev_chatbot
FU-design Sep 24, 2024
ed2f484
revert env
FU-design Sep 24, 2024
8d7079c
fix import error
FU-design Sep 24, 2024
445c63e
remove chatbot store
FU-design Sep 24, 2024
2adfe8e
fix AntdIconProps error
FU-design Sep 24, 2024
3710a4a
add marked and highlight into chatbot on ui
FU-design Sep 24, 2024
e5d0669
Merge remote-tracking branch 'origin/bigtop-4234' into dev_chatbot
FU-design Sep 24, 2024
cfe65c1
fix icon display on chatbot ui
FU-design Sep 25, 2024
fba0b0c
fix code conflict
FU-design Sep 25, 2024
363dfc2
fix missing scrolling content
FU-design Sep 25, 2024
52ea9ed
fix code conflict
FU-design Sep 25, 2024
18017cc
revert env
FU-design Sep 25, 2024
4076758
add markdown-view component on common components
FU-design Sep 25, 2024
97900ac
modify style of chatbot component
FU-design Sep 25, 2024
f543002
use vue-dompurify-htmly for xss defense
FU-design Sep 25, 2024
840f0b7
Merge remote-tracking branch 'origin/bigtop-4234' into dev_chatbot
FU-design Sep 25, 2024
06d1e94
add marked in chatbot
FU-design Sep 25, 2024
539010e
add license in marked style
FU-design Sep 25, 2024
fc73dd5
refactor variable names for compliance
FU-design Sep 26, 2024
7d7159c
Merge branch 'bigtop-4234' of https://github.com/FU-design/bigtop-man…
FU-design Sep 26, 2024
4caa97b
refactor variable names for compliance
FU-design Sep 26, 2024
5fa0e1b
refactor variable names for compliance
FU-design Sep 26, 2024
295394a
standard document format
FU-design Sep 26, 2024
cab650b
modify api and cache params about chatbot
FU-design Sep 26, 2024
043ddd1
modify request params of chatbot api
FU-design Sep 27, 2024
1f315a3
modify request params of chatbot api
FU-design Sep 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion bigtop-manager-ui/.env.development
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,5 @@
NODE_ENV=development

VITE_APP_BASE='/'
#VITE_APP_BASE_URL='http://172.29.40.96:8080'
VITE_APP_BASE_URL='http://localhost:8080'
VITE_APP_BASE_API='/api'
5 changes: 5 additions & 0 deletions bigtop-manager-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,16 @@
"clipboard": "^2.0.11",
"dayjs": "^1.11.9",
"echarts": "^5.4.3",
"github-markdown-css": "^5.6.1",
"highlight.js": "^11.10.0",
"lodash": "^4.17.21",
"marked": "^14.1.2",
"marked-highlight": "^2.1.4",
"md5": "^2.3.0",
"pinia": "^2.1.6",
"pinia-plugin-persistedstate": "^3.2.0",
"vue": "^3.4.37",
"vue-dompurify-html": "^5.1.0",
"vue-i18n": "^9.2.2",
"vue-router": "^4.2.4"
},
Expand Down
52 changes: 52 additions & 0 deletions bigtop-manager-ui/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

108 changes: 108 additions & 0 deletions bigtop-manager-ui/src/api/chatbot/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import request from '@/api/request.ts'
import {
AuthorizedPlatform,
SupportedPlatform,
CredentialFormItem,
AuthCredentialTestParams,
AuthTestResult,
ChatThread,
ChatThreadCondition,
ChatThreadHistoryCondition,
ChatThreadHistoryItem,
ChatThreadDelCondition
} from '@/api/chatbot/types.ts'

export const getAuthorizedPlatforms = (): Promise<AuthorizedPlatform[]> => {
return request({
method: 'get',
url: '/chatbot/auth-platforms'
})
}
export const getSupportedPlatforms = (): Promise<SupportedPlatform[]> => {
return request({
method: 'get',
url: '/chatbot/platforms'
})
}
export const getCredentialFormModelOfPlatform = (
platformId: string | number
): Promise<CredentialFormItem[]> => {
return request({
method: 'get',
url: `/chatbot/platforms/${platformId}/auth-credentials`
})
}

export const validateAuthCredentials = (
data: AuthCredentialTestParams
): Promise<AuthTestResult> => {
return request({
method: 'post',
url: '/chatbot/auth-platforms',
data
})
}

export const getChatThreads = (
params: ChatThreadCondition
): Promise<ChatThread[]> => {
return request({
method: 'get',
url: `/chatbot/auth-platforms/${params.authId}/threads`,
params: {
model: params.model
}
})
}
export const createChatThread = (
data: ChatThreadCondition
): Promise<ChatThread> => {
return request({
method: 'post',
url: `/chatbot/auth-platforms/${data.authId}/threads?model=${data.model}`
})
}
export const getThreadChatHistory = (
params: ChatThreadHistoryCondition
): Promise<ChatThreadHistoryItem[]> => {
return request({
method: 'get',
url: `/chatbot/auth-platforms/${params.authId}/threads/${params.threadId}/history`
})
}

export const delAuthorizedPlatform = (
authId: string | number
): Promise<boolean> => {
return request({
method: 'delete',
url: `/chatbot/auth-platforms/${authId}`
})
}
export const delChatThread = (
params: ChatThreadDelCondition
): Promise<boolean> => {
return request({
method: 'delete',
url: `/chatbot/auth-platforms/${params.authId}/threads/${params.threadId}`
})
}
94 changes: 94 additions & 0 deletions bigtop-manager-ui/src/api/chatbot/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

export interface ChatbotConfig {
authId?: string | number
platformName?: string
supportModels?: string
model?: string
threadId?: string | number
threadName?: string
createTime?: string
updateTime?: string
}
export interface Platform {
id: string | number
platformId: string | number
platformName: string
supportModels: string
currModel?: string
}

export type AuthorizedPlatform = Platform

export interface SupportedPlatform extends Platform {
id: string | number
name: string
supportModels: string
}
export interface CredentialFormItem {
name: string
displayName: string
}
export interface ChatThreadCondition {
authId: string | number
model: string
}

export interface ChatThread extends ChatThreadCondition {
threadId: string | number
threadName: string
createTime: string
updateTime: string
}

export interface AuthCredential {
key: string
value: string
}

export interface AuthCredentialTestParams {
platformId: string | number
authCredentials: AuthCredential[]
}

export interface AuthTestResult {
id: string | number
platformId: string | number
platformName: string
supportModels: string
}

export type Sender = 'USER' | 'SYSTEM' | 'AI'
export interface ChatThreadHistoryItem {
sender: Sender
message: string
createTime?: string
}

export interface ChatThreadHistoryCondition {
authId: string | number
threadId: string | number
}

export interface SendChatMessageCondition extends ChatThreadHistoryCondition {
message: string
}

export type ChatThreadDelCondition = ChatThreadHistoryCondition
24 changes: 23 additions & 1 deletion bigtop-manager-ui/src/api/sse/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@

import axios, { type AxiosProgressEvent, type CancelTokenSource } from 'axios'
import request from '@/api/request.ts'
import type { LogsRes } from './types'
import type { chatMessagesRes, LogsRes } from './types'
import type { SendChatMessageCondition } from '@/api/chatbot/types'

export const getLogs = (
clusterId: number,
Expand All @@ -40,3 +41,24 @@ export const getLogs = (

return { promise, cancel: source.cancel }
}
export const sendChatMessage = (
data: SendChatMessageCondition,
func: Function
): chatMessagesRes => {
const source: CancelTokenSource = axios.CancelToken.source()

const promise = request({
method: 'post',
url: `/chatbot/auth-platforms/${data.authId}/threads/${data.threadId}/talk`,
responseType: 'stream',
data: {
message: data.message
},
timeout: 0,
cancelToken: source.token,
onDownloadProgress: (progressEvent: AxiosProgressEvent) =>
func(progressEvent)
})

return { promise, cancel: source.cancel }
}
4 changes: 4 additions & 0 deletions bigtop-manager-ui/src/api/sse/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,7 @@ export interface LogsRes {
promise: Promise<any>
cancel: () => void
}
export interface chatMessagesRes {
promise: Promise<any>
cancel: () => void
}
23 changes: 23 additions & 0 deletions bigtop-manager-ui/src/assets/images/svg/close.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading