|
@@ -173,6 +173,66 @@ export function SessionConfigModel(props: { onClose: () => void }) {
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// 提示词
|
|
|
|
|
+const CallWord: React.FC = () => {
|
|
|
|
|
+ const list = [
|
|
|
|
|
+ {
|
|
|
|
|
+ title: '信息公布',
|
|
|
|
|
+ text: '在哪里查看招聘信息?',
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ title: '招聘岗位',
|
|
|
|
|
+ text: '今年招聘的岗位有哪些?',
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ title: '专业要求',
|
|
|
|
|
+ text: '招聘的岗位有什么专业要求?',
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ title: '工作地点',
|
|
|
|
|
+ text: '全国都有工作地点吗?',
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ title: '薪资待遇',
|
|
|
|
|
+ text: '企业的工资水平怎么样?',
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ title: '人才计划',
|
|
|
|
|
+ text: '企业有什么人才培养计划?',
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ title: '落户政策',
|
|
|
|
|
+ text: '公司是否能协助我落户?',
|
|
|
|
|
+ }
|
|
|
|
|
+ ]
|
|
|
|
|
+
|
|
|
|
|
+ return (
|
|
|
|
|
+ <>
|
|
|
|
|
+ {
|
|
|
|
|
+ list.map((item, index) => {
|
|
|
|
|
+ return <span
|
|
|
|
|
+ key={index}
|
|
|
|
|
+ style={{
|
|
|
|
|
+ padding: '5px 10px',
|
|
|
|
|
+ background: '#f6f7f8',
|
|
|
|
|
+ color: '#5e5e66',
|
|
|
|
|
+ borderRadius: 4,
|
|
|
|
|
+ margin: '0 5px 10px 0',
|
|
|
|
|
+ cursor: 'pointer',
|
|
|
|
|
+ fontSize: 12
|
|
|
|
|
+ }}
|
|
|
|
|
+ onClick={() => {
|
|
|
|
|
+
|
|
|
|
|
+ }}
|
|
|
|
|
+ >
|
|
|
|
|
+ {item.title}
|
|
|
|
|
+ </span>
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ </>
|
|
|
|
|
+ )
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
function PromptToast(props: {
|
|
function PromptToast(props: {
|
|
|
showToast?: boolean;
|
|
showToast?: boolean;
|
|
|
showModal?: boolean;
|
|
showModal?: boolean;
|
|
@@ -525,6 +585,7 @@ export function ChatActions(props: {
|
|
|
icon={<StopIcon />}
|
|
icon={<StopIcon />}
|
|
|
/>
|
|
/>
|
|
|
)}
|
|
)}
|
|
|
|
|
+
|
|
|
{!props.hitBottom && (
|
|
{!props.hitBottom && (
|
|
|
<ChatAction
|
|
<ChatAction
|
|
|
onClick={props.scrollToBottom}
|
|
onClick={props.scrollToBottom}
|
|
@@ -532,13 +593,20 @@ export function ChatActions(props: {
|
|
|
icon={<BottomIcon />}
|
|
icon={<BottomIcon />}
|
|
|
/>
|
|
/>
|
|
|
)}
|
|
)}
|
|
|
- {props.hitBottom && (
|
|
|
|
|
|
|
+
|
|
|
|
|
+ <ChatAction
|
|
|
|
|
+ onClick={() => { }}
|
|
|
|
|
+ text='新建对话'
|
|
|
|
|
+ icon={<RobotIcon />}
|
|
|
|
|
+ />
|
|
|
|
|
+
|
|
|
|
|
+ {/* {props.hitBottom && (
|
|
|
<ChatAction
|
|
<ChatAction
|
|
|
onClick={props.showPromptModal}
|
|
onClick={props.showPromptModal}
|
|
|
text={Locale.Chat.InputActions.Settings}
|
|
text={Locale.Chat.InputActions.Settings}
|
|
|
icon={<SettingsIcon />}
|
|
icon={<SettingsIcon />}
|
|
|
/>
|
|
/>
|
|
|
- )}
|
|
|
|
|
|
|
+ )} */}
|
|
|
|
|
|
|
|
{showUploadImage && (
|
|
{showUploadImage && (
|
|
|
<ChatAction
|
|
<ChatAction
|
|
@@ -547,7 +615,8 @@ export function ChatActions(props: {
|
|
|
icon={props.uploading ? <LoadingButtonIcon /> : <ImageIcon />}
|
|
icon={props.uploading ? <LoadingButtonIcon /> : <ImageIcon />}
|
|
|
/>
|
|
/>
|
|
|
)}
|
|
)}
|
|
|
- <ChatAction
|
|
|
|
|
|
|
+
|
|
|
|
|
+ {/* <ChatAction
|
|
|
onClick={nextTheme}
|
|
onClick={nextTheme}
|
|
|
text={Locale.Chat.InputActions.Theme[theme]}
|
|
text={Locale.Chat.InputActions.Theme[theme]}
|
|
|
icon={
|
|
icon={
|
|
@@ -561,7 +630,9 @@ export function ChatActions(props: {
|
|
|
) : null}
|
|
) : null}
|
|
|
</>
|
|
</>
|
|
|
}
|
|
}
|
|
|
- />
|
|
|
|
|
|
|
+ /> */}
|
|
|
|
|
+
|
|
|
|
|
+ <CallWord />
|
|
|
|
|
|
|
|
<ChatAction
|
|
<ChatAction
|
|
|
onClick={props.showPromptHints}
|
|
onClick={props.showPromptHints}
|
|
@@ -569,15 +640,15 @@ export function ChatActions(props: {
|
|
|
icon={<PromptIcon />}
|
|
icon={<PromptIcon />}
|
|
|
/>
|
|
/>
|
|
|
|
|
|
|
|
- <ChatAction
|
|
|
|
|
|
|
+ {/* <ChatAction
|
|
|
onClick={() => {
|
|
onClick={() => {
|
|
|
navigate(Path.Masks);
|
|
navigate(Path.Masks);
|
|
|
}}
|
|
}}
|
|
|
text={Locale.Chat.InputActions.Masks}
|
|
text={Locale.Chat.InputActions.Masks}
|
|
|
icon={<MaskIcon />}
|
|
icon={<MaskIcon />}
|
|
|
- />
|
|
|
|
|
|
|
+ /> */}
|
|
|
|
|
|
|
|
- <ChatAction
|
|
|
|
|
|
|
+ {/* <ChatAction
|
|
|
text={Locale.Chat.InputActions.Clear}
|
|
text={Locale.Chat.InputActions.Clear}
|
|
|
icon={<BreakIcon />}
|
|
icon={<BreakIcon />}
|
|
|
onClick={() => {
|
|
onClick={() => {
|
|
@@ -590,23 +661,22 @@ export function ChatActions(props: {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
}}
|
|
}}
|
|
|
- />
|
|
|
|
|
|
|
+ /> */}
|
|
|
|
|
|
|
|
- <ChatAction
|
|
|
|
|
|
|
+ {/* <ChatAction
|
|
|
onClick={() => setShowModelSelector(true)}
|
|
onClick={() => setShowModelSelector(true)}
|
|
|
text={currentModelName}
|
|
text={currentModelName}
|
|
|
icon={<RobotIcon />}
|
|
icon={<RobotIcon />}
|
|
|
- />
|
|
|
|
|
|
|
+ /> */}
|
|
|
|
|
|
|
|
{showModelSelector && (
|
|
{showModelSelector && (
|
|
|
<Selector
|
|
<Selector
|
|
|
defaultSelectedValue={`${currentModel}@${currentProviderName}`}
|
|
defaultSelectedValue={`${currentModel}@${currentProviderName}`}
|
|
|
items={models.map((m) => ({
|
|
items={models.map((m) => ({
|
|
|
- title: `${m.displayName}${
|
|
|
|
|
- m?.provider?.providerName
|
|
|
|
|
- ? "(" + m?.provider?.providerName + ")"
|
|
|
|
|
- : ""
|
|
|
|
|
- }`,
|
|
|
|
|
|
|
+ title: `${m.displayName}${m?.provider?.providerName
|
|
|
|
|
+ ? "(" + m?.provider?.providerName + ")"
|
|
|
|
|
+ : ""
|
|
|
|
|
+ }`,
|
|
|
value: `${m.name}@${m?.provider?.providerName}`,
|
|
value: `${m.name}@${m?.provider?.providerName}`,
|
|
|
}))}
|
|
}))}
|
|
|
onClose={() => setShowModelSelector(false)}
|
|
onClose={() => setShowModelSelector(false)}
|
|
@@ -659,11 +729,12 @@ export function ChatActions(props: {
|
|
|
/>
|
|
/>
|
|
|
)}
|
|
)}
|
|
|
|
|
|
|
|
- <ChatAction
|
|
|
|
|
|
|
+ {/* <ChatAction
|
|
|
onClick={() => setShowPluginSelector(true)}
|
|
onClick={() => setShowPluginSelector(true)}
|
|
|
text={Locale.Plugin.Name}
|
|
text={Locale.Plugin.Name}
|
|
|
icon={<PluginIcon />}
|
|
icon={<PluginIcon />}
|
|
|
- />
|
|
|
|
|
|
|
+ /> */}
|
|
|
|
|
+
|
|
|
{showPluginSelector && (
|
|
{showPluginSelector && (
|
|
|
<Selector
|
|
<Selector
|
|
|
multiple
|
|
multiple
|
|
@@ -778,9 +849,9 @@ function _Chat() {
|
|
|
const scrollRef = useRef<HTMLDivElement>(null);
|
|
const scrollRef = useRef<HTMLDivElement>(null);
|
|
|
const isScrolledToBottom = scrollRef?.current
|
|
const isScrolledToBottom = scrollRef?.current
|
|
|
? Math.abs(
|
|
? Math.abs(
|
|
|
- scrollRef.current.scrollHeight -
|
|
|
|
|
- (scrollRef.current.scrollTop + scrollRef.current.clientHeight),
|
|
|
|
|
- ) <= 1
|
|
|
|
|
|
|
+ scrollRef.current.scrollHeight -
|
|
|
|
|
+ (scrollRef.current.scrollTop + scrollRef.current.clientHeight),
|
|
|
|
|
+ ) <= 1
|
|
|
: false;
|
|
: false;
|
|
|
const { setAutoScroll, scrollDomToBottom } = useScrollToBottom(
|
|
const { setAutoScroll, scrollDomToBottom } = useScrollToBottom(
|
|
|
scrollRef,
|
|
scrollRef,
|
|
@@ -1061,27 +1132,27 @@ function _Chat() {
|
|
|
.concat(
|
|
.concat(
|
|
|
isLoading
|
|
isLoading
|
|
|
? [
|
|
? [
|
|
|
- {
|
|
|
|
|
- ...createMessage({
|
|
|
|
|
- role: "assistant",
|
|
|
|
|
- content: "……",
|
|
|
|
|
- }),
|
|
|
|
|
- preview: true,
|
|
|
|
|
- },
|
|
|
|
|
- ]
|
|
|
|
|
|
|
+ {
|
|
|
|
|
+ ...createMessage({
|
|
|
|
|
+ role: "assistant",
|
|
|
|
|
+ content: "……",
|
|
|
|
|
+ }),
|
|
|
|
|
+ preview: true,
|
|
|
|
|
+ },
|
|
|
|
|
+ ]
|
|
|
: [],
|
|
: [],
|
|
|
)
|
|
)
|
|
|
.concat(
|
|
.concat(
|
|
|
userInput.length > 0 && config.sendPreviewBubble
|
|
userInput.length > 0 && config.sendPreviewBubble
|
|
|
? [
|
|
? [
|
|
|
- {
|
|
|
|
|
- ...createMessage({
|
|
|
|
|
- role: "user",
|
|
|
|
|
- content: userInput,
|
|
|
|
|
- }),
|
|
|
|
|
- preview: true,
|
|
|
|
|
- },
|
|
|
|
|
- ]
|
|
|
|
|
|
|
+ {
|
|
|
|
|
+ ...createMessage({
|
|
|
|
|
+ role: "user",
|
|
|
|
|
+ content: userInput,
|
|
|
|
|
+ }),
|
|
|
|
|
+ preview: true,
|
|
|
|
|
+ },
|
|
|
|
|
+ ]
|
|
|
: [],
|
|
: [],
|
|
|
);
|
|
);
|
|
|
}, [
|
|
}, [
|
|
@@ -1176,7 +1247,7 @@ function _Chat() {
|
|
|
if (payload.key || payload.url) {
|
|
if (payload.key || payload.url) {
|
|
|
showConfirm(
|
|
showConfirm(
|
|
|
Locale.URLCommand.Settings +
|
|
Locale.URLCommand.Settings +
|
|
|
- `\n${JSON.stringify(payload, null, 4)}`,
|
|
|
|
|
|
|
+ `\n${JSON.stringify(payload, null, 4)}`,
|
|
|
).then((res) => {
|
|
).then((res) => {
|
|
|
if (!res) return;
|
|
if (!res) return;
|
|
|
if (payload.key) {
|
|
if (payload.key) {
|
|
@@ -1325,14 +1396,14 @@ function _Chat() {
|
|
|
className={`window-header-main-title ${styles["chat-body-main-title"]}`}
|
|
className={`window-header-main-title ${styles["chat-body-main-title"]}`}
|
|
|
onClickCapture={() => setIsEditingMessage(true)}
|
|
onClickCapture={() => setIsEditingMessage(true)}
|
|
|
>
|
|
>
|
|
|
- {!session.topic ? DEFAULT_TOPIC : session.topic}
|
|
|
|
|
|
|
+ 建科招聘智能助理
|
|
|
</div>
|
|
</div>
|
|
|
<div className="window-header-sub-title">
|
|
<div className="window-header-sub-title">
|
|
|
{Locale.Chat.SubTitle(session.messages.length)}
|
|
{Locale.Chat.SubTitle(session.messages.length)}
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div className="window-actions">
|
|
<div className="window-actions">
|
|
|
- {!isMobileScreen && (
|
|
|
|
|
|
|
+ {/* {!isMobileScreen && (
|
|
|
<div className="window-action-button">
|
|
<div className="window-action-button">
|
|
|
<IconButton
|
|
<IconButton
|
|
|
icon={<RenameIcon />}
|
|
icon={<RenameIcon />}
|
|
@@ -1342,8 +1413,8 @@ function _Chat() {
|
|
|
onClick={() => setIsEditingMessage(true)}
|
|
onClick={() => setIsEditingMessage(true)}
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
- )}
|
|
|
|
|
- <div className="window-action-button">
|
|
|
|
|
|
|
+ )} */}
|
|
|
|
|
+ {/* <div className="window-action-button">
|
|
|
<IconButton
|
|
<IconButton
|
|
|
icon={<ExportIcon />}
|
|
icon={<ExportIcon />}
|
|
|
bordered
|
|
bordered
|
|
@@ -1352,7 +1423,7 @@ function _Chat() {
|
|
|
setShowExport(true);
|
|
setShowExport(true);
|
|
|
}}
|
|
}}
|
|
|
/>
|
|
/>
|
|
|
- </div>
|
|
|
|
|
|
|
+ </div> */}
|
|
|
{showMaxIcon && (
|
|
{showMaxIcon && (
|
|
|
<div className="window-action-button">
|
|
<div className="window-action-button">
|
|
|
<IconButton
|
|
<IconButton
|
|
@@ -1370,11 +1441,11 @@ function _Chat() {
|
|
|
)}
|
|
)}
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
- <PromptToast
|
|
|
|
|
|
|
+ {/* <PromptToast
|
|
|
showToast={!hitBottom}
|
|
showToast={!hitBottom}
|
|
|
showModal={showPromptModal}
|
|
showModal={showPromptModal}
|
|
|
setShowModal={setShowPromptModal}
|
|
setShowModal={setShowPromptModal}
|
|
|
- />
|
|
|
|
|
|
|
+ /> */}
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div
|
|
<div
|
|
@@ -1408,7 +1479,7 @@ function _Chat() {
|
|
|
<div className={styles["chat-message-container"]}>
|
|
<div className={styles["chat-message-container"]}>
|
|
|
<div className={styles["chat-message-header"]}>
|
|
<div className={styles["chat-message-header"]}>
|
|
|
<div className={styles["chat-message-avatar"]}>
|
|
<div className={styles["chat-message-avatar"]}>
|
|
|
- <div className={styles["chat-message-edit"]}>
|
|
|
|
|
|
|
+ {/* <div className={styles["chat-message-edit"]}>
|
|
|
<IconButton
|
|
<IconButton
|
|
|
icon={<EditIcon />}
|
|
icon={<EditIcon />}
|
|
|
aria={Locale.Chat.Actions.Edit}
|
|
aria={Locale.Chat.Actions.Edit}
|
|
@@ -1442,8 +1513,9 @@ function _Chat() {
|
|
|
});
|
|
});
|
|
|
}}
|
|
}}
|
|
|
></IconButton>
|
|
></IconButton>
|
|
|
- </div>
|
|
|
|
|
|
|
+ </div> */}
|
|
|
{isUser ? (
|
|
{isUser ? (
|
|
|
|
|
+ // 在这里换头像
|
|
|
<Avatar avatar={config.avatar} />
|
|
<Avatar avatar={config.avatar} />
|
|
|
) : (
|
|
) : (
|
|
|
<>
|
|
<>
|
|
@@ -1460,7 +1532,6 @@ function _Chat() {
|
|
|
</>
|
|
</>
|
|
|
)}
|
|
)}
|
|
|
</div>
|
|
</div>
|
|
|
-
|
|
|
|
|
{showActions && (
|
|
{showActions && (
|
|
|
<div className={styles["chat-message-actions"]}>
|
|
<div className={styles["chat-message-actions"]}>
|
|
|
<div className={styles["chat-input-actions"]}>
|
|
<div className={styles["chat-input-actions"]}>
|
|
@@ -1559,12 +1630,11 @@ function _Chat() {
|
|
|
</div>
|
|
</div>
|
|
|
)}
|
|
)}
|
|
|
</div>
|
|
</div>
|
|
|
-
|
|
|
|
|
- <div className={styles["chat-message-action-date"]}>
|
|
|
|
|
|
|
+ {/* <div className={styles["chat-message-action-date"]}>
|
|
|
{isContext
|
|
{isContext
|
|
|
? Locale.Chat.IsContext
|
|
? Locale.Chat.IsContext
|
|
|
: message.date.toLocaleString()}
|
|
: message.date.toLocaleString()}
|
|
|
- </div>
|
|
|
|
|
|
|
+ </div> */}
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
{shouldShowClearContextDivider && <ClearContextDivider />}
|
|
{shouldShowClearContextDivider && <ClearContextDivider />}
|
|
@@ -1597,11 +1667,10 @@ function _Chat() {
|
|
|
}}
|
|
}}
|
|
|
/>
|
|
/>
|
|
|
<label
|
|
<label
|
|
|
- className={`${styles["chat-input-panel-inner"]} ${
|
|
|
|
|
- attachImages.length != 0
|
|
|
|
|
- ? styles["chat-input-panel-inner-attach"]
|
|
|
|
|
- : ""
|
|
|
|
|
- }`}
|
|
|
|
|
|
|
+ className={`${styles["chat-input-panel-inner"]} ${attachImages.length != 0
|
|
|
|
|
+ ? styles["chat-input-panel-inner-attach"]
|
|
|
|
|
+ : ""
|
|
|
|
|
+ }`}
|
|
|
htmlFor="chat-input"
|
|
htmlFor="chat-input"
|
|
|
>
|
|
>
|
|
|
<textarea
|
|
<textarea
|