-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b4c8642
commit 0792881
Showing
6 changed files
with
70 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { endpoints } from './api-endpoints.js'; | ||
import { replaceUrl } from '$lib/helpers/http.js'; | ||
import axios from 'axios'; | ||
|
||
/** | ||
* Get provider list | ||
* @returns {Promise<string[]>} | ||
*/ | ||
export async function getLlmProviders() { | ||
let url = endpoints.llmProvidersUrl; | ||
const response = await axios.get(url); | ||
return response.data; | ||
} | ||
|
||
/** | ||
* Get provider model list | ||
* @param {string} provider | ||
* @returns {Promise<import('$types').LlmModelSetting[]>} | ||
*/ | ||
export async function getLlmProviderModels(provider) { | ||
let url = replaceUrl(endpoints.llmProviderModelsUrl, {provider: provider}); | ||
const response = await axios.get(url); | ||
return response.data; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters