Skip to content

Commit

Permalink
bump
Browse files Browse the repository at this point in the history
  • Loading branch information
msveshnikov committed Mar 17, 2024
1 parent 5874e16 commit 565d527
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 23 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Use the official Node.js image as the base image
FROM node:18
FROM node:20

# Set the working directory in the container
WORKDIR /app
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "allchat",
"version": "1.0.0",
"private": true,
"dependencies": {
"@emotion/react": "^11.11.4",
"@emotion/styled": "^11.11.0",
Expand Down
6 changes: 0 additions & 6 deletions server/gemini.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@ export const getTextGemini = async (prompt, temperature) => {
temperature: temperature || 0.5,
top_p: 0.8,
},
safetySettings: [
{ category: "HARM_CATEGORY_HARASSMENT", threshold: "BLOCK_NONE" },
{ category: "HARM_CATEGORY_HATE_SPEECH", threshold: "BLOCK_NONE" },
{ category: "HARM_CATEGORY_SEXUALLY_EXPLICIT", threshold: "BLOCK_NONE" },
{ category: "HARM_CATEGORY_DANGEROUS_CONTENT", threshold: "BLOCK_NONE" },
],
});

const chat = generativeModel.startChat({});
Expand Down
28 changes: 13 additions & 15 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import React, { useState, useRef, useEffect } from "react";
import { Box, TextField, Button, Container, CircularProgress } from "@mui/material";
import ReactMarkdown from "react-markdown";

const APP_URL =
process.env.NODE_ENV === "production" ? "https://allchat.online/api/interact" : "http://localhost:5000/interact";

function App() {
const [input, setInput] = useState("");
const [chatHistory, setChatHistory] = useState([]);
Expand Down Expand Up @@ -30,21 +33,16 @@ function App() {
setInput("");
setIsModelResponding(true);

const response = await fetch(
process.env.NODE_ENV === "production"
? "https://allchat.online/api/interact"
: "http://localhost:5000/interact",
{
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
input,
chatHistory: chatHistory.map((h) => ({ user: h.user, assistant: h.assistant })),
}),
}
);
const response = await fetch(APP_URL, {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
input,
chatHistory: chatHistory.map((h) => ({ user: h.user, assistant: h.assistant })),
}),
});

if (response.ok) {
const data = await response.json();
Expand Down

0 comments on commit 565d527

Please sign in to comment.