Skip to content

Commit

Permalink
fix: #336
Browse files Browse the repository at this point in the history
  • Loading branch information
Hk-Gosuto committed Feb 7, 2025
1 parent 3f153fe commit a62612c
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 8 deletions.
21 changes: 15 additions & 6 deletions .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -54,20 +54,29 @@ NEXT_PUBLIC_ENABLE_NODEJS_PLUGIN=1
# (optional)
# Default: Empty
# If you want to enable RAG, set this value to 1.
# ref: https://github.com/Hk-Gosuto/ChatGPT-Next-Web-LangChain/blob/main/docs/rag-cn.md
ENABLE_RAG=

# (optional)
# Default: Empty
# Model used when RAG vectorized data.
RAG_EMBEDDING_MODEL=text-embedding-ada-002
# ref: https://github.com/Hk-Gosuto/ChatGPT-Next-Web-LangChain/blob/main/docs/rag-cn.md
SUPABASE_URL=

# Configuration is required when turning on RAG.
# (optional)
# Default: Empty
QDRANT_URL=
# ref: https://github.com/Hk-Gosuto/ChatGPT-Next-Web-LangChain/blob/main/docs/rag-cn.md
SUPABASE_PRIVATE_KEY=

# Configuration is required when turning on RAG.
# (optional)
# Default: Empty
# Model used when RAG vectorized data.
# ref: https://github.com/Hk-Gosuto/ChatGPT-Next-Web-LangChain/blob/main/docs/rag-cn.md
RAG_EMBEDDING_MODEL=text-embedding-ada-002

# (optional)
# Default: Empty
QDRANT_API_KEY=
# ref: https://github.com/Hk-Gosuto/ChatGPT-Next-Web-LangChain/blob/main/docs/rag-cn.md
OLLAMA_BASE_URL=

# (optional)
# Default: Empty
Expand Down
30 changes: 28 additions & 2 deletions app/components/chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1186,7 +1186,7 @@ function _Chat() {
}
setIsLoading(true);
chatStore
.onUserInput(userInput, attachImages)
.onUserInput(userInput, attachImages, attachFiles)
.then(() => setIsLoading(false));
setAttachImages([]);
setAttachFiles([]);
Expand Down Expand Up @@ -2192,7 +2192,7 @@ function _Chat() {
<label
className={clsx(styles["chat-input-panel-inner"], {
[styles["chat-input-panel-inner-attach"]]:
attachImages.length !== 0,
attachImages.length !== 0 || attachFiles.length != 0,
})}
htmlFor="chat-input"
>
Expand Down Expand Up @@ -2237,6 +2237,32 @@ function _Chat() {
})}
</div>
)}
{attachFiles.length != 0 && (
<div className={styles["attach-files"]}>
{attachFiles.map((file, index) => {
return (
<div
key={index}
className={styles["attach-file"]}
title={file.originalFilename}
>
<div className={styles["attach-file-info"]}>
{file.originalFilename}
</div>
<div className={styles["attach-file-mask"]}>
<DeleteFileButton
deleteFile={() => {
setAttachFiles(
attachFiles.filter((_, i) => i !== index),
);
}}
/>
</div>
</div>
);
})}
</div>
)}
<IconButton
icon={<SendWhiteIcon />}
text={Locale.Chat.Send}
Expand Down

0 comments on commit a62612c

Please sign in to comment.