@codenotch/process 0.1.4 → 0.1.5
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.
|
@@ -234,9 +234,31 @@ export interface PaymentHandle {
|
|
|
234
234
|
*/
|
|
235
235
|
chargeSavedMethod(request: ChargeRequest, opts?: ActivityOptions): Promise<ChargeResult>;
|
|
236
236
|
}
|
|
237
|
+
/**
|
|
238
|
+
* A file the model reads: by reference ({ renderingId } — a ctx.render.pdf result works
|
|
239
|
+
* as-is), the server resolves the bytes at call time and they never travel through the
|
|
240
|
+
* process; inline bytes ride the journal base64-encoded — keep them small, big documents
|
|
241
|
+
* belong in renderings. Accepted media types: image/* and application/pdf, each gated on
|
|
242
|
+
* the bound provider's input capabilities.
|
|
243
|
+
*/
|
|
244
|
+
export type LlmFile = {
|
|
245
|
+
renderingId: string;
|
|
246
|
+
} | {
|
|
247
|
+
mediaType: string;
|
|
248
|
+
bytes: Uint8Array;
|
|
249
|
+
fileName?: string;
|
|
250
|
+
};
|
|
251
|
+
/** One piece of a message: text, or a file the model reads alongside it. */
|
|
252
|
+
export type LlmContentPart = {
|
|
253
|
+
type: 'text';
|
|
254
|
+
text: string;
|
|
255
|
+
} | ({
|
|
256
|
+
type: 'file';
|
|
257
|
+
} & LlmFile);
|
|
237
258
|
export interface LlmMessage {
|
|
238
259
|
role: 'user' | 'assistant';
|
|
239
|
-
|
|
260
|
+
/** Plain text, or an ordered part array. File parts belong in user messages. */
|
|
261
|
+
content: string | LlmContentPart[];
|
|
240
262
|
}
|
|
241
263
|
export interface LlmUsage {
|
|
242
264
|
inputTokens: number;
|
|
@@ -246,6 +268,11 @@ export type LlmStopReason = 'end' | 'maxTokens' | 'refusal';
|
|
|
246
268
|
export interface LlmRequest {
|
|
247
269
|
/** One user message — the simple form. Exactly one of prompt and messages. */
|
|
248
270
|
prompt?: string;
|
|
271
|
+
/**
|
|
272
|
+
* Files the model reads with the prompt (they precede it) — prompt-form only; the
|
|
273
|
+
* messages form places files as content parts.
|
|
274
|
+
*/
|
|
275
|
+
files?: LlmFile[];
|
|
249
276
|
/** The full conversation, for multi-turn flows the process assembles itself. */
|
|
250
277
|
messages?: LlmMessage[];
|
|
251
278
|
system?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codenotch/process",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "Types and standard library for Codenotch script processes. Processes execute on the server only: the engine embeds the compiled runtime (dist/prelude.js); this package distributes the type declarations.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|