Skip to content

Commit

Permalink
Fix issue reading provider model list
Browse files Browse the repository at this point in the history
  • Loading branch information
hlohaus committed Jan 26, 2025
1 parent 42805ac commit 5ee34a9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions g4f/gui/client/static/js/chat.v1.js
Original file line number Diff line number Diff line change
Expand Up @@ -2209,7 +2209,7 @@ async function api(ressource, args=null, files=null, message_id=null, scroll=tru
return pywebview.api[`get_${ressource}`]();
}
const headers = {};
const url = new URL(`/backend-api/v2/${ressource}`, window?.location || "http://localhost:8080");
let url = `/backend-api/v2/${ressource}`;
let response;
if (ressource == "models" && args) {
api_key = get_api_key_by_provider(args);
Expand All @@ -2220,7 +2220,7 @@ async function api(ressource, args=null, files=null, message_id=null, scroll=tru
if (api_base) {
headers.x_api_base = api_base;
}
ressource = `${ressource}/${args}`;
url = `/backend-api/v2/${ressource}/${args}`;
} else if (ressource == "conversation") {
let body = JSON.stringify(args);
headers.accept = 'text/event-stream';
Expand Down

0 comments on commit 5ee34a9

Please sign in to comment.