mirror of https://github.com/arc53/DocsGPT
Merge branch 'main' into patch-2
commit
a310ae6566
@ -1,4 +1,4 @@
|
|||||||
## To customize a main prompt navigate to `/application/prompt/combine_prompt.txt`
|
## To customize a main prompt, navigate to `/application/prompt/combine_prompt.txt`
|
||||||
|
|
||||||
You can try editing it to see how the model responses.
|
You can try editing it to see how the model responses.
|
||||||
|
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
# Please put appropriate value
|
# Please put appropriate value
|
||||||
VITE_API_HOST=http://localhost:7091
|
VITE_API_HOST=http://0.0.0.0:7091
|
||||||
VITE_API_STREAMING=true
|
VITE_API_STREAMING=true
|
@ -0,0 +1,3 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="11" viewBox="0 0 14 11" fill="none">
|
||||||
|
<path d="M4.95919 10.1906C4.84318 10.1902 4.72847 10.166 4.62222 10.1194C4.51596 10.0729 4.42041 10.0049 4.34152 9.91985L0.229353 5.54538C0.0756344 5.38157 -0.00671208 5.1634 0.000428491 4.93886C0.00756906 4.71433 0.103612 4.50183 0.267428 4.34812C0.431245 4.1944 0.649417 4.11205 0.873948 4.11919C1.09848 4.12633 1.31098 4.22238 1.4647 4.38619L4.95073 8.10068L12.0666 0.316329C12.1389 0.226405 12.2287 0.152193 12.3306 0.0982513C12.4326 0.0443098 12.5445 0.0117775 12.6594 0.00265255C12.7744 -0.00647237 12.89 0.00800286 12.9992 0.045189C13.1084 0.082375 13.2088 0.141487 13.2943 0.218894C13.3798 0.296301 13.4485 0.390369 13.4964 0.49532C13.5442 0.600272 13.57 0.713891 13.5723 0.829198C13.5746 0.944506 13.5534 1.05907 13.5098 1.16585C13.4662 1.27263 13.4012 1.36937 13.3189 1.45014L5.58533 9.91139C5.50718 9.998 5.41197 10.0675 5.30567 10.1156C5.19938 10.1636 5.0843 10.1892 4.96766 10.1906H4.95919Z" fill="#747474"/>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 1.0 KiB |
@ -0,0 +1,3 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="11" viewBox="0 0 14 11" fill="none">
|
||||||
|
<path d="M4.95919 10.1906C4.84318 10.1902 4.72847 10.166 4.62222 10.1194C4.51596 10.0729 4.42041 10.0049 4.34152 9.91985L0.229353 5.54538C0.0756344 5.38157 -0.00671208 5.1634 0.000428491 4.93886C0.00756906 4.71433 0.103612 4.50183 0.267428 4.34812C0.431245 4.1944 0.649417 4.11205 0.873948 4.11919C1.09848 4.12633 1.31098 4.22238 1.4647 4.38619L4.95073 8.10068L12.0666 0.316329C12.1389 0.226405 12.2287 0.152193 12.3306 0.0982513C12.4326 0.0443098 12.5445 0.0117775 12.6594 0.00265255C12.7744 -0.00647237 12.89 0.00800286 12.9992 0.045189C13.1084 0.082375 13.2088 0.141487 13.2943 0.218894C13.3798 0.296301 13.4485 0.390369 13.4964 0.49532C13.5442 0.600272 13.57 0.713891 13.5723 0.829198C13.5746 0.944506 13.5534 1.05907 13.5098 1.16585C13.4662 1.27263 13.4012 1.36937 13.3189 1.45014L5.58533 9.91139C5.50718 9.998 5.41197 10.0675 5.30567 10.1156C5.19938 10.1636 5.0843 10.1892 4.96766 10.1906H4.95919Z" fill="#747474"/>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 1.0 KiB |
@ -0,0 +1,3 @@
|
|||||||
|
<svg width="14" height="17" stroke-width="1.15" viewBox="0 0 14 17" >
|
||||||
|
<path d="M13.8013 5.01282L8.80645 0.191795C8.67953 0.0691399 8.50734 0.000152609 8.32774 0H6.09677C5.43801 0 4.80623 0.252586 4.34041 0.702193C3.8746 1.1518 3.6129 1.7616 3.6129 2.39744V3.48718H2.48387C1.82511 3.48718 1.19332 3.73977 0.727509 4.18937C0.261693 4.63898 0 5.24878 0 5.88462V14.6026C0 15.2384 0.261693 15.8482 0.727509 16.2978C1.19332 16.7474 1.82511 17 2.48387 17H8.80645C9.46521 17 10.097 16.7474 10.5628 16.2978C11.0286 15.8482 11.2903 15.2384 11.2903 14.6026V13.5128H11.5161C12.1749 13.5128 12.8067 13.2602 13.2725 12.8106C13.7383 12.361 14 11.7512 14 11.1154V5.44872C13.9929 5.28447 13.9219 5.12884 13.8013 5.01282ZM9.03226 2.23179L11.6877 4.79487H9.03226V2.23179ZM9.93548 14.6026C9.93548 14.8916 9.81653 15.1688 9.6048 15.3731C9.39306 15.5775 9.10589 15.6923 8.80645 15.6923H2.48387C2.18443 15.6923 1.89726 15.5775 1.68552 15.3731C1.47379 15.1688 1.35484 14.8916 1.35484 14.6026V5.88462C1.35484 5.5956 1.47379 5.31842 1.68552 5.11405C1.89726 4.90968 2.18443 4.79487 2.48387 4.79487H3.6129V11.1154C3.6129 11.7512 3.8746 12.361 4.34041 12.8106C4.80623 13.2602 5.43801 13.5128 6.09677 13.5128H9.93548V14.6026ZM11.5161 12.2051H6.09677C5.79734 12.2051 5.51016 12.0903 5.29843 11.886C5.08669 11.6816 4.96774 11.4044 4.96774 11.1154V2.39744C4.96774 2.10842 5.08669 1.83124 5.29843 1.62687C5.51016 1.4225 5.79734 1.30769 6.09677 1.30769H7.67742V5.44872C7.67976 5.62143 7.75188 5.78643 7.87842 5.90856C8.00496 6.03069 8.1759 6.10031 8.35484 6.10256H12.6452V11.1154C12.6452 11.4044 12.5262 11.6816 12.3145 11.886C12.1027 12.0903 11.8156 12.2051 11.5161 12.2051Z" fill="#949494"/>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 1.6 KiB |
@ -0,0 +1,3 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="15" viewBox="0 0 16 15" fill="none">
|
||||||
|
<path d="M10.0588 2.74568L12.5294 5.15732M8.41176 14H15M1.82353 10.7845L1 14L4.29412 13.1961L13.8355 3.88237C14.1443 3.58087 14.3178 3.172 14.3178 2.74568C14.3178 2.31936 14.1443 1.9105 13.8355 1.609L13.6939 1.47073C13.385 1.16932 12.9662 1 12.5294 1C12.0927 1 11.6738 1.16932 11.3649 1.47073L1.82353 10.7845Z" stroke="#747474" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 500 B |
@ -0,0 +1,3 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="15" viewBox="0 0 12 15" fill="none">
|
||||||
|
<path d="M0.857143 13.3333C0.857143 13.7754 1.03775 14.1993 1.35925 14.5118C1.68074 14.8244 2.11677 15 2.57143 15H9.42857C9.88323 15 10.3193 14.8244 10.6408 14.5118C10.9622 14.1993 11.1429 13.7754 11.1429 13.3333V3.33333H0.857143V13.3333ZM2.57143 5H9.42857V13.3333H2.57143V5ZM9 0.833333L8.14286 0H3.85714L3 0.833333H0V2.5H12V0.833333H9Z" fill="#747474"/>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 459 B |
@ -0,0 +1,128 @@
|
|||||||
|
import { useEffect, useRef, useState } from 'react';
|
||||||
|
import { useSelector } from 'react-redux';
|
||||||
|
import Edit from '../assets/edit.svg';
|
||||||
|
import Exit from '../assets/exit.svg';
|
||||||
|
import Message from '../assets/message.svg';
|
||||||
|
import CheckMark from '../assets/checkmark.svg';
|
||||||
|
import Trash from '../assets/trash.svg';
|
||||||
|
|
||||||
|
import { selectConversationId } from '../preferences/preferenceSlice';
|
||||||
|
import { useOutsideAlerter } from '../hooks';
|
||||||
|
|
||||||
|
interface ConversationProps {
|
||||||
|
name: string;
|
||||||
|
id: string;
|
||||||
|
}
|
||||||
|
interface ConversationTileProps {
|
||||||
|
conversation: ConversationProps;
|
||||||
|
selectConversation: (arg1: string) => void;
|
||||||
|
onDeleteConversation: (arg1: string) => void;
|
||||||
|
onSave: ({ name, id }: ConversationProps) => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function ConversationTile({
|
||||||
|
conversation,
|
||||||
|
selectConversation,
|
||||||
|
onDeleteConversation,
|
||||||
|
onSave,
|
||||||
|
}: ConversationTileProps) {
|
||||||
|
const conversationId = useSelector(selectConversationId);
|
||||||
|
const tileRef = useRef<HTMLInputElement>(null);
|
||||||
|
|
||||||
|
const [isEdit, setIsEdit] = useState(false);
|
||||||
|
const [conversationName, setConversationsName] = useState('');
|
||||||
|
useOutsideAlerter(
|
||||||
|
tileRef,
|
||||||
|
() =>
|
||||||
|
handleSaveConversation({
|
||||||
|
id: conversationId || conversation.id,
|
||||||
|
name: conversationName,
|
||||||
|
}),
|
||||||
|
[conversationName],
|
||||||
|
);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
setConversationsName(conversation.name);
|
||||||
|
}, [conversation.name]);
|
||||||
|
|
||||||
|
function handleEditConversation() {
|
||||||
|
setIsEdit(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleSaveConversation(changedConversation: ConversationProps) {
|
||||||
|
if (changedConversation.name.trim().length) {
|
||||||
|
onSave(changedConversation);
|
||||||
|
setIsEdit(false);
|
||||||
|
} else {
|
||||||
|
onClear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function onClear() {
|
||||||
|
setConversationsName(conversation.name);
|
||||||
|
setIsEdit(false);
|
||||||
|
}
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
ref={tileRef}
|
||||||
|
onClick={() => {
|
||||||
|
selectConversation(conversation.id);
|
||||||
|
}}
|
||||||
|
className={`my-auto mx-4 mt-4 flex h-12 cursor-pointer items-center justify-between gap-4 rounded-3xl hover:bg-gray-100 ${
|
||||||
|
conversationId === conversation.id ? 'bg-gray-100' : ''
|
||||||
|
}`}
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
className={`flex ${
|
||||||
|
conversationId === conversation.id ? 'w-[75%]' : 'w-[95%]'
|
||||||
|
} gap-4`}
|
||||||
|
>
|
||||||
|
<img src={Message} className="ml-2 w-5"></img>
|
||||||
|
{isEdit ? (
|
||||||
|
<input
|
||||||
|
autoFocus
|
||||||
|
type="text"
|
||||||
|
className="h-6 w-full px-1 text-sm font-normal leading-6 outline-[#0075FF] focus:outline-1"
|
||||||
|
value={conversationName}
|
||||||
|
onChange={(e) => setConversationsName(e.target.value)}
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<p className="my-auto overflow-hidden overflow-ellipsis whitespace-nowrap text-sm font-normal leading-6 text-eerie-black">
|
||||||
|
{conversationName}
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
{conversationId === conversation.id ? (
|
||||||
|
<div className="flex">
|
||||||
|
<img
|
||||||
|
src={isEdit ? CheckMark : Edit}
|
||||||
|
alt="Edit"
|
||||||
|
className="mr-2 h-4 w-4 cursor-pointer hover:opacity-50"
|
||||||
|
id={`img-${conversation.id}`}
|
||||||
|
onClick={(event) => {
|
||||||
|
event.stopPropagation();
|
||||||
|
isEdit
|
||||||
|
? handleSaveConversation({
|
||||||
|
id: conversationId,
|
||||||
|
name: conversationName,
|
||||||
|
})
|
||||||
|
: handleEditConversation();
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<img
|
||||||
|
src={isEdit ? Exit : Trash}
|
||||||
|
alt="Exit"
|
||||||
|
className={`mr-4 ${
|
||||||
|
isEdit ? 'h-3 w-3' : 'h-4 w-4'
|
||||||
|
}mt-px cursor-pointer hover:opacity-50`}
|
||||||
|
id={`img-${conversation.id}`}
|
||||||
|
onClick={(event) => {
|
||||||
|
event.stopPropagation();
|
||||||
|
isEdit ? onClear() : onDeleteConversation(conversation.id);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
) : null}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
Loading…
Reference in New Issue