openvibers/openvibe.ai Commits
AI: the chat overview is two sentences for someone arriving now (#435)
Changes
@@@ -157,7 +157,7 @@ const templates = [input_schema: { type: 'object' },output_schema: {"type": "object", "additionalProperties": false, "required": ["recent_overview", "memory", "timeline"], "properties": {"recent_overview": {"type": "string"}, "memory": {"type": "string"}, "timeline": {"type": "array", "items": {"type": "object", "additionalProperties": false, "required": ["label", "detail", "mins_ago"], "properties": {"label": {"type": "string"}, "detail": {"type": "string"}, "mins_ago": {"type": "integer"}}}}}},system_prompt: "",-- user_prompt: "You are the community analyst for a live-streaming site's chat. Analyze the RECENT chat below (covers roughly the {{window_label}}, across the global room and individual streamer channels) and update a rolling picture of the community.\n\nReturn ONLY a JSON object, no prose, with exactly these keys:\n{\n \"recent_overview\": \"2-4 sentences on what the chat is about right now: main topics, mood/energy, who's active, any notable events. Concrete, no fluff.\",\n \"memory\": \"Condensed running notes about this community carried forward: recurring topics, regulars, running jokes, ongoing events/dramas. Update the PRIOR notes with anything new; keep it under ~1400 chars.\",\n \"timeline\": [ {\"label\":\"short title\",\"detail\":\"one sentence\",\"mins_ago\": <integer: minutes before now this happened, read from the [Xm ago] markers on the messages>} ] // 0-3 genuinely NOTABLE moments from THIS window (raids, milestones, big drama, memorable bits). Use [] if nothing stands out — do not invent.\n}\n\nPRIOR running notes (may be empty):\n\"\"\"{{prior_memory}}\"\"\"\n\nRecent timeline entries already recorded (avoid duplicating these):\n{{recent_labels}}\n\nRECENT CHAT ({{count}} messages, oldest first):\n{{messages}}",++ user_prompt: "You write the line a person reads when they arrive in this chat room (roughly the {{window_label}}). Work only from the RECENT chat below: never invent a topic, a person or an event. A room with nothing worth saying is quiet, and you say so by leaving the overview empty.\n\nReturn ONLY a JSON object, no prose, with exactly these keys:\n{\n \"recent_overview\": \"TWO sentences, plain prose, no label or preamble: what the room is talking about right now, who is here, and anything that was decided or asked. Concrete and specific, in the room's own words. If there is nothing worth saying, leave it empty — the room is quiet; never invent a topic, a person or an event.\",\n \"memory\": \"Condensed running notes about this community carried forward: recurring topics, regulars, running jokes, ongoing events/dramas. Update the PRIOR notes with anything new; keep it under ~1400 chars.\",\n \"timeline\": [ {\"label\":\"short title\",\"detail\":\"one sentence\",\"mins_ago\": <integer: minutes before now this happened, read from the [Xm ago] markers on the messages>} ] // 0-3 genuinely NOTABLE moments from THIS window (raids, milestones, big drama, memorable bits). Use [] if nothing stands out — do not invent.\n}\n\nPRIOR running notes (may be empty):\n\"\"\"{{prior_memory}}\"\"\"\n\nRecent timeline entries already recorded (avoid duplicating these):\n{{recent_labels}}\n\nRECENT CHAT ({{count}} messages, oldest first):\n{{messages}}",default_route: 'live.legacy', owner: 'live', metadata: { json_name: 'chat_global' },},{@@@ -133,7 +133,9 @@ t.test('slogans, the daily secret and the star render as Live rendered them', ()t.test('chat analysis, person overviews, session titles and VOD ranking render as Live rendered them', () => {const tp = (k) => live.templates.find((x) => x.key === k).user_prompt;const g = render(tp('live.chat.global'), PREPARE['live.chat.global']({ window_label: 'past 3 hours', prior_memory: 'notes', recent_labels: ['a', 'b'], messages: [{ mins_ago: 12, where: 'global', author: 'goosely', text: ' hi ' }, { mins_ago: 3, where: '#ann', author: 'bob', kind: 'emote', text: 'waves' }] }).vars);-- assert.match(g, /covers roughly the past 3 hours, across/);++ assert.match(g, /roughly the past 3 hours\)\. Work only/);++ assert.match(g, /TWO sentences/);++ assert.match(g, /never invent a topic, a person or an event/);assert.match(g, /"""notes"""/);assert.match(g, /avoid duplicating these\):\n- a\n- b\n/);assert.match(g, /RECENT CHAT \(2 messages, oldest first\):\n\[12m ago\] \[global\] goosely: hi\n\[3m ago\] \[#ann\] bob: \(emote\) waves$/);
@@ -157,7 +157,7 @@ const templates = [
@@ -157,7 +157,7 @@ const templates = [
input_schema: { type: 'object' },
input_schema: { type: 'object' },
output_schema: {"type": "object", "additionalProperties": false, "required": ["recent_overview", "memory", "timeline"], "properties": {"recent_overview": {"type": "string"}, "memory": {"type": "string"}, "timeline": {"type": "array", "items": {"type": "object", "additionalProperties": false, "required": ["label", "detail", "mins_ago"], "properties": {"label": {"type": "string"}, "detail": {"type": "string"}, "mins_ago": {"type": "integer"}}}}}},
output_schema: {"type": "object", "additionalProperties": false, "required": ["recent_overview", "memory", "timeline"], "properties": {"recent_overview": {"type": "string"}, "memory": {"type": "string"}, "timeline": {"type": "array", "items": {"type": "object", "additionalProperties": false, "required": ["label", "detail", "mins_ago"], "properties": {"label": {"type": "string"}, "detail": {"type": "string"}, "mins_ago": {"type": "integer"}}}}}},
system_prompt: "",
system_prompt: "",
- user_prompt: "You are the community analyst for a live-streaming site's chat. Analyze the RECENT chat below (covers roughly the {{window_label}}, across the global room and individual streamer channels) and update a rolling picture of the community.\n\nReturn ONLY a JSON object, no prose, with exactly these keys:\n{\n \"recent_overview\": \"2-4 sentences on what the chat is about right now: main topics, mood/energy, who's active, any notable events. Concrete, no fluff.\",\n \"memory\": \"Condensed running notes about this community carried forward: recurring topics, regulars, running jokes, ongoing events/dramas. Update the PRIOR notes with anything new; keep it under ~1400 chars.\",\n \"timeline\": [ {\"label\":\"short title\",\"detail\":\"one sentence\",\"mins_ago\": <integer: minutes before now this happened, read from the [Xm ago] markers on the messages>} ] // 0-3 genuinely NOTABLE moments from THIS window (raids, milestones, big drama, memorable bits). Use [] if nothing stands out — do not invent.\n}\n\nPRIOR running notes (may be empty):\n\"\"\"{{prior_memory}}\"\"\"\n\nRecent timeline entries already recorded (avoid duplicating these):\n{{recent_labels}}\n\nRECENT CHAT ({{count}} messages, oldest first):\n{{messages}}",
+ user_prompt: "You write the line a person reads when they arrive in this chat room (roughly the {{window_label}}). Work only from the RECENT chat below: never invent a topic, a person or an event. A room with nothing worth saying is quiet, and you say so by leaving the overview empty.\n\nReturn ONLY a JSON object, no prose, with exactly these keys:\n{\n \"recent_overview\": \"TWO sentences, plain prose, no label or preamble: what the room is talking about right now, who is here, and anything that was decided or asked. Concrete and specific, in the room's own words. If there is nothing worth saying, leave it empty — the room is quiet; never invent a topic, a person or an event.\",\n \"memory\": \"Condensed running notes about this community carried forward: recurring topics, regulars, running jokes, ongoing events/dramas. Update the PRIOR notes with anything new; keep it under ~1400 chars.\",\n \"timeline\": [ {\"label\":\"short title\",\"detail\":\"one sentence\",\"mins_ago\": <integer: minutes before now this happened, read from the [Xm ago] markers on the messages>} ] // 0-3 genuinely NOTABLE moments from THIS window (raids, milestones, big drama, memorable bits). Use [] if nothing stands out — do not invent.\n}\n\nPRIOR running notes (may be empty):\n\"\"\"{{prior_memory}}\"\"\"\n\nRecent timeline entries already recorded (avoid duplicating these):\n{{recent_labels}}\n\nRECENT CHAT ({{count}} messages, oldest first):\n{{messages}}",
default_route: 'live.legacy', owner: 'live', metadata: { json_name: 'chat_global' },
default_route: 'live.legacy', owner: 'live', metadata: { json_name: 'chat_global' },
},
},
{
{
@@ -133,7 +133,9 @@ t.test('slogans, the daily secret and the star render as Live rendered them', ()
@@ -133,7 +133,9 @@ t.test('slogans, the daily secret and the star render as Live rendered them', ()
t.test('chat analysis, person overviews, session titles and VOD ranking render as Live rendered them', () => {
t.test('chat analysis, person overviews, session titles and VOD ranking render as Live rendered them', () => {
const tp = (k) => live.templates.find((x) => x.key === k).user_prompt;
const tp = (k) => live.templates.find((x) => x.key === k).user_prompt;
const g = render(tp('live.chat.global'), PREPARE['live.chat.global']({ window_label: 'past 3 hours', prior_memory: 'notes', recent_labels: ['a', 'b'], messages: [{ mins_ago: 12, where: 'global', author: 'goosely', text: ' hi ' }, { mins_ago: 3, where: '#ann', author: 'bob', kind: 'emote', text: 'waves' }] }).vars);
const g = render(tp('live.chat.global'), PREPARE['live.chat.global']({ window_label: 'past 3 hours', prior_memory: 'notes', recent_labels: ['a', 'b'], messages: [{ mins_ago: 12, where: 'global', author: 'goosely', text: ' hi ' }, { mins_ago: 3, where: '#ann', author: 'bob', kind: 'emote', text: 'waves' }] }).vars);
- assert.match(g, /covers roughly the past 3 hours, across/);
+ assert.match(g, /roughly the past 3 hours\)\. Work only/);
+ assert.match(g, /TWO sentences/);
+ assert.match(g, /never invent a topic, a person or an event/);
assert.match(g, /"""notes"""/);
assert.match(g, /"""notes"""/);
assert.match(g, /avoid duplicating these\):\n- a\n- b\n/);
assert.match(g, /avoid duplicating these\):\n- a\n- b\n/);
assert.match(g, /RECENT CHAT \(2 messages, oldest first\):\n\[12m ago\] \[global\] goosely: hi\n\[3m ago\] \[#ann\] bob: \(emote\) waves$/);
assert.match(g, /RECENT CHAT \(2 messages, oldest first\):\n\[12m ago\] \[global\] goosely: hi\n\[3m ago\] \[#ann\] bob: \(emote\) waves$/);