feat(http-headers): add `Content-Type`

This commit is contained in:
ItzCrazyKns 2024-05-04 15:01:53 +05:30
parent e3fef3a1be
commit 0440a810f5
No known key found for this signature in database
GPG Key ID: 8162927C7CCE3065
2 changed files with 11 additions and 2 deletions

View File

@ -36,6 +36,11 @@ const useSocket = (url: string) => {
) { ) {
const providers = await fetch( const providers = await fetch(
`${process.env.NEXT_PUBLIC_API_URL}/models`, `${process.env.NEXT_PUBLIC_API_URL}/models`,
{
headers: {
'Content-Type': 'application/json',
},
},
).then(async (res) => await res.json()); ).then(async (res) => await res.json());
const chatModelProviders = providers.chatModelProviders; const chatModelProviders = providers.chatModelProviders;

View File

@ -46,7 +46,11 @@ const SettingsDialog = ({
if (isOpen) { if (isOpen) {
const fetchConfig = async () => { const fetchConfig = async () => {
setIsLoading(true); setIsLoading(true);
const res = await fetch(`${process.env.NEXT_PUBLIC_API_URL}/config`); const res = await fetch(`${process.env.NEXT_PUBLIC_API_URL}/config`, {
headers: {
'Content-Type': 'application/json',
},
});
const data = await res.json(); const data = await res.json();
setConfig(data); setConfig(data);
setIsLoading(false); setIsLoading(false);
@ -251,7 +255,7 @@ const SettingsDialog = ({
</> </>
)} )}
{/* Embedding models */} {/* Embedding models */}
{config.chatModelProviders && ( {config.embeddingModelProviders && (
<div className="flex flex-col space-y-1"> <div className="flex flex-col space-y-1">
<p className="text-white/70 text-sm"> <p className="text-white/70 text-sm">
Embedding model Provider Embedding model Provider