feat(providers): add `Content-Type` header

This commit is contained in:
ItzCrazyKns 2024-05-05 10:53:27 +05:30
parent f8fd2a6fb0
commit ba7b92ffde
No known key found for this signature in database
GPG Key ID: 8162927C7CCE3065
1 changed files with 10 additions and 2 deletions

View File

@ -90,7 +90,11 @@ export const getAvailableChatModelProviders = async () => {
if (ollamaEndpoint) { if (ollamaEndpoint) {
try { try {
const response = await fetch(`${ollamaEndpoint}/api/tags`); const response = await fetch(`${ollamaEndpoint}/api/tags`, {
headers: {
'Content-Type': 'application/json',
},
});
const { models: ollamaModels } = (await response.json()) as any; const { models: ollamaModels } = (await response.json()) as any;
@ -137,7 +141,11 @@ export const getAvailableEmbeddingModelProviders = async () => {
if (ollamaEndpoint) { if (ollamaEndpoint) {
try { try {
const response = await fetch(`${ollamaEndpoint}/api/tags`); const response = await fetch(`${ollamaEndpoint}/api/tags`, {
headers: {
'Content-Type': 'application/json',
},
});
const { models: ollamaModels } = (await response.json()) as any; const { models: ollamaModels } = (await response.json()) as any;