@eka-care/ekascribe-ts-sdk 3.0.39 → 3.0.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -69,7 +69,7 @@ declare class DocumentManager {
69
69
  createTemplate({ title, desc, section_ids, }: TPostV1TemplateRequest): Promise<TPostV1TemplateResponse>;
70
70
  updateTemplate({ template_id, title, desc, section_ids, }: TPostV1TemplateRequest): Promise<TPostV1TemplateResponse>;
71
71
  deleteTemplate(templateId: string): Promise<TPostV1TemplateResponse>;
72
- aiGenerateTemplate(formData: FormData): Promise<TPostCookV1MediaAiCreateTemplateResponse>;
72
+ aiGenerateTemplate({ file, instruction, }: TPostV1AiCreateTemplateRequest): Promise<TPostV1AiCreateTemplateResponse>;
73
73
  convertToTemplate({ txn_id, template_id, }: {
74
74
  txn_id: string;
75
75
  template_id: string;
@@ -815,14 +815,6 @@ export declare type TPostCogResponse = {
815
815
  is_session_expired?: boolean;
816
816
  };
817
817
 
818
- declare type TPostCookV1MediaAiCreateTemplateResponse = {
819
- title: string;
820
- desc: string;
821
- sections: TSection[];
822
- status_code: number;
823
- message: string;
824
- };
825
-
826
818
  export declare type TPostTransactionInitRequest = {
827
819
  mode: string;
828
820
  s3Url?: string;
@@ -865,6 +857,18 @@ export declare type TPostTransactionResponse = {
865
857
  };
866
858
  };
867
859
 
860
+ declare interface TPostV1AiCreateTemplateRequest {
861
+ file?: File;
862
+ instruction?: string;
863
+ }
864
+
865
+ declare type TPostV1AiCreateTemplateResponse = {
866
+ title: string;
867
+ template_instructions: string;
868
+ status_code: number;
869
+ message: string;
870
+ };
871
+
868
872
  export declare type TPostV1ConvertToTemplateRequest = {
869
873
  txn_id: string;
870
874
  template_id?: string;
package/dist/index.mjs CHANGED
@@ -4844,20 +4844,30 @@ class Jl {
4844
4844
  return { status_code: r.status_code, msg: r.message };
4845
4845
  }
4846
4846
  }
4847
- async aiGenerateTemplate(e) {
4847
+ async aiGenerateTemplate({
4848
+ file: e,
4849
+ instruction: n
4850
+ }) {
4848
4851
  try {
4849
- const n = await this.transport.request({
4852
+ const r = n?.trim();
4853
+ let s;
4854
+ if (e) {
4855
+ const o = new FormData();
4856
+ o.append("file", e), r && o.append("instruction", r), s = o;
4857
+ } else
4858
+ s = { instruction: r ?? "" };
4859
+ const i = await this.transport.request({
4850
4860
  method: "POST",
4851
- url: `${this.hosts.cookV1}/medai/ai-create-template`,
4852
- body: e,
4853
- timeout: 6e4
4861
+ url: `${this.hosts.voiceV1}/template/ai-create-template`,
4862
+ body: s,
4863
+ timeout: 3e4
4854
4864
  });
4855
- return { ...n.data, status_code: n.status };
4856
- } catch (n) {
4857
- const r = S(n, "Failed to AI generate template,");
4865
+ return { ...i.data, status_code: i.status };
4866
+ } catch (r) {
4867
+ const s = S(r, "Failed to AI generate template,");
4858
4868
  return {
4859
- status_code: r.status_code,
4860
- message: r.message
4869
+ status_code: s.status_code,
4870
+ message: s.message
4861
4871
  };
4862
4872
  }
4863
4873
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eka-care/ekascribe-ts-sdk",
3
- "version": "3.0.39",
3
+ "version": "3.0.40",
4
4
  "description": "EkaScribe TypeScript SDK - Modern ES2020 build",
5
5
  "main": "dist/index.mjs",
6
6
  "module": "dist/index.mjs",