@kokimoki/app 1.14.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.
- package/dist/kokimoki-client.d.ts +6 -0
- package/dist/kokimoki-client.js +14 -0
- package/dist/kokimoki.min.d.ts +6 -0
- package/dist/kokimoki.min.js +15 -1
- package/dist/kokimoki.min.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -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
|
*/
|
package/dist/kokimoki-client.js
CHANGED
|
@@ -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
|
*/
|
package/dist/kokimoki.min.d.ts
CHANGED
|
@@ -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
|
*/
|
package/dist/kokimoki.min.js
CHANGED
|
@@ -486,7 +486,7 @@ function eventTargetAgnosticAddListener(emitter, name, listener, flags) {
|
|
|
486
486
|
var eventsExports = events.exports;
|
|
487
487
|
var EventEmitter$1 = /*@__PURE__*/getDefaultExportFromCjs(eventsExports);
|
|
488
488
|
|
|
489
|
-
const KOKIMOKI_APP_VERSION = "1.
|
|
489
|
+
const KOKIMOKI_APP_VERSION = "1.15.0";
|
|
490
490
|
|
|
491
491
|
/**
|
|
492
492
|
* Utility module to work with key-value stores.
|
|
@@ -15458,6 +15458,20 @@ class KokimokiClient extends EventEmitter$1 {
|
|
|
15458
15458
|
});
|
|
15459
15459
|
return await res.json();
|
|
15460
15460
|
}
|
|
15461
|
+
/**
|
|
15462
|
+
* Generic AI chat endpoint: send a system prompt (and optional user prompt) to get a response.
|
|
15463
|
+
*/
|
|
15464
|
+
async chat(systemPrompt, userPrompt, temperature, maxTokens) {
|
|
15465
|
+
const res = await fetch(`${this._apiUrl}/ai/chat`, {
|
|
15466
|
+
method: "POST",
|
|
15467
|
+
headers: this.apiHeaders,
|
|
15468
|
+
body: JSON.stringify({ systemPrompt, userPrompt, temperature, maxTokens }),
|
|
15469
|
+
});
|
|
15470
|
+
if (!res.ok) {
|
|
15471
|
+
throw await res.json();
|
|
15472
|
+
}
|
|
15473
|
+
return await res.json();
|
|
15474
|
+
}
|
|
15461
15475
|
/**
|
|
15462
15476
|
* Use AI to apply prompt to an image
|
|
15463
15477
|
*/
|