@compassdigital/sdk.typescript 4.400.0 → 4.401.0

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/src/index.ts CHANGED
@@ -1306,6 +1306,8 @@ import {
1306
1306
  PostAiImageGenerateResponse,
1307
1307
  PostAiTranslateBody,
1308
1308
  PostAiTranslateResponse,
1309
+ PostOpenaiChatBody,
1310
+ PostOpenaiChatResponse,
1309
1311
  } from './interface/ai';
1310
1312
 
1311
1313
  import {
@@ -14274,6 +14276,19 @@ export class ServiceClient extends BaseServiceClient {
14274
14276
  return this.request('ai', '/ai/translate', 'POST', `/ai/translate`, body, options);
14275
14277
  }
14276
14278
 
14279
+ /**
14280
+ * POST /ai/openai/chat - Chat with OpenAI
14281
+ *
14282
+ * @param body
14283
+ * @param options - additional request options
14284
+ */
14285
+ post_openai_chat(
14286
+ body: PostOpenaiChatBody,
14287
+ options?: RequestOptions,
14288
+ ): ResponsePromise<PostOpenaiChatResponse> {
14289
+ return this.request('ai', '/ai/openai/chat', 'POST', `/ai/openai/chat`, body, options);
14290
+ }
14291
+
14277
14292
  /**
14278
14293
  * POST /centricos/ai/item/description - Generate item description
14279
14294
  *
@@ -78,6 +78,34 @@ export interface TranslateResponse {
78
78
  translations: Record<string, string>;
79
79
  }
80
80
 
81
+ export interface OpenAiChatBody {
82
+ // The model to use for the chat completion
83
+ model: string;
84
+ // The messages to send to the chat completion
85
+ messages: string[];
86
+ // The tools to use for the chat completion
87
+ tools: string[];
88
+ // The tool choices to use for the chat completion
89
+ tool_choice: Record<string, any>;
90
+ // The temperature to use for the chat completion
91
+ temperature: number;
92
+ // The max tokens to use for the chat completion
93
+ max_tokens: number;
94
+ }
95
+
96
+ export interface OpenAiChatResponse {
97
+ // The id of the chat completion
98
+ id: string;
99
+ // The object of the chat completion
100
+ object: string;
101
+ // The created at of the chat completion
102
+ created: number;
103
+ // The model of the chat completion
104
+ model: string;
105
+ // The choices of the chat completion
106
+ choices: string[];
107
+ }
108
+
81
109
  // POST /ai/language/generate - Generate text from a given prompt
82
110
 
83
111
  export type PostAiLanguageGenerateBody = GenerateTextRequest;
@@ -95,3 +123,9 @@ export type PostAiImageGenerateResponse = GenerateImageResponse;
95
123
  export type PostAiTranslateBody = TranslateRequest;
96
124
 
97
125
  export type PostAiTranslateResponse = TranslateResponse;
126
+
127
+ // POST /ai/openai/chat - Chat with OpenAI
128
+
129
+ export type PostOpenaiChatBody = OpenAiChatBody;
130
+
131
+ export type PostOpenaiChatResponse = OpenAiChatResponse;