Merge pull request #21 from mohitagw15856/add-skill-playground-web-ui
fix(web): propagate mid-stream API errors and raise max_tokens
This commit is contained in:
2 files changed
+8
-5
No files matched your search
+7
-4
@@ -170,7 +170,7 @@ async function run() {
|
|||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
model: el('model').value,
|
model: el('model').value,
|
||||||
max_tokens: 4096,
|
max_tokens: 8192,
|
||||||
stream: true,
|
stream: true,
|
||||||
system,
|
system,
|
||||||
messages: [{ role: 'user', content: userMessage }],
|
messages: [{ role: 'user', content: userMessage }],
|
||||||
@@ -193,15 +193,18 @@ async function run() {
|
|||||||
if (!line.startsWith('data:')) continue;
|
if (!line.startsWith('data:')) continue;
|
||||||
const payload = line.slice(5).trim();
|
const payload = line.slice(5).trim();
|
||||||
if (!payload || payload === '[DONE]') continue;
|
if (!payload || payload === '[DONE]') continue;
|
||||||
|
let evt;
|
||||||
try {
|
try {
|
||||||
const evt = JSON.parse(payload);
|
evt = JSON.parse(payload);
|
||||||
|
} catch (_) {
|
||||||
|
continue; // skip an unparseable / partial SSE line
|
||||||
|
}
|
||||||
if (evt.type === 'content_block_delta' && evt.delta && evt.delta.text) {
|
if (evt.type === 'content_block_delta' && evt.delta && evt.delta.text) {
|
||||||
acc += evt.delta.text;
|
acc += evt.delta.text;
|
||||||
renderMarkdown(out, acc, true);
|
renderMarkdown(out, acc, true);
|
||||||
} else if (evt.type === 'error') {
|
} else if (evt.type === 'error') {
|
||||||
throw new Error(evt.error ? evt.error.message : 'stream error');
|
throw new Error(evt.error ? evt.error.message : 'Stream error from the API.');
|
||||||
}
|
}
|
||||||
} catch (_) { /* ignore partial */ }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
renderMarkdown(out, acc, false);
|
renderMarkdown(out, acc, false);
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
{"generatedAt":"2026-06-09T10:46:59.252Z","count":172,"skills":[{"name":"360-feedback-template","title":"360-Degree Feedback Template","description":"Design a 360-degree feedback survey or write a structured 360 feedback report. Use when asked to build a 360 feedback process, write 360 feedback for a colleague, design a feedback survey, or produce a feedback report. Produces either a complete survey instrument with rating scales and open-ended questions, or a structured narrative feedback report with themes, strengths, and development areas.","summary":"Design a 360-degree feedback survey or write a structured 360 feedback report.","plugin":"pm-people","inputs":[{"label":"Role being reviewed","hint":"job title and level","optional":false,"long":false},{"label":"Competencies to assess","hint":"or use defaults below","optional":false,"long":false},{"label":"Reviewer relationships","hint":"peer / direct report / manager / cross-functional","optional":false,"long":false},{"label":"Rating scale preference","hint":"1–5 / 1–4 / frequency-based","optional":false,"long":false},{"label":"Anonymity level","hint":"fully anonymous / attributed / confidential aggregated","optional":false,"long":false},{"label":"Person being reviewed","hint":"role and level","optional":false,"long":false},{"label":"Feedback notes or raw themes","hint":"from reviewers (paste what you have)","optional":false,"long":true},{"label":"Reviewer relationships","hint":"how many peers, direct reports, managers responded","optional":false,"long":false},{"label":"Any context","hint":"performance cycle, specific behaviours to address, promotion consideration","optional":false,"long":true}],"instructions":"# 360-Degree Feedback Template Skill\n\nThis skill produces two outputs depending on what the user needs: (1) a complete 360 survey instrument for gathering feedback, or (2) a structured 360 feedback report written from gathered notes. Both outputs follow best practice: behaviourally anchored ratings, specific examples, and development-oriented framing.\n\n## Required Inputs\n\nAsk the user which output they need, then gather inputs:\n\n**For a survey instrument:**\n- **Role being reviewed** (job title and level)\n- **Competencies to assess** (or use defaults below)\n- **Reviewer relationships** (peer / direct report / manager / cross-functional)\n- **Rating scale preference** (1–5 / 1–4 / frequency-based)\n- **Anonymity level** (fully anonymous / attributed / confidential aggregated)\n\n**For a feedback report:**\n- **Person being reviewed** (role and level)\n- **Feedback notes or raw themes** from reviewers (paste what you have)\n- **Reviewer relationships** (how many peers, direct reports, managers responded)\n- **Any context** — performance cycle, specific behaviours to address, promotion consideration\n\n---\n\n## Output A: 360 Survey Instrument\n\n---\n\n# 360 Feedback Survey: [Role / Level]\n\n**Purpose:** This survey helps [Name / \"the reviewee\"] understand how their behaviours and impact are perceived by the people they work with most closely. Responses [are / are not] anonymous. Results will be shared as [individual responses / aggregated themes].\n\n**Instructions:** For each statement, rate how frequently you observe this behaviour. Add specific examples in the open-ended sections — these are the most valuable part of the survey.\n\n**Rating scale:**\n- **5 — Consistently:** Almost always demonstrates this behaviour, even in difficult situations\n- **4 — Usually:** Demonstrates this behaviour more often than not\n- **3 — Sometimes:** Demonstrates this behaviour inconsistently\n- **2 — Rarely:** Seldom demonstrates this behaviour\n- **1 — Not observed:** Have not had the opportunity to observe this behaviour\n\n---\n\n### Section 1: Delivery & Execution\n\n| Statement | Rating (1–5) |\n|---|---|\n| Delivers work on time and to the expected quality | |\n| Proactively flags risks and blockers before they become problems | |\n| Follows through on commitments without needing to be chased | |\n| Manages their workload effectively without compromising quality | |\n| Adapts quickly when priorities or requirements change | |\n\n**Open question:** Describe a specific time when [Name] handled a delivery challenge particularly well or poorly.\n\n---\n\n### Section 2: Communication & Collaboration\n\n| Statement | Rating (1–5) |\n|---|---|\n| Communicates clearly and concisely in both written and verbal formats | |\n| Listens actively and considers others' input before responding | |\n| Keeps the right people informed without over-communicating | |\n| Resolves disagreements constructively and without defensiveness | |\n| Makes it easy for others to collaborate with them | |\n\n**Open question:** Give an example of how [Name] handled a difficult or high-stakes communication.\n\n---\n\n### Section 3: Leadership & Influence\n\n| Statement | Rating (1–5) |\n|---|---|\n| Sets a clear direction that others can follow | |\n| BuLine truncated
|
{"generatedAt":"2026-06-09T11:06:53.874Z","count":172,"skills":[{"name":"360-feedback-template","title":"360-Degree Feedback Template","description":"Design a 360-degree feedback survey or write a structured 360 feedback report. Use when asked to build a 360 feedback process, write 360 feedback for a colleague, design a feedback survey, or produce a feedback report. Produces either a complete survey instrument with rating scales and open-ended questions, or a structured narrative feedback report with themes, strengths, and development areas.","summary":"Design a 360-degree feedback survey or write a structured 360 feedback report.","plugin":"pm-people","inputs":[{"label":"Role being reviewed","hint":"job title and level","optional":false,"long":false},{"label":"Competencies to assess","hint":"or use defaults below","optional":false,"long":false},{"label":"Reviewer relationships","hint":"peer / direct report / manager / cross-functional","optional":false,"long":false},{"label":"Rating scale preference","hint":"1–5 / 1–4 / frequency-based","optional":false,"long":false},{"label":"Anonymity level","hint":"fully anonymous / attributed / confidential aggregated","optional":false,"long":false},{"label":"Person being reviewed","hint":"role and level","optional":false,"long":false},{"label":"Feedback notes or raw themes","hint":"from reviewers (paste what you have)","optional":false,"long":true},{"label":"Reviewer relationships","hint":"how many peers, direct reports, managers responded","optional":false,"long":false},{"label":"Any context","hint":"performance cycle, specific behaviours to address, promotion consideration","optional":false,"long":true}],"instructions":"# 360-Degree Feedback Template Skill\n\nThis skill produces two outputs depending on what the user needs: (1) a complete 360 survey instrument for gathering feedback, or (2) a structured 360 feedback report written from gathered notes. Both outputs follow best practice: behaviourally anchored ratings, specific examples, and development-oriented framing.\n\n## Required Inputs\n\nAsk the user which output they need, then gather inputs:\n\n**For a survey instrument:**\n- **Role being reviewed** (job title and level)\n- **Competencies to assess** (or use defaults below)\n- **Reviewer relationships** (peer / direct report / manager / cross-functional)\n- **Rating scale preference** (1–5 / 1–4 / frequency-based)\n- **Anonymity level** (fully anonymous / attributed / confidential aggregated)\n\n**For a feedback report:**\n- **Person being reviewed** (role and level)\n- **Feedback notes or raw themes** from reviewers (paste what you have)\n- **Reviewer relationships** (how many peers, direct reports, managers responded)\n- **Any context** — performance cycle, specific behaviours to address, promotion consideration\n\n---\n\n## Output A: 360 Survey Instrument\n\n---\n\n# 360 Feedback Survey: [Role / Level]\n\n**Purpose:** This survey helps [Name / \"the reviewee\"] understand how their behaviours and impact are perceived by the people they work with most closely. Responses [are / are not] anonymous. Results will be shared as [individual responses / aggregated themes].\n\n**Instructions:** For each statement, rate how frequently you observe this behaviour. Add specific examples in the open-ended sections — these are the most valuable part of the survey.\n\n**Rating scale:**\n- **5 — Consistently:** Almost always demonstrates this behaviour, even in difficult situations\n- **4 — Usually:** Demonstrates this behaviour more often than not\n- **3 — Sometimes:** Demonstrates this behaviour inconsistently\n- **2 — Rarely:** Seldom demonstrates this behaviour\n- **1 — Not observed:** Have not had the opportunity to observe this behaviour\n\n---\n\n### Section 1: Delivery & Execution\n\n| Statement | Rating (1–5) |\n|---|---|\n| Delivers work on time and to the expected quality | |\n| Proactively flags risks and blockers before they become problems | |\n| Follows through on commitments without needing to be chased | |\n| Manages their workload effectively without compromising quality | |\n| Adapts quickly when priorities or requirements change | |\n\n**Open question:** Describe a specific time when [Name] handled a delivery challenge particularly well or poorly.\n\n---\n\n### Section 2: Communication & Collaboration\n\n| Statement | Rating (1–5) |\n|---|---|\n| Communicates clearly and concisely in both written and verbal formats | |\n| Listens actively and considers others' input before responding | |\n| Keeps the right people informed without over-communicating | |\n| Resolves disagreements constructively and without defensiveness | |\n| Makes it easy for others to collaborate with them | |\n\n**Open question:** Give an example of how [Name] handled a difficult or high-stakes communication.\n\n---\n\n### Section 3: Leadership & Influence\n\n| Statement | Rating (1–5) |\n|---|---|\n| Sets a clear direction that others can follow | |\n| BuLine truncated
|
||||||
Reference in new issue
Block a user