refac: openai connections
This commit is contained in:
@@ -32,7 +32,13 @@ export const getOllamaConfig = async (token: string = '') => {
|
||||
return res;
|
||||
};
|
||||
|
||||
export const updateOllamaConfig = async (token: string = '', enable_ollama_api: boolean) => {
|
||||
type OllamaConfig = {
|
||||
ENABLE_OLLAMA_API: boolean,
|
||||
OLLAMA_BASE_URLS: string[],
|
||||
OLLAMA_API_CONFIGS: object
|
||||
}
|
||||
|
||||
export const updateOllamaConfig = async (token: string = '', config: OllamaConfig) => {
|
||||
let error = null;
|
||||
|
||||
const res = await fetch(`${OLLAMA_API_BASE_URL}/config/update`, {
|
||||
@@ -43,7 +49,7 @@ export const updateOllamaConfig = async (token: string = '', enable_ollama_api:
|
||||
...(token && { authorization: `Bearer ${token}` })
|
||||
},
|
||||
body: JSON.stringify({
|
||||
enable_ollama_api: enable_ollama_api
|
||||
...config
|
||||
})
|
||||
})
|
||||
.then(async (res) => {
|
||||
|
||||
Reference in New Issue
Block a user