llmz 0.3.1 → 0.5.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.
@@ -1,8 +1,40 @@
1
1
  export declare namespace Transcript {
2
+ /**
3
+ * A file attached to a transcript message.
4
+ *
5
+ * - `image`: a picture the model can see.
6
+ * - `audio`: a voice message — spoken audio of what the user said. Messages
7
+ * carrying an audio attachment are presented to the model as spoken turns
8
+ * (tagged `modality="voice"` in the prompt) and the audio is sent as model
9
+ * input: audio-capable models hear it directly, others receive a
10
+ * transcription (see `@botpress/cognitive`'s `transcriptionModel` option).
11
+ *
12
+ * `url` supports http(s) URLs and base64 `data:` URIs.
13
+ *
14
+ * `id` is an optional stable identifier for referencing the attachment from
15
+ * the message content (e.g. `screenshot-A` in a screen-share event log). It
16
+ * is used as the attachment's reference in the prompt; without it, a
17
+ * positional letter (A, B, C...) is auto-assigned.
18
+ *
19
+ * `alt` is an optional human-readable description shown to the model next to
20
+ * the attachment (e.g. "Screenshot of the checkout error page").
21
+ */
2
22
  type Attachment = {
3
- type: 'image';
23
+ type: 'image' | 'audio';
4
24
  url: string;
25
+ id?: string;
26
+ alt?: string;
5
27
  };
28
+ /**
29
+ * How the user delivered a message. Defaults to `'text'`.
30
+ *
31
+ * Set to `'voice'` when the user spoke the message out loud. Use it when the
32
+ * speech was already transcribed upstream and no audio is attached — the
33
+ * message `content` is then treated as a transcript of what the user said.
34
+ * Messages with an `audio` attachment are always treated as voice; setting
35
+ * this field is not required for them.
36
+ */
37
+ type Modality = 'text' | 'voice';
6
38
  type AssistantMessage = {
7
39
  role: 'assistant';
8
40
  name?: string;
@@ -14,6 +46,8 @@ export declare namespace Transcript {
14
46
  createdAt?: string;
15
47
  name?: string;
16
48
  content: string;
49
+ /** How the user delivered this message. Defaults to 'text'. See {@link Modality}. */
50
+ modality?: Modality;
17
51
  attachments?: Array<Attachment>;
18
52
  };
19
53
  type EventMessage = {
@@ -30,6 +64,8 @@ export declare namespace Transcript {
30
64
  };
31
65
  type Message = AssistantMessage | UserMessage | EventMessage | SummaryMessage;
32
66
  }
67
+ /** Whether the message is a spoken turn: explicit voice modality or an audio attachment. */
68
+ export declare function isVoiceMessage(message: Transcript.Message): boolean;
33
69
  export declare class TranscriptArray extends Array<Transcript.Message> {
34
70
  constructor(items?: Transcript.Message[]);
35
71
  toString(): string;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "llmz",
3
3
  "type": "module",
4
4
  "description": "LLMz - An LLM-native Typescript VM built on top of Zui",
5
- "version": "0.3.1",
5
+ "version": "0.5.0",
6
6
  "files": [
7
7
  "dist",
8
8
  "DOCS.md"
@@ -69,7 +69,7 @@
69
69
  },
70
70
  "peerDependencies": {
71
71
  "@botpress/client": "2.0.0",
72
- "@botpress/cognitive": "1.0.1",
72
+ "@botpress/cognitive": "1.0.2",
73
73
  "@bpinternal/thicktoken": "^3.1.0",
74
74
  "@bpinternal/zui": "^2.4.0"
75
75
  },