θΏ™ζ˜―indexlocζδΎ›ηš„ζœεŠ‘οΌŒδΈθ¦θΎ“ε…₯任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { DotsThree, Plus } from "@phosphor-icons/react";
import showToast from "@/utils/toast";

export const CMD_REGEX = new RegExp(/[^a-zA-Z0-9_-]/g);
export default function SlashPresets({ setShowing, sendCommand }) {
export default function SlashPresets({ setShowing, sendCommand, promptRef }) {
const isActiveAgentSession = useIsAgentSessionActive();
const {
isOpen: isAddModalOpen,
Expand Down Expand Up @@ -84,6 +84,7 @@ export default function SlashPresets({ setShowing, sendCommand }) {
onClick={() => {
setShowing(false);
sendCommand(`${preset.command} `, false);
promptRef?.current?.focus();
}}
className="border-none w-full hover:cursor-pointer hover:bg-theme-action-menu-item-hover px-2 py-2 rounded-xl flex flex-row justify-start"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default function SlashCommandsButton({ showing, setShowSlashCommand }) {
);
}

export function SlashCommands({ showing, setShowing, sendCommand }) {
export function SlashCommands({ showing, setShowing, sendCommand, promptRef }) {
const cmdRef = useRef(null);
useEffect(() => {
function listenForOutsideClick() {
Expand All @@ -58,7 +58,11 @@ export function SlashCommands({ showing, setShowing, sendCommand }) {
>
<ResetCommand sendCommand={sendCommand} setShowing={setShowing} />
<EndAgentSession sendCommand={sendCommand} setShowing={setShowing} />
<SlashPresets sendCommand={sendCommand} setShowing={setShowing} />
<SlashPresets
sendCommand={sendCommand}
setShowing={setShowing}
promptRef={promptRef}
/>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ export default function PromptInput({
showing={showSlashCommand}
setShowing={setShowSlashCommand}
sendCommand={sendCommand}
promptRef={textareaRef}
/>
<AvailableAgents
showing={showAgents}
Expand Down
4 changes: 2 additions & 2 deletions server/utils/chats/stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ async function streamChatWithWorkspace(
const isAgentChat = await grepAgents({
uuid,
response,
message,
message: updatedMessage,
user,
workspace,
thread,
Expand Down Expand Up @@ -134,7 +134,7 @@ async function streamChatWithWorkspace(
embeddingsCount !== 0
? await VectorDb.performSimilaritySearch({
namespace: workspace.slug,
input: message,
input: updatedMessage,
LLMConnector,
similarityThreshold: workspace?.similarityThreshold,
topN: workspace?.topN,
Expand Down