llmz 0.8.0 → 0.9.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/README.md +45 -11
- package/dist/chat.d.ts +6 -6
- package/dist/{common-pgJjFu2Y.js → common-BlRFtdf2.js} +233 -22
- package/dist/{common-DdArNQhl.cjs → common-BnvrDnIT.cjs} +238 -21
- package/dist/{component-BXS8vAwO.cjs → component-C6Agl2ns.cjs} +1 -1
- package/dist/{component-Dq7ZLdvy.js → component-DGG7d_Mz.js} +1 -1
- package/dist/component.default.d.ts +10 -0
- package/dist/context.d.ts +4 -8
- package/dist/{custom-client-2V9lmzUf.js → custom-client-ChuZ63zp.js} +15 -12
- package/dist/{custom-client-HkM1Sdzv.cjs → custom-client-DAsGRnYc.cjs} +18 -15
- package/dist/{dual-modes-Cy0_W4O2.js → dual-modes-DDkoCp3R.js} +1246 -1170
- package/dist/{dual-modes-Cb7ThvoV.cjs → dual-modes-DPXiuvNe.cjs} +1239 -1169
- package/dist/example-format.d.ts +8 -0
- package/dist/{execute-Aw4cbIx-.js → execute-BWcdv9so.js} +64 -85
- package/dist/{execute-COIHOIKR.cjs → execute-DM2-7y86.cjs} +64 -85
- package/dist/index.cjs +254 -11
- package/dist/index.js +253 -10
- package/dist/index.workerd.js +8646 -8108
- package/dist/inspect.d.ts +2 -0
- package/dist/isPlainObject-CSxXVKCk.cjs +56 -0
- package/dist/isPlainObject-D39AzPO2.js +51 -0
- package/dist/{jsx-B0iYyvfr.js → jsx-CIgdGGVs.js} +2 -50
- package/dist/{jsx-D5Y2cPo-.cjs → jsx-owqxrquU.cjs} +2 -56
- package/dist/message-stream/instructions.d.ts +8 -0
- package/dist/message-stream/parser.d.ts +6 -0
- package/dist/message-stream/response-parser.d.ts +24 -0
- package/dist/message-stream/response-parser.test.d.ts +1 -0
- package/dist/message-stream/types.d.ts +3 -2
- package/dist/prompts/adherence.test.d.ts +1 -0
- package/dist/prompts/catalogue-examples.test.d.ts +1 -0
- package/dist/prompts/chat-mode/protocol.d.ts +2 -0
- package/dist/prompts/chat-mode/system.d.ts +1 -1
- package/dist/prompts/chat-mode/user.d.ts +1 -1
- package/dist/prompts/code-examples.d.ts +2 -0
- package/dist/prompts/code-examples.test.d.ts +1 -0
- package/dist/prompts/common.d.ts +2 -1
- package/dist/prompts/concrete-patterns.test.d.ts +1 -0
- package/dist/prompts/long-search.test.d.ts +1 -0
- package/dist/prompts/prompt.d.ts +5 -2
- package/dist/prompts/protocol-basics.d.ts +5 -0
- package/dist/prompts/protocol-simple.test.d.ts +1 -0
- package/dist/prompts/protocol.d.ts +13 -0
- package/dist/prompts/sections.test.d.ts +1 -0
- package/dist/prompts/worker-mode/protocol.d.ts +2 -0
- package/dist/prompts/worker-mode/system.d.ts +1 -1
- package/dist/prompts/worker-mode/user.d.ts +1 -1
- package/dist/runtime/citations.test.d.ts +1 -0
- package/dist/runtime/fixtures/long-search.d.ts +19 -0
- package/dist/runtime/fixtures/protocol-languages.d.ts +74 -0
- package/dist/runtime/fixtures/qwen-protocol-failures.d.ts +29 -0
- package/dist/runtime/generate.d.ts +2 -9
- package/dist/runtime/protocol-adherence.test.d.ts +1 -0
- package/dist/runtime/types.d.ts +4 -7
- package/package.json +1 -1
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/** Synthetic multilingual inputs shared by parser/execution and live model tests. */
|
|
2
|
+
export declare const protocolLanguages: readonly [{
|
|
3
|
+
readonly language: 'English';
|
|
4
|
+
readonly hello: 'Hello!';
|
|
5
|
+
readonly question: 'Help me choose a plan.';
|
|
6
|
+
readonly reply: 'How many conversations do you expect per month?';
|
|
7
|
+
readonly checking: 'Checking.';
|
|
8
|
+
}, {
|
|
9
|
+
readonly language: 'French';
|
|
10
|
+
readonly hello: 'Bonjour !';
|
|
11
|
+
readonly question: 'Aidez-moi à choisir un forfait.';
|
|
12
|
+
readonly reply: 'Combien de conversations prévoyez-vous par mois ?';
|
|
13
|
+
readonly checking: 'Je vérifie.';
|
|
14
|
+
}, {
|
|
15
|
+
readonly language: 'Spanish';
|
|
16
|
+
readonly hello: '¡Hola!';
|
|
17
|
+
readonly question: 'Ayúdame a elegir un plan.';
|
|
18
|
+
readonly reply: '¿Cuántas conversaciones esperas al mes?';
|
|
19
|
+
readonly checking: 'Estoy comprobando.';
|
|
20
|
+
}, {
|
|
21
|
+
readonly language: 'German';
|
|
22
|
+
readonly hello: 'Hallo!';
|
|
23
|
+
readonly question: 'Hilf mir, einen Tarif auszuwählen.';
|
|
24
|
+
readonly reply: 'Wie viele Gespräche erwartest du pro Monat?';
|
|
25
|
+
readonly checking: 'Ich prüfe das.';
|
|
26
|
+
}, {
|
|
27
|
+
readonly language: 'Portuguese';
|
|
28
|
+
readonly hello: 'Olá!';
|
|
29
|
+
readonly question: 'Ajude-me a escolher um plano.';
|
|
30
|
+
readonly reply: 'Quantas conversas você espera por mês?';
|
|
31
|
+
readonly checking: 'Estou verificando.';
|
|
32
|
+
}, {
|
|
33
|
+
readonly language: 'Italian';
|
|
34
|
+
readonly hello: 'Ciao!';
|
|
35
|
+
readonly question: 'Aiutami a scegliere un piano.';
|
|
36
|
+
readonly reply: 'Quante conversazioni prevedi al mese?';
|
|
37
|
+
readonly checking: 'Sto controllando.';
|
|
38
|
+
}, {
|
|
39
|
+
readonly language: 'Arabic';
|
|
40
|
+
readonly hello: 'مرحباً!';
|
|
41
|
+
readonly question: 'ساعدني في اختيار خطة.';
|
|
42
|
+
readonly reply: 'كم محادثة تتوقع في الشهر؟';
|
|
43
|
+
readonly checking: 'أتحقق الآن.';
|
|
44
|
+
}, {
|
|
45
|
+
readonly language: 'Chinese';
|
|
46
|
+
readonly hello: '你好!';
|
|
47
|
+
readonly question: '帮我选择一个套餐。';
|
|
48
|
+
readonly reply: '你预计每月有多少次对话?';
|
|
49
|
+
readonly checking: '正在查询。';
|
|
50
|
+
}, {
|
|
51
|
+
readonly language: 'Japanese';
|
|
52
|
+
readonly hello: 'こんにちは!';
|
|
53
|
+
readonly question: 'プラン選びを手伝ってください。';
|
|
54
|
+
readonly reply: '月に何件の会話を想定していますか?';
|
|
55
|
+
readonly checking: '確認しています。';
|
|
56
|
+
}, {
|
|
57
|
+
readonly language: 'Korean';
|
|
58
|
+
readonly hello: '안녕하세요!';
|
|
59
|
+
readonly question: '요금제 선택을 도와주세요.';
|
|
60
|
+
readonly reply: '월별 대화 수는 얼마나 예상하시나요?';
|
|
61
|
+
readonly checking: '확인 중입니다.';
|
|
62
|
+
}, {
|
|
63
|
+
readonly language: 'Hindi';
|
|
64
|
+
readonly hello: 'नमस्ते!';
|
|
65
|
+
readonly question: 'एक योजना चुनने में मेरी मदद करें।';
|
|
66
|
+
readonly reply: 'आपको हर महीने कितनी बातचीत की उम्मीद है?';
|
|
67
|
+
readonly checking: 'मैं जाँच कर रहा हूँ।';
|
|
68
|
+
}, {
|
|
69
|
+
readonly language: 'Russian';
|
|
70
|
+
readonly hello: 'Здравствуйте!';
|
|
71
|
+
readonly question: 'Помогите мне выбрать тариф.';
|
|
72
|
+
readonly reply: 'Сколько разговоров вы ожидаете в месяц?';
|
|
73
|
+
readonly checking: 'Проверяю.';
|
|
74
|
+
}];
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export declare const qwenProtocolFailures: readonly [{
|
|
2
|
+
readonly name: 'unmarked-estimation-answer';
|
|
3
|
+
readonly output: 'To estimate monthly conversations, look at your recent conversation totals rather than counting individual messages or visits. Check how many complete conversations your team handled in the last month (or average across a few months) and use that number as your expected monthly volume.\n■next=listen\n';
|
|
4
|
+
readonly reply: 'Please tell me your expected monthly conversation volume.';
|
|
5
|
+
}, {
|
|
6
|
+
readonly name: 'thinking-close-before-message';
|
|
7
|
+
readonly output: 'The user wants help choosing a plan. According to the instructions, when asked to choose a plan, I should first ask for expected monthly conversations. I need to ask one question at a time and never recommend a plan before knowing that volume.\n</think>\n\n■send=message\nSure! To point you to the right plan, how many conversations do you expect to handle each month?\n■next=listen';
|
|
8
|
+
readonly reply: 'Sure! To point you to the right plan, how many conversations do you expect to handle each month?';
|
|
9
|
+
}, {
|
|
10
|
+
readonly name: 'wrong-bullet-instead-of-send';
|
|
11
|
+
readonly output: '● Hello! It looks like you just sent a greeting. How can I help you today? I can assist with choosing a plan or answering questions about Cedar Desk.\n■next=listen';
|
|
12
|
+
readonly reply: 'Please tell me your expected monthly conversation volume.';
|
|
13
|
+
}, {
|
|
14
|
+
readonly name: 'xml-tool-call-instead-of-protocol';
|
|
15
|
+
readonly output: '<tool_call>\n<function=■send=message>\nI can help with that. To start, how many conversations do you expect to have each month?\n</function>\n</tool_call>';
|
|
16
|
+
readonly reply: 'Please tell me your expected monthly conversation volume.';
|
|
17
|
+
}, {
|
|
18
|
+
readonly name: 'repeated-messages-after-listen';
|
|
19
|
+
readonly output: "A conversation is a back-and-forth between a visitor and your team, not a single message or page visit. To estimate monthly conversations, look at your recent conversation totals (for example, last month's total) and use that as your baseline, adjusting if your traffic is trending up or down.\n■next=listen\n■send=message\nA conversation is a back-and-forth between a visitor and your team, not a single message or page visit. To estimate monthly conversations, look at your recent conversation totals (for example, last month's total) and use that as your baseline, adjusting if your traffic is trending up or down.\n■next=listen\n■next=listen\n■send=message\nA conversation is a back-and-forth between a visitor and your team, not a single message or page visit. To estimate monthly conversations, look at your recent conversation totals (for example, last month's total) and use that as your baseline, adjusting if your traffic is trending up or down.\n■next=listen\n■next=listen\n■send=message\nA conversation is a back-and-forth between a visitor and your team, not a single message or page visit. To estimate monthly conversations, look at your recent conversation totals (for example, last month's total) and use that as your baseline, adjusting if your traffic is trending up or down.\n■next=listen\n■next=listen";
|
|
20
|
+
readonly reply: 'Please tell me your expected monthly conversation volume.';
|
|
21
|
+
}, {
|
|
22
|
+
readonly name: 'premature-listen-before-thinking-close';
|
|
23
|
+
readonly output: 'I need to understand your expected monthly conversations before I can recommend a plan.\n\nHow many conversations do you expect to handle each month?\n■next=listen\n</think>\n\n■send=message\nI can help with that. To get started, how many conversations do you expect to handle each month?\n■next=listen';
|
|
24
|
+
readonly reply: 'Please tell me your expected monthly conversation volume.';
|
|
25
|
+
}, {
|
|
26
|
+
readonly name: 'draft-answer-before-explicit-send';
|
|
27
|
+
readonly output: 'The user wants help choosing a plan. According to the instructions, I should first ask for expected monthly conversations. Messages, visits, and conversations are different units.\nI should ask one question at a time.\n\n"Great! To point you to the right plan, could you tell me how many conversations you expect to have each month? (Just a rough estimate is fine.)"\n\nThen wait for the user.\n\n■send=message\nGreat! To point you to the right plan, could you tell me roughly how many conversations you expect to have each month?\n■next=listen';
|
|
28
|
+
readonly reply: 'Great! To point you to the right plan, could you tell me roughly how many conversations you expect to have each month?';
|
|
29
|
+
}];
|
|
@@ -9,8 +9,7 @@ type GenerateCodeProps = {
|
|
|
9
9
|
controller: AbortController;
|
|
10
10
|
metadata?: Record<string, string>;
|
|
11
11
|
/**
|
|
12
|
-
* Called for each
|
|
13
|
-
* while the model is still generating — messages are delivered progressively.
|
|
12
|
+
* Called for each send after a complete, valid response and successful transport.
|
|
14
13
|
*/
|
|
15
14
|
onSend?: (send: ParsedSend, metadata: MessageMetadata) => Promise<void>;
|
|
16
15
|
/**
|
|
@@ -24,12 +23,6 @@ type GenerateCodeProps = {
|
|
|
24
23
|
* being generated (streaming clients only). Used to pre-warm the VM.
|
|
25
24
|
*/
|
|
26
25
|
onRunStart?: () => void;
|
|
27
|
-
/**
|
|
28
|
-
* Called with the code of the first `■run` block the moment it is fully
|
|
29
|
-
* parsed — the rest of the response (e.g. `■next`) may still be streaming
|
|
30
|
-
* (streaming clients only). Used to start executing the code early.
|
|
31
|
-
*/
|
|
32
|
-
onRunComplete?: (code: string) => void;
|
|
33
26
|
};
|
|
34
|
-
export declare const generateCode: ({ iteration, ctx, cognitive, controller, metadata, onSend, onSendDelta, onRunStart,
|
|
27
|
+
export declare const generateCode: ({ iteration, ctx, cognitive, controller, metadata, onSend, onSendDelta, onRunStart, }: GenerateCodeProps) => Promise<void>;
|
|
35
28
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/runtime/types.d.ts
CHANGED
|
@@ -124,13 +124,10 @@ type Options = Partial<Pick<Context, 'loop' | 'timeout'>> & {
|
|
|
124
124
|
*/
|
|
125
125
|
maxTimeToFirstToken?: number;
|
|
126
126
|
/**
|
|
127
|
-
* Allow Cognitive to restart failed
|
|
128
|
-
*
|
|
129
|
-
* sends
|
|
130
|
-
*
|
|
131
|
-
* including completed sends — consumers must retract/replace them (not safe for
|
|
132
|
-
* irreversible transports). Only TOOL/CODE execution waits for a successful
|
|
133
|
-
* stream. Streaming-only; defaults to false, preserving progressive sending.
|
|
127
|
+
* Allow Cognitive to restart a failed stream on another model. Previews remain
|
|
128
|
+
* live and are retracted with a restart delta before replacement output.
|
|
129
|
+
* Completed sends and code always wait for a valid response and successful
|
|
130
|
+
* transport. Streaming-only; defaults to false.
|
|
134
131
|
*/
|
|
135
132
|
midStreamFallback?: boolean;
|
|
136
133
|
/**
|