import axios, { AxiosInstance, AxiosResponse } from 'axios'; import { GptResponsePayload } from '@3cr/viewer-types-ts'; export class GptService { static Instantiate() { return new GptService(); } client: AxiosInstance = axios.create(); async GenerateAnnotations( title: string, question: number = 0, ): Promise> { const testVersion = window.location.href.includes('test.') || window.location.href.includes('localhost') || window.location.href.includes('next.'); return this.client.post( `https://${testVersion ? 'test.' : ''}api.singular.health/api/GPT/Smart/Annotation`, null, { params: { annotationTitle: title, question }, }, ); } }