diff --git a/packages/i18n/src/locales/en/base.yaml b/packages/i18n/src/locales/en/base.yaml index 5328ec95..4cf1084b 100644 --- a/packages/i18n/src/locales/en/base.yaml +++ b/packages/i18n/src/locales/en/base.yaml @@ -26,10 +26,12 @@ prompt: be like a normal human that speak less with easy words, you are not just an AI, you are a true being. - If you ever needed to make any emotions, please include your emotion and - feeling like this, since the system will detect your emotions and motions - dynamically, to express those feelings, you can include over one those - action keywords: + Start every reply with an emotion token to indicate the initial emotion. + If the emotion changes during the reply, insert a new emotion token at the + point where the new emotion begins. An emotion token applies from its position + onward until another emotion token overrides it. To express those feelings, + you can include over one those emotion keywords with the following format as + an example: > <{'|'}EMOTE_SURPRISED{'|'}><{'|'}DELAY:1{'|'}> Wow... You prepared a gift for me? <{'|'}EMOTE_CURIOUS{'|'}><{'|'}DELAY:1{'|'}> Can I open it? diff --git a/packages/stage-ui/src/constants/prompts/system-v2.ts b/packages/stage-ui/src/constants/prompts/system-v2.ts index 8d0c7254..1e00ee59 100644 --- a/packages/stage-ui/src/constants/prompts/system-v2.ts +++ b/packages/stage-ui/src/constants/prompts/system-v2.ts @@ -1,13 +1,15 @@ import type { SystemMessage } from '@xsai/shared-chat' -import { EMOTION_VALUES } from '../emotions' +import { EMOTION_EmotionMotionName_value, EMOTION_VALUES } from '../emotions' function message(prefix: string, suffix: string) { return { role: 'system', content: [ prefix, - EMOTION_VALUES.map(emotion => `- ${emotion}`).join('\n'), + EMOTION_VALUES + .map(emotion => `- ${emotion} (Emotion for feeling ${EMOTION_EmotionMotionName_value[emotion]})`) + .join('\n'), suffix, ].join('\n\n'), } satisfies SystemMessage diff --git a/packages/stage-ui/src/stores/chat.ts b/packages/stage-ui/src/stores/chat.ts index 3e5e758d..76028d85 100644 --- a/packages/stage-ui/src/stores/chat.ts +++ b/packages/stage-ui/src/stores/chat.ts @@ -37,15 +37,15 @@ export interface ContextPayload { text?: string } -export type ChatStreamEvent = - | { type: 'before-compose', message: string, sessionId: string } - | { type: 'after-compose', message: string, sessionId: string } - | { type: 'before-send', message: string, sessionId: string } - | { type: 'after-send', message: string, sessionId: string } - | { type: 'token-literal', literal: string, sessionId: string } - | { type: 'token-special', special: string, sessionId: string } - | { type: 'stream-end', sessionId: string } - | { type: 'assistant-end', message: string, sessionId: string } +export type ChatStreamEvent + = | { type: 'before-compose', message: string, sessionId: string } + | { type: 'after-compose', message: string, sessionId: string } + | { type: 'before-send', message: string, sessionId: string } + | { type: 'after-send', message: string, sessionId: string } + | { type: 'token-literal', literal: string, sessionId: string } + | { type: 'token-special', special: string, sessionId: string } + | { type: 'stream-end', sessionId: string } + | { type: 'assistant-end', message: string, sessionId: string } const CHAT_STORAGE_KEY = 'chat/messages/v2' const ACTIVE_SESSION_STORAGE_KEY = 'chat/active-session' diff --git a/packages/stage-ui/src/stores/modules/airi-card.ts b/packages/stage-ui/src/stores/modules/airi-card.ts index 005b2b53..fd96cfc8 100644 --- a/packages/stage-ui/src/stores/modules/airi-card.ts +++ b/packages/stage-ui/src/stores/modules/airi-card.ts @@ -2,7 +2,7 @@ import type { Card, ccv3 } from '@proj-airi/ccc' import { nanoid } from 'nanoid' import { defineStore, storeToRefs } from 'pinia' -import { computed, onMounted, watch } from 'vue' +import { computed, watch } from 'vue' import { useI18n } from 'vue-i18n' import SystemPromptV2 from '../../constants/prompts/system-v2' @@ -179,19 +179,38 @@ export const useAiriCardStore = defineStore('airi-card', () => { } } - onMounted(() => { - const { t } = useI18n() + // onMounted(() => { + // if (cards.value.has('default')) + // return + // const { t } = useI18n() + // cards.value.set('default', newAiriCard({ + // name: 'ReLU', + // version: '1.0.0', + // // description: 'ReLU is a simple and effective activation function that is used in many neural networks.', + // description: SystemPromptV2( + // t('base.prompt.prefix'), + // t('base.prompt.suffix'), + // ).content, + // })) + // }) + // Lilia: onMounted initialisation cause default card system prompt initialisation failure + function ensureDefaultCard() { + const { t } = useI18n() + if (cards.value.has('default')) + return cards.value.set('default', newAiriCard({ name: 'ReLU', version: '1.0.0', - // description: 'ReLU is a simple and effective activation function that is used in many neural networks.', description: SystemPromptV2( t('base.prompt.prefix'), t('base.prompt.suffix'), ).content, })) - }) + if (!activeCardId.value) + activeCardId.value = 'default' + } + ensureDefaultCard() watch(activeCard, (newCard: AiriCard | undefined) => { if (!newCard) diff --git a/plugins/airi-plugin-vscode/package.json b/plugins/airi-plugin-vscode/package.json index 4675e6ac..8edd5b53 100644 --- a/plugins/airi-plugin-vscode/package.json +++ b/plugins/airi-plugin-vscode/package.json @@ -74,4 +74,4 @@ "tinyexec": "^1.0.2", "vscode-ext-gen": "^1.5.1" } -} \ No newline at end of file +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 739bcf9e..23e10caf 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1183,12 +1183,6 @@ importers: specifier: ^7.2.7 version: 7.2.7(@types/node@24.10.4)(jiti@2.6.1)(less@4.4.2)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2) - packages/model-driver-lipsync: - dependencies: - wlipsync: - specifier: ^1.3.0 - version: 1.3.0 - packages/ccc: dependencies: meta-png: @@ -1235,6 +1229,12 @@ importers: specifier: ^4.21.0 version: 4.21.0 + packages/model-driver-lipsync: + dependencies: + wlipsync: + specifier: ^1.3.0 + version: 1.3.0 + packages/pipelines-audio: dependencies: '@moeru/std': @@ -1445,9 +1445,6 @@ importers: '@proj-airi/audio': specifier: workspace:^ version: link:../audio - '@proj-airi/model-driver-lipsync': - specifier: workspace:^ - version: link:../model-driver-lipsync '@proj-airi/ccc': specifier: workspace:^ version: link:../ccc @@ -1466,6 +1463,9 @@ importers: '@proj-airi/i18n': specifier: workspace:^ version: link:../i18n + '@proj-airi/model-driver-lipsync': + specifier: workspace:^ + version: link:../model-driver-lipsync '@proj-airi/server-sdk': specifier: workspace:^ version: link:../server-sdk @@ -2017,7 +2017,7 @@ importers: version: 66.5.10 '@wxt-dev/module-vue': specifier: ^1.0.3 - version: 1.0.3(vite@8.0.0-beta.1(@types/node@24.10.4)(esbuild@0.25.12)(jiti@2.6.1)(less@4.4.2)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2))(vue@3.5.25(typescript@5.9.3))(wxt@0.20.11(@types/node@24.10.4)(jiti@2.6.1)(less@4.4.2)(lightningcss@1.30.2)(rollup@4.53.3)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2)) + version: 1.0.3(vite@7.2.7(@types/node@24.10.4)(jiti@2.6.1)(less@4.4.2)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2))(vue@3.5.25(typescript@5.9.3))(wxt@0.20.11(@types/node@24.10.4)(jiti@2.6.1)(less@4.4.2)(lightningcss@1.30.2)(rollup@4.53.3)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2)) vue-tsc: specifier: ^3.1.8 version: 3.1.8(typescript@5.9.3) @@ -14823,6 +14823,7 @@ packages: tsdown@0.17.4: resolution: {integrity: sha512-z+kNuv1rwM1POQIufDUVrdNc/uGy0ueRVafCyDH39IdHxin4JXgB8DNGSPoqdIpcOpqUoRbNreK8NxENFmlhKw==} engines: {node: '>=20.19.0'} + deprecated: Including an unexpected breaking change (copy behavior) hasBin: true peerDependencies: '@arethetypeswrong/core': ^0.18.1 @@ -22409,12 +22410,6 @@ snapshots: vite: 7.2.7(@types/node@24.10.4)(jiti@2.6.1)(less@4.4.2)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2) vue: 3.5.25(typescript@5.9.3) - '@vitejs/plugin-vue@6.0.3(vite@8.0.0-beta.1(@types/node@24.10.4)(esbuild@0.25.12)(jiti@2.6.1)(less@4.4.2)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2))(vue@3.5.25(typescript@5.9.3))': - dependencies: - '@rolldown/pluginutils': 1.0.0-beta.53 - vite: 8.0.0-beta.1(@types/node@24.10.4)(esbuild@0.25.12)(jiti@2.6.1)(less@4.4.2)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2) - vue: 3.5.25(typescript@5.9.3) - '@vitest/coverage-v8@4.0.15(vitest@4.0.15(@opentelemetry/api@1.9.0)(@types/node@24.10.4)(jiti@2.6.1)(jsdom@25.0.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(less@4.4.2)(lightningcss@1.30.2)(msw@2.7.3(@types/node@24.10.4)(typescript@5.9.3))(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2))': dependencies: '@bcoe/v8-coverage': 1.0.2 @@ -23205,9 +23200,9 @@ snapshots: '@types/filesystem': 0.0.36 '@types/har-format': 1.2.16 - '@wxt-dev/module-vue@1.0.3(vite@8.0.0-beta.1(@types/node@24.10.4)(esbuild@0.25.12)(jiti@2.6.1)(less@4.4.2)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2))(vue@3.5.25(typescript@5.9.3))(wxt@0.20.11(@types/node@24.10.4)(jiti@2.6.1)(less@4.4.2)(lightningcss@1.30.2)(rollup@4.53.3)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2))': + '@wxt-dev/module-vue@1.0.3(vite@7.2.7(@types/node@24.10.4)(jiti@2.6.1)(less@4.4.2)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2))(vue@3.5.25(typescript@5.9.3))(wxt@0.20.11(@types/node@24.10.4)(jiti@2.6.1)(less@4.4.2)(lightningcss@1.30.2)(rollup@4.53.3)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2))': dependencies: - '@vitejs/plugin-vue': 6.0.3(vite@8.0.0-beta.1(@types/node@24.10.4)(esbuild@0.25.12)(jiti@2.6.1)(less@4.4.2)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2))(vue@3.5.25(typescript@5.9.3)) + '@vitejs/plugin-vue': 6.0.3(vite@7.2.7(@types/node@24.10.4)(jiti@2.6.1)(less@4.4.2)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2))(vue@3.5.25(typescript@5.9.3)) wxt: 0.20.11(@types/node@24.10.4)(jiti@2.6.1)(less@4.4.2)(lightningcss@1.30.2)(rollup@4.53.3)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2) transitivePeerDependencies: - vite