complete docker setup

This commit is contained in:
Danny Avila 2023-03-06 14:04:06 -05:00
parent ff7b016190
commit 52e529dcbe
12 changed files with 26 additions and 158506 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -23,8 +23,8 @@ export default function Conversation({
const { modelMap } = useSelector((state) => state.models);
const inputRef = useRef(null);
const dispatch = useDispatch();
const { trigger } = manualSWR(`http://localhost:3080/messages/${id}`, 'get');
const rename = manualSWR(`http://localhost:3080/convos/update`, 'post');
const { trigger } = manualSWR(`http://api:3080/messages/${id}`, 'get');
const rename = manualSWR(`http://api:3080/convos/update`, 'post');
const clickHandler = async () => {
if (conversationId === id) {

View file

@ -9,7 +9,7 @@ import { setMessages } from '~/store/messageSlice';
export default function DeleteButton({ conversationId, renaming, cancelHandler }) {
const dispatch = useDispatch();
const { trigger } = manualSWR(
`http://localhost:3080/convos/clear`,
`http://api:3080/convos/clear`,
'post',
() => {
dispatch(setMessages([]));

View file

@ -56,16 +56,21 @@ export default function Message({
if (notUser) {
props.className =
'w-full border-b border-black/10 bg-gray-50 dark:border-gray-900/50 text-gray-800 dark:text-gray-100 group bg-gray-100 dark:bg-[#444654]';
'w-full border-b border-black/10 bg-gray-50 dark:border-gray-900/50 text-gray-800 dark:text-gray-100 group bg-gray-100 dark:bg-[#444654]';
}
if (notUser && backgroundColor || sender === 'bingai') {
if ((notUser && backgroundColor) || sender === 'bingai') {
icon = (
<div
style={{ backgroundColor }}
className="relative flex h-[30px] w-[30px] items-center justify-center rounded-sm p-1 text-white"
>
{sender === 'bingai' ? <BingIcon /> : <GPTIcon />}
{error && (
<span className="absolute right-0 top-[20px] -mr-2 flex h-4 w-4 items-center justify-center rounded-full border border-white bg-red-500 text-[10px] text-white">
!
</span>
)}
</div>
);
}

View file

@ -23,7 +23,7 @@ export default function ModelDialog({ mutate, modelMap }) {
const [saveText, setSaveText] = useState('Save');
const [required, setRequired] = useState(false);
const inputRef = useRef(null);
const updateCustomGpt = manualSWR(`http://localhost:3080/customGpts/`, 'post');
const updateCustomGpt = manualSWR(`http://api:3080/customGpts/`, 'post');
const submitHandler = (e) => {
if (chatGptLabel.length === 0) {

View file

@ -25,8 +25,7 @@ export default function ModelMenu() {
const dispatch = useDispatch();
const { model, customModel } = useSelector((state) => state.submit);
const { models, modelMap, initial } = useSelector((state) => state.models);
const { trigger } = manualSWR(`http://localhost:3080/customGpts`, 'get', (res) => {
console.log('models data (response)', res);
const { trigger } = manualSWR(`http://api:3080/customGpts`, 'get', (res) => {
if (models.length + res.length === models.length) {
return;
}

View file

@ -11,12 +11,12 @@ export default function ClearConvos() {
const { mutate } = useSWRConfig()
const { trigger } = manualSWR(
`http://localhost:3080/convos/clear`,
`http://api:3080/convos/clear`,
'post',
() => {
dispatch(setMessages([]));
dispatch(setConversation({ error: false, title: 'New chat', conversationId: null, parentMessageId: null }));
mutate(`http://localhost:3080/convos`);
mutate(`http://api:3080/convos`);
}
);

View file

@ -17,7 +17,7 @@ export default function Nav() {
};
const { data, isLoading, mutate } = swr(
`http://localhost:3080/convos?pageNumber=${pageNumber}`
`http://api:3080/convos?pageNumber=${pageNumber}`
, onSuccess);
const containerRef = useRef(null);
const scrollPositionRef = useRef(null);

View file

@ -11,7 +11,7 @@ export default function handleSubmit({
chatGptLabel,
promptPrefix
}) {
const endpoint = `http://localhost:3080/ask`;
const endpoint = `http://api:3080/ask`;
let payload = { model, text, chatGptLabel, promptPrefix };
if (convo.conversationId && convo.parentMessageId) {
payload = {