Compare commits
5 Commits
wenker
...
f0c16a3cd1
| Author | SHA1 | Date | |
|---|---|---|---|
|
f0c16a3cd1
|
|||
|
f54b192616
|
|||
|
b20de667a4
|
|||
|
a76cf224f6
|
|||
|
943cb5f392
|
27
.gitea/workflows/default.yml
Normal file
27
.gitea/workflows/default.yml
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
name: Build static content
|
||||||
|
|
||||||
|
on:
|
||||||
|
# Runs on pushes targeting the default branch
|
||||||
|
push:
|
||||||
|
branches: ["master"]
|
||||||
|
|
||||||
|
# Allows you to run this workflow manually from the Actions tab
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: Use Node.js 18.x
|
||||||
|
uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
node-version: 18.x
|
||||||
|
cache: 'npm'
|
||||||
|
- run: npm install
|
||||||
|
- run: npm run build
|
||||||
|
- name: Upload artifact
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: dist-files
|
||||||
|
path: './dist/'
|
||||||
@@ -87,7 +87,7 @@ export const newChatStore = (
|
|||||||
image_gen_api = "https://api.openai.com/v1/images/generations",
|
image_gen_api = "https://api.openai.com/v1/images/generations",
|
||||||
image_gen_key = "",
|
image_gen_key = "",
|
||||||
json_mode = false,
|
json_mode = false,
|
||||||
logprobs = true
|
logprobs = false
|
||||||
): ChatStore => {
|
): ChatStore => {
|
||||||
return {
|
return {
|
||||||
chatgpt_api_web_version: CHATGPT_API_WEB_VERSION,
|
chatgpt_api_web_version: CHATGPT_API_WEB_VERSION,
|
||||||
@@ -290,7 +290,7 @@ export function App() {
|
|||||||
chatStore.image_gen_api,
|
chatStore.image_gen_api,
|
||||||
chatStore.image_gen_key,
|
chatStore.image_gen_key,
|
||||||
chatStore.json_mode,
|
chatStore.json_mode,
|
||||||
chatStore.logprobs
|
false // logprobs default to false
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
setSelectedChatIndex(newKey as number);
|
setSelectedChatIndex(newKey as number);
|
||||||
@@ -339,7 +339,7 @@ export function App() {
|
|||||||
<div className="flex flex-col h-full p-2 border-r-indigo-500 border-2 dark:border-slate-800 dark:border-r-indigo-500 dark:text-black">
|
<div className="flex flex-col h-full p-2 border-r-indigo-500 border-2 dark:border-slate-800 dark:border-r-indigo-500 dark:text-black">
|
||||||
<div className="grow overflow-scroll">
|
<div className="grow overflow-scroll">
|
||||||
<button
|
<button
|
||||||
className="bg-violet-300 p-1 rounded hover:bg-violet-400"
|
className="w-full bg-violet-300 p-1 rounded hover:bg-violet-400"
|
||||||
onClick={handleNewChatStore}
|
onClick={handleNewChatStore}
|
||||||
>
|
>
|
||||||
{Tr("NEW")}
|
{Tr("NEW")}
|
||||||
|
|||||||
@@ -56,11 +56,24 @@ export default function ChatBOX(props: {
|
|||||||
const [showAddToolMsg, setShowAddToolMsg] = useState(false);
|
const [showAddToolMsg, setShowAddToolMsg] = useState(false);
|
||||||
const [newToolCallID, setNewToolCallID] = useState("");
|
const [newToolCallID, setNewToolCallID] = useState("");
|
||||||
const [newToolContent, setNewToolContent] = useState("");
|
const [newToolContent, setNewToolContent] = useState("");
|
||||||
|
let default_follow = localStorage.getItem("follow");
|
||||||
|
if (default_follow === null) {
|
||||||
|
default_follow = "true";
|
||||||
|
}
|
||||||
|
const [follow, _setFollow] = useState(default_follow === "true");
|
||||||
const mediaRef = createRef();
|
const mediaRef = createRef();
|
||||||
|
|
||||||
|
const setFollow = (follow: boolean) => {
|
||||||
|
console.log("set follow", follow);
|
||||||
|
localStorage.setItem("follow", follow.toString());
|
||||||
|
_setFollow(follow);
|
||||||
|
};
|
||||||
|
|
||||||
const messagesEndRef = createRef();
|
const messagesEndRef = createRef();
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
messagesEndRef.current.scrollIntoView({ behavior: "smooth" });
|
if (follow) {
|
||||||
|
messagesEndRef.current.scrollIntoView({ behavior: "smooth" });
|
||||||
|
}
|
||||||
}, [showRetry, showGenerating, generatingMessage]);
|
}, [showRetry, showGenerating, generatingMessage]);
|
||||||
|
|
||||||
const client = new ChatGPT(chatStore.apiKey);
|
const client = new ChatGPT(chatStore.apiKey);
|
||||||
@@ -804,6 +817,18 @@ export default function ChatBOX(props: {
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
{generatingMessage && (
|
||||||
|
<span
|
||||||
|
class="p-2 m-2 rounded bg-white dark:text-black dark:bg-white dark:bg-opacity-50 dark:text-black dark:bg-opacity-50"
|
||||||
|
style={{ textAlign: "right" }}
|
||||||
|
onClick={() => {
|
||||||
|
setFollow(!follow);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<label>Follow</label>
|
||||||
|
<input type="checkbox" checked={follow} />
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
<div className="flex justify-between">
|
<div className="flex justify-between">
|
||||||
{(chatStore.model.match("vision") ||
|
{(chatStore.model.match("vision") ||
|
||||||
(chatStore.image_gen_api && chatStore.image_gen_key)) && (
|
(chatStore.image_gen_api && chatStore.image_gen_key)) && (
|
||||||
|
|||||||
Reference in New Issue
Block a user