@economic/agents 2.10.3 → 2.10.4

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 CHANGED
@@ -264,7 +264,7 @@ The `Assistant` keeps the chat list in its own SQLite (a `chats` table, created
264
264
  | `deleteChat(id)` | `void` | Deletes a chat facet and its record. |
265
265
  | `renameChat(id)` | `void` | Renames a registered chat. |
266
266
 
267
- - **Titles and summaries** — generated with `fastModel` after each turn (on the first turn, then refreshed as the chat grows).
267
+ - **Titles and summaries** — generated with `fastModel` after each turn (on the first turn, then refreshed as the chat grows). Written in the language of the conversation, following the user's most recent messages when a chat mixes languages.
268
268
  - **Empty chat cleanup** — a newly created facet is scheduled for deletion after one day. Its first completed turn replaces that schedule with the normal sliding retention period.
269
269
  - **Retention** — inactive chats are deleted after 90 days, via a Durable Object alarm.
270
270
 
package/dist/index.mjs CHANGED
@@ -1547,7 +1547,10 @@ async function summariseChatWithAI(sql, durableObjectName, messages, model) {
1547
1547
  You will be given a list of messages and you need to generate a title and summary for the chat.
1548
1548
  The title should be a short title for the chat, max 8-10 words.
1549
1549
  The summary should be a short 1-2 sentence summary of the chat.
1550
- The summary should reflect the direction of the chat.`;
1550
+ The summary should reflect the direction of the chat.
1551
+ Write the title and the summary in the same language as the conversation, never
1552
+ translating them to English. If the conversation mixes languages, follow the
1553
+ language of the user's most recent messages.`;
1551
1554
  if (chat) systemPrompt += `\n\nThe previous summary: ${chat.summary}`;
1552
1555
  try {
1553
1556
  const { output: { title, summary } } = await generateText({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@economic/agents",
3
- "version": "2.10.3",
3
+ "version": "2.10.4",
4
4
  "description": "A starter for creating a TypeScript package.",
5
5
  "license": "MIT",
6
6
  "files": [