mirror of
https://github.com/mealie-recipes/mealie.git
synced 2026-05-26 03:30:26 -04:00
feat: In-app AI Provider Configuration (#7650)
This commit is contained in:
@@ -4,11 +4,11 @@ import type { DebugResponse } from "~/lib/api/types/admin";
|
||||
const prefix = "/api";
|
||||
|
||||
const routes = {
|
||||
openai: `${prefix}/admin/debug/openai`,
|
||||
openai: providerId => `${prefix}/admin/debug/openai/${providerId}`,
|
||||
};
|
||||
|
||||
export class AdminDebugAPI extends BaseAPI {
|
||||
async debugOpenAI(fileObject: Blob | File | undefined = undefined, fileName = "") {
|
||||
async debugOpenAI(providerId: string, fileObject: Blob | File | undefined = undefined, fileName = "") {
|
||||
let formData: FormData | null = null;
|
||||
if (fileObject) {
|
||||
formData = new FormData();
|
||||
@@ -16,6 +16,6 @@ export class AdminDebugAPI extends BaseAPI {
|
||||
formData.append("extension", fileName.split(".").pop() ?? "");
|
||||
}
|
||||
|
||||
return await this.requests.post<DebugResponse>(routes.openai, formData);
|
||||
return await this.requests.post<DebugResponse>(routes.openai(providerId), formData);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user