Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
h5
/
glsk-ai-assistant
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 5699dbc5
authored
Apr 29, 2025
by
杨明
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
域名
1 parent
3b64d862
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
184 additions
and
125 deletions
Dockerfile
app/components/base/answer-icon/index.tsx
app/components/base/button/index.css
app/components/base/button/index.tsx
app/components/base/chat/chat-with-history/chat-wrapper.tsx
app/components/base/chat/chat-with-history/hooks.tsx
app/components/base/chat/chat-with-history/index.tsx
app/components/base/chat/chat/answer/suggested-questions.tsx
app/components/base/chat/chat/chat-input-area/index.tsx
app/components/base/chat/chat/chat-input-area/operation.tsx
app/components/base/chat/chat/index.tsx
app/components/base/chat/constants.ts
config/index.ts
themes/light.css
Dockerfile
View file @
5699dbc
# base image
# base image
FROM
node:20-alpine3.20 AS base
FROM
node:20-alpine3.20 AS base
LABEL maintainer="
takatost@gmail.com
"
LABEL maintainer="
yangming@didihu.com.cn
"
# if you located in China, you can use aliyun mirror to speed up
# if you located in China, you can use aliyun mirror to speed up
# RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
# RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
RUN
sed -i
's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g'
/etc/apk/repositories
RUN
apk add --no-cache tzdata
RUN
apk add --no-cache tzdata
RUN
npm install -g pnpm@9.12.2
RUN
npm install -g pnpm@9.12.2
ENV
PNPM_HOME="/pnpm"
ENV
PNPM_HOME="/pnpm"
...
@@ -51,14 +52,13 @@ ENV MARKETPLACE_URL=http://192.168.3.241
...
@@ -51,14 +52,13 @@ ENV MARKETPLACE_URL=http://192.168.3.241
ENV
PORT=3000
ENV
PORT=3000
ENV
NEXT_TELEMETRY_DISABLED=1
ENV
NEXT_TELEMETRY_DISABLED=1
ENV
PM2_INSTANCES=2
ENV
PM2_INSTANCES=2
# set timezone
# set timezone
ENV
TZ=UTC
#ENV TZ=UTC
ENV
TZ=Asia/Shanghai
RUN
ln -s /usr/share/zoneinfo/
${
TZ
}
/etc/localtime
\
RUN
ln -s /usr/share/zoneinfo/
${
TZ
}
/etc/localtime
\
&&
echo
${
TZ
}
> /etc/timezone
&&
echo
${
TZ
}
> /etc/timezone
...
...
app/components/base/answer-icon/index.tsx
View file @
5699dbc
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: yangming@didihu.com.cn yangming@didihu.com.cn
* @Author: yangming@didihu.com.cn yangming@didihu.com.cn
* @Date: 2025-04-22 09:29:17
* @Date: 2025-04-22 09:29:17
* @LastEditors: yangming@didihu.com.cn yangming@didihu.com.cn
* @LastEditors: yangming@didihu.com.cn yangming@didihu.com.cn
* @LastEditTime: 2025-04-2
4 09:45:21
* @LastEditTime: 2025-04-2
8 13:55:48
* @FilePath: \glsk-ai-assistant\app\components\base\answer-icon\index.tsx
* @FilePath: \glsk-ai-assistant\app\components\base\answer-icon\index.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
*/
...
@@ -35,15 +35,10 @@ const AnswerIcon: FC<AnswerIconProps> = ({
...
@@ -35,15 +35,10 @@ const AnswerIcon: FC<AnswerIconProps> = ({
"w-full",
"w-full",
"h-full",
"h-full",
"rounded-full",
"rounded-full",
"border-[0.5px]",
"border-black/5",
"text-xl"
"text-xl"
);
);
return (
return (
<div
<div className={wrapperClassName}>
className={wrapperClassName}
style={{ background: background || "#D5F5F6" }}
>
<img
<img
src={imageUrl}
src={imageUrl}
className="h-full w-full rounded-full"
className="h-full w-full rounded-full"
...
...
app/components/base/button/index.css
View file @
5699dbc
...
@@ -93,13 +93,11 @@
...
@@ -93,13 +93,11 @@
.btn-secondary-accent
{
.btn-secondary-accent
{
@apply
@apply
border-[0.5px]
border-[0px]
shadow-xs
bg-components-button-secondary-bg
border-components-button-secondary-border
hover
:
bg-components-button-secondary-bg-hover
hover
:
border-components-button-secondary-border-hover
hover
:
border-components-button-secondary-border-hover
text-components-button-secondary-accent-text
;
text-components-button-secondary-accent-text
;
background
:
#f5f8fc
;
color
:
#383A3D
;
}
}
.btn-secondary-accent.btn-disabled
{
.btn-secondary-accent.btn-disabled
{
...
@@ -183,4 +181,12 @@
...
@@ -183,4 +181,12 @@
@apply
@apply
text-components-button-secondary-accent-text-disabled;
text-components-button-secondary-accent-text-disabled;
}
}
}
\ No newline at end of file
\ No newline at end of file
.arrow-icon
{
margin-left
:
10px
;
width
:
8px
;
height
:
8px
;
border-top
:
1.5px
solid
#969BA3
;
border-right
:
1.5px
solid
#969BA3
;
transform
:
rotate
(
45deg
);
}
}
app/components/base/button/index.tsx
View file @
5699dbc
import type { CSSProperties } from
'react'
import type { CSSProperties } from
"react";
import React from
'react'
import React from
"react";
import { type VariantProps, cva } from
'class-variance-authority'
import { type VariantProps, cva } from
"class-variance-authority";
import Spinner from
'../spinner'
import Spinner from
"../spinner";
import classNames from
'@/utils/classnames'
import classNames from
"@/utils/classnames";
const buttonVariants = cva(
const buttonVariants = cva("btn disabled:btn-disabled", {
'btn disabled:btn-disabled',
variants: {
{
variant: {
variants: {
primary: "btn-primary",
variant: {
warning: "btn-warning",
'primary': 'btn-primary',
secondary: "btn-secondary",
'warning': 'btn-warning',
"secondary-accent": "btn-secondary-accent",
'secondary': 'btn-secondary',
ghost: "btn-ghost",
'secondary-accent': 'btn-secondary-accent',
"ghost-accent": "btn-ghost-accent",
'ghost': 'btn-ghost',
tertiary: "btn-tertiary",
'ghost-accent': 'btn-ghost-accent',
'tertiary': 'btn-tertiary',
},
size: {
small: 'btn-small',
medium: 'btn-medium',
large: 'btn-large',
},
},
},
defaultVariants: {
size: {
variant: 'secondary',
small: "btn-small",
size: 'medium',
medium: "btn-medium",
large: "btn-large",
},
},
},
},
)
defaultVariants: {
variant: "secondary",
size: "medium",
},
});
export type ButtonProps = {
export type ButtonProps = {
destructive?: boolean
destructive?: boolean;
loading?: boolean
loading?: boolean;
styleCss?: CSSProperties
styleCss?: CSSProperties;
spinnerClassName?: string
showArrow?: boolean;
} & React.ButtonHTMLAttributes<HTMLButtonElement> & VariantProps<typeof buttonVariants>
spinnerClassName?: string;
} & React.ButtonHTMLAttributes<HTMLButtonElement> &
VariantProps<typeof buttonVariants>;
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
({ className, variant, size, destructive, loading, styleCss, children, spinnerClassName, ...props }, ref) => {
(
{
className,
variant,
size,
destructive,
loading,
styleCss,
showArrow,
children,
spinnerClassName,
...props
},
ref
) => {
return (
return (
<button
<button
type=
'button'
type=
"button"
className={classNames(
className={classNames(
buttonVariants({ variant, size, className }),
buttonVariants({ variant, size, className }),
destructive &&
'btn-destructive',
destructive &&
"btn-destructive"
)}
)}
ref={ref}
ref={ref}
style={styleCss}
style={styleCss}
{...props}
{...props}
>
>
{children}
{children}
{loading && <Spinner loading={loading} className={classNames('!text-white !h-3 !w-3 !border-2 !ml-1', spinnerClassName)} />}
{loading && (
<Spinner
loading={loading}
className={classNames(
"!text-white !h-3 !w-3 !border-2 !ml-1",
spinnerClassName
)}
/>
)}
{showArrow &&<span className="arrow-icon"></span>}
</button>
</button>
)
)
;
}
,
}
)
)
;
Button.displayName =
'Button'
Button.displayName =
"Button";
export default Button
export default Button
;
export { Button, buttonVariants }
export { Button, buttonVariants }
;
app/components/base/chat/chat-with-history/chat-wrapper.tsx
View file @
5699dbc
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: yangming@didihu.com.cn yangming@didihu.com.cn
* @Author: yangming@didihu.com.cn yangming@didihu.com.cn
* @Date: 2025-04-22 09:29:17
* @Date: 2025-04-22 09:29:17
* @LastEditors: yangming@didihu.com.cn yangming@didihu.com.cn
* @LastEditors: yangming@didihu.com.cn yangming@didihu.com.cn
* @LastEditTime: 2025-04-2
5 14:46:27
* @LastEditTime: 2025-04-2
8 10:51:44
* @FilePath: \glsk-ai-assistant\app\components\base\chat\chat-with-history\chat-wrapper.tsx
* @FilePath: \glsk-ai-assistant\app\components\base\chat\chat-with-history\chat-wrapper.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
*/
...
@@ -29,8 +29,9 @@ import { SELF_INPUT } from "@/app/components/base/chat/constants";
...
@@ -29,8 +29,9 @@ import { SELF_INPUT } from "@/app/components/base/chat/constants";
type Props = {
type Props = {
avatar: string;
avatar: string;
aiAvatar: string;
aiAvatar: string;
doClear?: () => void;
};
};
const ChatWrapper = ({ avatar, aiAvatar }: Props) => {
const ChatWrapper = ({ avatar, aiAvatar
, doClear
}: Props) => {
const {
const {
appParams,
appParams,
appPrevChatTree,
appPrevChatTree,
...
@@ -54,6 +55,7 @@ const ChatWrapper = ({ avatar, aiAvatar }: Props) => {
...
@@ -54,6 +55,7 @@ const ChatWrapper = ({ avatar, aiAvatar }: Props) => {
setClearChatList,
setClearChatList,
setIsResponding,
setIsResponding,
} = useChatWithHistoryContext();
} = useChatWithHistoryContext();
const appConfig = useMemo(() => {
const appConfig = useMemo(() => {
const config = appParams || {};
const config = appParams || {};
...
@@ -138,7 +140,6 @@ const ChatWrapper = ({ avatar, aiAvatar }: Props) => {
...
@@ -138,7 +140,6 @@ const ChatWrapper = ({ avatar, aiAvatar }: Props) => {
useEffect(() => {
useEffect(() => {
setIsResponding(respondingState);
setIsResponding(respondingState);
}, [respondingState, setIsResponding]);
}, [respondingState, setIsResponding]);
const doSend: OnSend = useCallback(
const doSend: OnSend = useCallback(
(
(
messageObj,
messageObj,
...
@@ -293,6 +294,7 @@ const ChatWrapper = ({ avatar, aiAvatar }: Props) => {
...
@@ -293,6 +294,7 @@ const ChatWrapper = ({ avatar, aiAvatar }: Props) => {
isMobile ? "px-2" : "px-4"
isMobile ? "px-2" : "px-4"
}`}
}`}
onSend={doSend}
onSend={doSend}
onClear={doClear}
inputs={
inputs={
currentConversationId
currentConversationId
? (currentConversationInputs as any)
? (currentConversationInputs as any)
...
...
app/components/base/chat/chat-with-history/hooks.tsx
View file @
5699dbc
...
@@ -414,11 +414,11 @@ export const useChatWithHistory = (installedAppInfo?: InstalledApp) => {
...
@@ -414,11 +414,11 @@ export const useChatWithHistory = (installedAppInfo?: InstalledApp) => {
[handleConversationIdInfoChange, setClearChatList]
[handleConversationIdInfoChange, setClearChatList]
);
);
const handleNewConversation = useCallback(
const handleNewConversation = useCallback(
(inputs?: Record<string, any>) => {
(inputs?: Record<string, any>
,isReset?:boolean
) => {
currentChatInstanceRef.current.handleStop();
currentChatInstanceRef.current.handleStop();
setShowNewConversationItemInList(true);
setShowNewConversationItemInList(true);
handleChangeConversation("");
handleChangeConversation("");
handleNewConversationInputsChange(inputs || {});
!isReset &&
handleNewConversationInputsChange(inputs || {});
setClearChatList(true);
setClearChatList(true);
},
},
[
[
...
...
app/components/base/chat/chat-with-history/index.tsx
View file @
5699dbc
import type { FC } from "react";
import type { FC } from "react";
import { useEffect, useState } from "react";
import { useEffect, useState
, useCallback
} from "react";
import { useAsyncEffect } from "ahooks";
import { useAsyncEffect } from "ahooks";
import { useThemeContext } from "../embedded-chatbot/theme/theme-context";
import { useThemeContext } from "../embedded-chatbot/theme/theme-context";
import { ChatWithHistoryContext, useChatWithHistoryContext } from "./context";
import { ChatWithHistoryContext, useChatWithHistoryContext } from "./context";
...
@@ -22,6 +22,7 @@ type ChatWithHistoryProps = {
...
@@ -22,6 +22,7 @@ type ChatWithHistoryProps = {
className?: string;
className?: string;
};
};
type urlProps = {
type urlProps = {
no_header?: string; // 是否显示头部
avatar?: string; // 头像
avatar?: string; // 头像
business_type?: string; // 业务类型
business_type?: string; // 业务类型
brand?: string; // 品牌
brand?: string; // 品牌
...
@@ -53,8 +54,15 @@ const ChatWithHistory: FC<ChatWithHistoryProps> = ({ className }) => {
...
@@ -53,8 +54,15 @@ const ChatWithHistory: FC<ChatWithHistoryProps> = ({ className }) => {
appChatListDataLoading,
appChatListDataLoading,
chatShouldReloadKey,
chatShouldReloadKey,
isMobile,
isMobile,
handleNewConversation,
handleNewConversationInputsChange
} = useChatWithHistoryContext();
} = useChatWithHistoryContext();
const doClear = useCallback(() => {
handleNewConversation();
setTimeout(() => {
handleNewConversationInputsChange(newInputs);
}, 300);
}, [handleNewConversation]);
if (appInfoLoading) {
if (appInfoLoading) {
return <Loading type="app" />;
return <Loading type="app" />;
}
}
...
@@ -79,9 +87,12 @@ const ChatWithHistory: FC<ChatWithHistoryProps> = ({ className }) => {
...
@@ -79,9 +87,12 @@ const ChatWithHistory: FC<ChatWithHistoryProps> = ({ className }) => {
"flex h-full flex-col overflow-hidden border-components-panel-border-subtle chat-panel-bg"
"flex h-full flex-col overflow-hidden border-components-panel-border-subtle chat-panel-bg"
)}
)}
>
>
<Header avatar={avatar} title={MAIN_TITLE} />
{!newInputs.no_header && (
<Header avatar={avatar} title={MAIN_TITLE} />
)}
{!appChatListDataLoading && (
{!appChatListDataLoading && (
<ChatWrapper
<ChatWrapper
doClear={doClear}
key={chatShouldReloadKey}
key={chatShouldReloadKey}
avatar={avatar}
avatar={avatar}
aiAvatar={AVATAR_AI_URL}
aiAvatar={AVATAR_AI_URL}
...
@@ -146,8 +157,9 @@ const ChatWithHistoryWrap: FC<ChatWithHistoryWrapProps> = ({
...
@@ -146,8 +157,9 @@ const ChatWithHistoryWrap: FC<ChatWithHistoryWrapProps> = ({
} = useChatWithHistory(installedAppInfo);
} = useChatWithHistory(installedAppInfo);
useEffect(() => {
useEffect(() => {
//新建对话
//新建对话
handleNewConversation()
setTimeout(() => {
setTimeout(() => {
handleNewConversation(newInputs);
handleNewConversation
InputsChange
(newInputs);
}, 1000);
}, 1000);
}, []);
}, []);
return (
return (
...
...
app/components/base/chat/chat/answer/suggested-questions.tsx
View file @
5699dbc
import type { FC } from 'react'
/*
import { memo } from 'react'
* @Author: yangming@didihu.com.cn yangming@didihu.com.cn
import type { ChatItem } from '../../types'
* @Date: 2025-04-22 09:29:17
import { useChatContext } from '../context'
* @LastEditors: yangming@didihu.com.cn yangming@didihu.com.cn
import Button from '@/app/components/base/button'
* @LastEditTime: 2025-04-28 10:10:51
import useBreakpoints, { MediaType } from '@/hooks/use-breakpoints'
* @FilePath: \glsk-ai-assistant\app\components\base\chat\chat\answer\suggested-questions.tsx
import {AUTO_INPUT} from "@/app/components/base/chat/constants";
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import type { FC } from "react";
import { memo } from "react";
import type { ChatItem } from "../../types";
import { useChatContext } from "../context";
import Button from "@/app/components/base/button";
import useBreakpoints, { MediaType } from "@/hooks/use-breakpoints";
import { AUTO_INPUT } from "@/app/components/base/chat/constants";
type SuggestedQuestionsProps = {
type SuggestedQuestionsProps = {
item: ChatItem
item: ChatItem
;
}
}
;
const SuggestedQuestions: FC<SuggestedQuestionsProps> = ({
const SuggestedQuestions: FC<SuggestedQuestionsProps> = ({
item }) => {
item,
const { onSend } = useChatContext();
}) => {
const media = useBreakpoints();
const
{ onSend } = useChatContext()
const
isMobile = media === MediaType.mobile;
const
media = useBreakpoints()
const
klassName = `mr-1 mt-3 ${
const isMobile = media === MediaType.mobile
isMobile ? "block overflow-hidden text-ellipsis" : ""
const klassName = `mr-1 mt-1 ${isMobile ? 'block overflow-hidden text-ellipsis' : ''} max-w-full shrink-0 last:mr-0`
} max-w-full shrink-0 last:mr-0`;
const {
const { suggestedQuestions } = item;
suggestedQuestions,
if (!suggestedQuestions?.length) return null;
} = item
if (!suggestedQuestions?.length)
return null
return (
return (
<div className='flex flex-wrap'>
<div className="flex flex-wrap">
{suggestedQuestions.filter(q => !!q && q.trim()).map((question, index) => (
{suggestedQuestions
<Button
.filter((q) => !!q && q.trim())
key={index}
.map((question, index) => (
variant='secondary-accent'
<Button
className={klassName}
key={index}
onClick={() => onSend?.({message:question,type:AUTO_INPUT})}
variant="secondary-accent"
>
showArrow={true}
{question}
className={klassName}
</Button>),
onClick={() => onSend?.({ message: question, type: AUTO_INPUT })}
)}
>
{question}
</Button>
))}
</div>
</div>
)
)
;
}
}
;
export default memo(SuggestedQuestions)
export default memo(SuggestedQuestions)
;
app/components/base/chat/chat/chat-input-area/index.tsx
View file @
5699dbc
...
@@ -20,7 +20,11 @@ import { useToastContext } from "@/app/components/base/toast";
...
@@ -20,7 +20,11 @@ import { useToastContext } from "@/app/components/base/toast";
import FeatureBar from "@/app/components/base/features/new-feature-panel/feature-bar";
import FeatureBar from "@/app/components/base/features/new-feature-panel/feature-bar";
import type { FileUpload } from "@/app/components/base/features/types";
import type { FileUpload } from "@/app/components/base/features/types";
import { TransferMethod } from "@/types/app";
import { TransferMethod } from "@/types/app";
import { SELF_INPUT } from "@/app/components/base/chat/constants";
import {
SELF_INPUT,
SEND_BUTTON,
CLEAR_BUTTON,
} from "@/app/components/base/chat/constants";
type ChatInputAreaProps = {
type ChatInputAreaProps = {
showFeatureBar?: boolean;
showFeatureBar?: boolean;
showFileUpload?: boolean;
showFileUpload?: boolean;
...
@@ -29,6 +33,7 @@ type ChatInputAreaProps = {
...
@@ -29,6 +33,7 @@ type ChatInputAreaProps = {
visionConfig?: FileUpload;
visionConfig?: FileUpload;
speechToTextConfig?: EnableType;
speechToTextConfig?: EnableType;
onSend?: OnSend;
onSend?: OnSend;
onClear?: () => void;
inputs?: Record<string, any>;
inputs?: Record<string, any>;
inputsForm?: InputForm[];
inputsForm?: InputForm[];
theme?: Theme | null;
theme?: Theme | null;
...
@@ -43,6 +48,7 @@ const ChatInputArea = ({
...
@@ -43,6 +48,7 @@ const ChatInputArea = ({
visionConfig,
visionConfig,
speechToTextConfig = { enabled: true },
speechToTextConfig = { enabled: true },
onSend,
onSend,
onClear,
inputs = {},
inputs = {},
inputsForm = [],
inputsForm = [],
theme,
theme,
...
@@ -112,6 +118,11 @@ const ChatInputArea = ({
...
@@ -112,6 +118,11 @@ const ChatInputArea = ({
// }
// }
}
}
};
};
const handleClear = () => {
if (onClear) {
onClear();
}
};
const handleCompositionStart = () => {
const handleCompositionStart = () => {
// e: React.CompositionEvent<HTMLTextAreaElement>
// e: React.CompositionEvent<HTMLTextAreaElement>
isComposingRef.current = true;
isComposingRef.current = true;
...
@@ -179,10 +190,13 @@ const ChatInputArea = ({
...
@@ -179,10 +190,13 @@ const ChatInputArea = ({
speechToTextConfig={speechToTextConfig}
speechToTextConfig={speechToTextConfig}
onShowVoiceInput={handleShowVoiceInput}
onShowVoiceInput={handleShowVoiceInput}
onSend={handleSend}
onSend={handleSend}
imgUrl={SEND_BUTTON}
theme={theme}
theme={theme}
/>
/>
);
);
const clear = (
<Operation ref={holdSpaceRef} onSend={handleClear} imgUrl={CLEAR_BUTTON} />
);
return (
return (
<>
<>
<div
<div
...
@@ -196,6 +210,7 @@ const ChatInputArea = ({
...
@@ -196,6 +210,7 @@ const ChatInputArea = ({
<FileListInChatInput fileConfig={visionConfig!} />
<FileListInChatInput fileConfig={visionConfig!} />
<div ref={wrapperRef} className="flex items-center justify-between">
<div ref={wrapperRef} className="flex items-center justify-between">
<div className="relative flex w-full grow items-center">
<div className="relative flex w-full grow items-center">
{clear}
<div
<div
ref={textValueRef}
ref={textValueRef}
className="body-lg-regular pointer-events-none invisible absolute h-auto w-auto whitespace-pre p-1 leading-6"
className="body-lg-regular pointer-events-none invisible absolute h-auto w-auto whitespace-pre p-1 leading-6"
...
...
app/components/base/chat/chat/chat-input-area/operation.tsx
View file @
5699dbc
...
@@ -13,15 +13,13 @@ type OperationProps = {
...
@@ -13,15 +13,13 @@ type OperationProps = {
speechToTextConfig?: EnableType;
speechToTextConfig?: EnableType;
onShowVoiceInput?: () => void;
onShowVoiceInput?: () => void;
onSend: () => void;
onSend: () => void;
imgUrl?: string;
theme?: Theme | null;
theme?: Theme | null;
};
};
const Operation = ({
const Operation = ({
ref,
ref,
fileConfig,
speechToTextConfig,
onShowVoiceInput,
onSend,
onSend,
theme
,
imgUrl
,
}: OperationProps & {
}: OperationProps & {
ref: React.RefObject<HTMLDivElement>;
ref: React.RefObject<HTMLDivElement>;
}) => {
}) => {
...
@@ -41,20 +39,14 @@ const Operation = ({
...
@@ -41,20 +39,14 @@ const Operation = ({
)
)
}
}
</div> */}
</div> */}
<Button
{imgUrl && (
className="ml-3 w-8 px-0"
<img
variant="primary"
onClick={onSend}
onClick={onSend}
src={imgUrl}
style={
className="size-6 hover:cursor-pointer"
theme
alt="icon"
? {
/>
backgroundColor: theme.primaryColor,
)}
}
: {}
}
>
<RiSendPlane2Fill className="h-4 w-4" />
</Button>
</div>
</div>
</div>
</div>
);
);
...
...
app/components/base/chat/chat/index.tsx
View file @
5699dbc
...
@@ -35,6 +35,7 @@ export type ChatProps = {
...
@@ -35,6 +35,7 @@ export type ChatProps = {
onStopResponding?: () => void;
onStopResponding?: () => void;
noChatInput?: boolean;
noChatInput?: boolean;
onSend?: OnSend;
onSend?: OnSend;
onClear?: () => void;
inputs?: Record<string, any>;
inputs?: Record<string, any>;
inputsForm?: InputForm[];
inputsForm?: InputForm[];
onRegenerate?: OnRegenerate;
onRegenerate?: OnRegenerate;
...
@@ -80,6 +81,7 @@ const Chat: FC<ChatProps> = ({
...
@@ -80,6 +81,7 @@ const Chat: FC<ChatProps> = ({
appData,
appData,
config,
config,
onSend,
onSend,
onClear,
inputs,
inputs,
inputsForm,
inputsForm,
onRegenerate,
onRegenerate,
...
@@ -314,7 +316,7 @@ const Chat: FC<ChatProps> = ({
...
@@ -314,7 +316,7 @@ const Chat: FC<ChatProps> = ({
<Button onClick={onStopResponding}>
<Button onClick={onStopResponding}>
<StopCircle className="mr-[5px] h-3.5 w-3.5 text-gray-500" />
<StopCircle className="mr-[5px] h-3.5 w-3.5 text-gray-500" />
<span className="text-xs font-normal text-gray-500">
<span className="text-xs font-normal text-gray-500">
{t("
appDebug.operation.stopResponding
")}
{t("
停止响应
")}
</span>
</span>
</Button>
</Button>
</div>
</div>
...
@@ -336,6 +338,7 @@ const Chat: FC<ChatProps> = ({
...
@@ -336,6 +338,7 @@ const Chat: FC<ChatProps> = ({
visionConfig={config?.file_upload}
visionConfig={config?.file_upload}
speechToTextConfig={config?.speech_to_text}
speechToTextConfig={config?.speech_to_text}
onSend={onSend}
onSend={onSend}
onClear={onClear}
inputs={inputs}
inputs={inputs}
inputsForm={inputsForm}
inputsForm={inputsForm}
theme={themeBuilder?.theme}
theme={themeBuilder?.theme}
...
...
app/components/base/chat/constants.ts
View file @
5699dbc
...
@@ -8,3 +8,7 @@ export const AVATAR_USER_URL =
...
@@ -8,3 +8,7 @@ export const AVATAR_USER_URL =
export
const
MAIN_TITLE
=
"广联AI集市"
;
export
const
MAIN_TITLE
=
"广联AI集市"
;
export
const
SELF_INPUT
=
"0"
;
export
const
SELF_INPUT
=
"0"
;
export
const
AUTO_INPUT
=
"1"
;
export
const
AUTO_INPUT
=
"1"
;
export
const
SEND_BUTTON
=
"https://img02.glsx.com.cn/weapp/resource/saas/ai/ai-send.png"
;
export
const
CLEAR_BUTTON
=
"https://img02.glsx.com.cn/weapp/resource/saas/ai/ai-clear.png"
;
config/index.ts
View file @
5699dbc
This diff is collapsed.
Click to expand it.
themes/light.css
View file @
5699dbc
...
@@ -740,4 +740,4 @@ html[data-theme="light"] {
...
@@ -740,4 +740,4 @@ html[data-theme="light"] {
url("https://img02.glsx.com.cn/weapp/resource/saas/ai/ai-bg.png")
top
/
100%
240px
no-repeat
,
url("https://img02.glsx.com.cn/weapp/resource/saas/ai/ai-bg.png")
top
/
100%
240px
no-repeat
,
#f5f9ff
0
240px
/
100%
calc
(
100%
-
240px
)
no-repeat
;
#f5f9ff
0
240px
/
100%
calc
(
100%
-
240px
)
no-repeat
;
}
}
}
\ No newline at end of file
\ No newline at end of file
}
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment