diff --git a/src/axios.ts b/src/axios.ts index 165eade..1e00a5e 100644 --- a/src/axios.ts +++ b/src/axios.ts @@ -73,7 +73,7 @@ export interface MultinetAxiosInstance extends AxiosInstance { updateSession(workspace: string, sessionId: number, type: 'network' | 'table', state: object): AxiosPromise; renameSession(workspace: string, sessionId: number, type: 'network' | 'table', name: string): AxiosPromise; getSession(workspace: string, sessionId: number, type: 'network' | 'table'): AxiosPromise; - generateAltText(verbosity: string, explain: string, data: object, title?: string, level?: number): AxiosPromise; + generateAltText(structured: boolean, data: object, title?: string, level?: number): AxiosPromise; networkBuildRequests(workspace: string): AxiosPromise; } @@ -270,15 +270,14 @@ export function multinetAxiosInstance(config: AxiosRequestConfig): MultinetAxios return this.get(`workspaces/${workspace}/sessions/${type}/${sessionId}/`); }; - Proto.generateAltText = function(verbosity: string, explain: string, data: object, title?: string, level?: number): AxiosPromise { + Proto.generateAltText = function(structured: boolean, data: object, title?: string, level?: number): AxiosPromise { const jsonString = JSON.stringify(data); const blob = new Blob([jsonString], { type: 'application/json' }); const file = new File([blob], 'data.json'); const formData = new FormData(); - formData.append('verbosity', verbosity); - formData.append('explain', explain); + formData.append('structured', structured.toString()); formData.append('data', file); if (title) { formData.append('title', title); diff --git a/src/index.ts b/src/index.ts index f95021d..c5b5ed4 100644 --- a/src/index.ts +++ b/src/index.ts @@ -285,8 +285,8 @@ class MultinetAPI { return (await this.axios.getSession(workspace, sessionId, type)).data; } - public async generateAltText(verbosity: string, explain: string, data: object, title?: string, level?: number): Promise { - return (await this.axios.generateAltText(verbosity, explain, data, title, level)).data; + public async generateAltText(structured: boolean, data: object, title?: string, level?: number): Promise { + return (await this.axios.generateAltText(structured, data, title, level)).data; } public async networkBuildRequests(workspace: string): Promise {