mirror of
https://github.com/ItzCrazyKns/Perplexica.git
synced 2025-09-16 06:11:32 +00:00
Compare commits
4 Commits
07c50a02c5
...
29cbfb2c1f
Author | SHA1 | Date | |
---|---|---|---|
|
29cbfb2c1f | ||
|
4c73caadf6 | ||
|
728919f7bf | ||
|
68048dfd56 |
@@ -563,12 +563,16 @@ const Page = () => {
|
|||||||
<Input
|
<Input
|
||||||
type="text"
|
type="text"
|
||||||
placeholder="Model name"
|
placeholder="Model name"
|
||||||
defaultValue={config.customOpenaiModelName}
|
value={config.customOpenaiModelName}
|
||||||
onChange={(e) =>
|
isSaving={savingStates['customOpenaiModelName']}
|
||||||
setConfig({
|
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
...config,
|
setConfig((prev) => ({
|
||||||
|
...prev!,
|
||||||
customOpenaiModelName: e.target.value,
|
customOpenaiModelName: e.target.value,
|
||||||
})
|
}));
|
||||||
|
}}
|
||||||
|
onSave={(value) =>
|
||||||
|
saveConfig('customOpenaiModelName', value)
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@@ -579,12 +583,16 @@ const Page = () => {
|
|||||||
<Input
|
<Input
|
||||||
type="text"
|
type="text"
|
||||||
placeholder="Custom OpenAI API Key"
|
placeholder="Custom OpenAI API Key"
|
||||||
defaultValue={config.customOpenaiApiKey}
|
value={config.customOpenaiApiKey}
|
||||||
onChange={(e) =>
|
isSaving={savingStates['customOpenaiApiKey']}
|
||||||
setConfig({
|
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
...config,
|
setConfig((prev) => ({
|
||||||
|
...prev!,
|
||||||
customOpenaiApiKey: e.target.value,
|
customOpenaiApiKey: e.target.value,
|
||||||
})
|
}));
|
||||||
|
}}
|
||||||
|
onSave={(value) =>
|
||||||
|
saveConfig('customOpenaiApiKey', value)
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@@ -595,12 +603,16 @@ const Page = () => {
|
|||||||
<Input
|
<Input
|
||||||
type="text"
|
type="text"
|
||||||
placeholder="Custom OpenAI Base URL"
|
placeholder="Custom OpenAI Base URL"
|
||||||
defaultValue={config.customOpenaiApiUrl}
|
value={config.customOpenaiApiUrl}
|
||||||
onChange={(e) =>
|
isSaving={savingStates['customOpenaiApiUrl']}
|
||||||
setConfig({
|
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
...config,
|
setConfig((prev) => ({
|
||||||
|
...prev!,
|
||||||
customOpenaiApiUrl: e.target.value,
|
customOpenaiApiUrl: e.target.value,
|
||||||
})
|
}));
|
||||||
|
}}
|
||||||
|
onSave={(value) =>
|
||||||
|
saveConfig('customOpenaiApiUrl', value)
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -377,11 +377,16 @@ const ChatWindow = ({ id }: { id?: string }) => {
|
|||||||
const [isReady, setIsReady] = useState(false);
|
const [isReady, setIsReady] = useState(false);
|
||||||
|
|
||||||
const [isWSReady, setIsWSReady] = useState(false);
|
const [isWSReady, setIsWSReady] = useState(false);
|
||||||
const ws = useSocket(
|
|
||||||
process.env.NEXT_PUBLIC_WS_URL!,
|
let websocketUrl = process.env.NEXT_PUBLIC_WS_URL!;
|
||||||
setIsWSReady,
|
if (websocketUrl.startsWith('/')) {
|
||||||
setHasError,
|
const protocol = window.location.protocol === 'https:' ? 'wss://' : 'ws://';
|
||||||
);
|
const host = window.location.host;
|
||||||
|
const path = websocketUrl;
|
||||||
|
websocketUrl = `${protocol}${host}${path}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
const ws = useSocket(websocketUrl, setIsWSReady, setHasError);
|
||||||
|
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const [messageAppeared, setMessageAppeared] = useState(false);
|
const [messageAppeared, setMessageAppeared] = useState(false);
|
||||||
|
Reference in New Issue
Block a user