@kokimoki/app 1.13.0 → 1.15.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.
@@ -131,6 +131,12 @@ export declare class KokimokiClient<ClientContextT = any> extends KokimokiClient
131
131
  sendWebhook<T>(event: string, data: T): Promise<{
132
132
  jobId: string;
133
133
  }>;
134
+ /**
135
+ * Generic AI chat endpoint: send a system prompt (and optional user prompt) to get a response.
136
+ */
137
+ chat(systemPrompt: string, userPrompt?: string, temperature?: number, maxTokens?: number): Promise<{
138
+ content: string;
139
+ }>;
134
140
  /**
135
141
  * Use AI to apply prompt to an image
136
142
  */
@@ -711,6 +711,20 @@ export class KokimokiClient extends EventEmitter {
711
711
  });
712
712
  return await res.json();
713
713
  }
714
+ /**
715
+ * Generic AI chat endpoint: send a system prompt (and optional user prompt) to get a response.
716
+ */
717
+ async chat(systemPrompt, userPrompt, temperature, maxTokens) {
718
+ const res = await fetch(`${this._apiUrl}/ai/chat`, {
719
+ method: "POST",
720
+ headers: this.apiHeaders,
721
+ body: JSON.stringify({ systemPrompt, userPrompt, temperature, maxTokens }),
722
+ });
723
+ if (!res.ok) {
724
+ throw await res.json();
725
+ }
726
+ return await res.json();
727
+ }
714
728
  /**
715
729
  * Use AI to apply prompt to an image
716
730
  */
@@ -202,6 +202,12 @@ declare class KokimokiClient<ClientContextT = any> extends KokimokiClient_base {
202
202
  sendWebhook<T>(event: string, data: T): Promise<{
203
203
  jobId: string;
204
204
  }>;
205
+ /**
206
+ * Generic AI chat endpoint: send a system prompt (and optional user prompt) to get a response.
207
+ */
208
+ chat(systemPrompt: string, userPrompt?: string, temperature?: number, maxTokens?: number): Promise<{
209
+ content: string;
210
+ }>;
205
211
  /**
206
212
  * Use AI to apply prompt to an image
207
213
  */