{
const { stream } = useLLM()
- const { t } = useI18n()
+ const { systemPrompt } = storeToRefs(useAiriCardStore())
const sending = ref(false)
@@ -63,10 +62,10 @@ export const useChatStore = defineStore('chat', () => {
}
const messages = ref
>([
- SystemPromptV2(
- t('prompt.prefix'),
- t('prompt.suffix'),
- ),
+ {
+ role: 'system',
+ content: systemPrompt.value.replace(/\{\{user\}\}/g, 'user'),
+ } satisfies SystemMessage,
])
const streamingMessage = ref({ role: 'assistant', content: '' })
diff --git a/packages/stage-ui/src/stores/modules/airi-card.ts b/packages/stage-ui/src/stores/modules/airi-card.ts
new file mode 100644
index 000000000..a7a619234
--- /dev/null
+++ b/packages/stage-ui/src/stores/modules/airi-card.ts
@@ -0,0 +1,242 @@
+import type { Card, ccv3 } from '@proj-airi/ccc'
+
+import { useLocalStorage } from '@vueuse/core'
+import { defineStore, storeToRefs } from 'pinia'
+import { computed, onMounted, watch } from 'vue'
+import { useI18n } from 'vue-i18n'
+
+import SystemPromptV2 from '../../constants/prompts/system-v2'
+import { useConsciousnessStore } from './consciousness'
+import { useSpeechStore } from './speech'
+
+export interface AiriExtension {
+ modules: {
+ consciousness: {
+ model: string // Example: "gpt-4o"
+ }
+
+ speech: {
+ model: string // Example: "eleven_multilingual_v2"
+ voice_id: string // Example: "alloy"
+
+ pitch?: number
+ rate?: number
+ ssml?: boolean
+ language?: string
+ }
+
+ vrm?: {
+ source?: 'file' | 'url'
+ file?: string // Example: "vrm/model.vrm"
+ url?: string // Example: "https://example.com/vrm/model.vrm"
+ }
+
+ live2d?: {
+ source?: 'file' | 'url'
+ file?: string // Example: "live2d/model.json"
+ url?: string // Example: "https://example.com/live2d/model.json"
+ }
+ }
+
+ agents: {
+ [key: string]: { // example: minecraft
+ prompt: string
+ }
+ }
+}
+
+export interface AiriCard extends Card {
+ extensions: {
+ airi: AiriExtension
+ } & Card['extensions']
+}
+
+export const useAiriCardStore = defineStore('airi-card', () => {
+ const cards = useLocalStorage