Skip to content
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
9b69622
feature(includes TTS ignore thought tags)
TECozens Dec 27, 2025
095aed4
Reverting some changes
TECozens Dec 30, 2025
481ea09
Final Commit Before Cleanup
TECozens Dec 31, 2025
675948f
Merge branch 'main' of https://github.com/moeru-ai/airi into consciou…
TECozens Dec 31, 2025
e3eed35
Final cleanup and use-chat helper functions
TECozens Dec 31, 2025
dcfe785
See how this does...
TECozens Dec 31, 2025
59976e4
Revert "See how this does..."
TECozens Jan 1, 2026
2ff0aca
Happy New Year
TECozens Jan 1, 2026
e40fb4b
Update packages/stage-ui/src/composables/llmmarkerParser.ts
TECozens Jan 1, 2026
23a0a96
Fixes
TECozens Jan 1, 2026
7138289
Merge branch 'consciousness-module-categorisation' of https://github.…
TECozens Jan 1, 2026
65cec6b
Added Rehype
TECozens Jan 2, 2026
0b83f92
Simple redundancy fixes.
TECozens Jan 2, 2026
a77e572
Attempt at performance improvement
TECozens Jan 2, 2026
2e6f211
Merge branch 'main' of https://github.com/moeru-ai/airi into consciou…
TECozens Jan 2, 2026
e01e239
Update packages/stage-ui/src/composables/responseCategorizer.ts
TECozens Jan 2, 2026
dfa04cc
Update packages/stage-ui/src/composables/responseCategorizer.ts
TECozens Jan 2, 2026
b7bf2bc
Fix renaming files and directories to match codebase patterns
TECozens Jan 3, 2026
0685638
Merge branch 'consciousness-module-categorisation' of https://github.…
TECozens Jan 3, 2026
290898e
Rename ChatResponseCategorisation -> ChatResponsePart
TECozens Jan 3, 2026
6336884
reverting this change , categorisation is already stored somewhere else
TECozens Jan 3, 2026
e3d75ce
Committing before merge
TECozens Jan 3, 2026
5075fcc
Merge branch 'main' of https://github.com/moeru-ai/airi into consciou…
TECozens Jan 3, 2026
22d2193
Fixing some packages issues :)
TECozens Jan 3, 2026
1c64ecd
Added Unit Tests
TECozens Jan 4, 2026
97d44c5
updated with some logs in the unit tests
TECozens Jan 4, 2026
e1908a7
Merge branch 'main' into consciousness-module-categorisation
shinohara-rin Jan 5, 2026
0b3c10b
Include i18n support
TECozens Jan 5, 2026
749467c
Merge branch 'consciousness-module-categorisation' of https://github.…
TECozens Jan 5, 2026
e9f6572
Merge branch 'main' into consciousness-module-categorisation
nekomeowww Jan 5, 2026
79ab50f
Merge branch 'main' into consciousness-module-categorisation
nekomeowww Jan 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/stage-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@
"posthog-js": "catalog:",
"postprocessing": "^6.38.2",
"rehype-katex": "^7.0.1",
"rehype-parse": "^9.0.1",
"rehype-stringify": "^10.0.1",
"reka-ui": "^2.7.0",
"remark-math": "^6.0.0",
Expand All @@ -129,6 +130,7 @@
"three": "^0.182.0",
"unified": "^11.0.5",
"unist-builder": "^4.0.0",
"unist-util-visit": "^5.0.0",
"unspeech": "^0.1.7",
"uuid": "^13.0.0",
"vaul-vue": "^0.4.1",
Expand Down Expand Up @@ -164,7 +166,9 @@
"@proj-airi/vite-plugin-warpdrive": "workspace:*",
"@types/audioworklet": "catalog:",
"@types/culori": "^4.0.1",
"@types/hast": "catalog:",
"@types/three": "^0.182.0",
"@types/unist": "catalog:",
"@unocss/reset": "^66.5.11",
"@vitejs/plugin-vue": "^6.0.3",
"clustr": "^1.0.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import type { ChatAssistantMessage, ChatSlices, ChatSlicesText } from '../../../
import { computed } from 'vue'

import MarkdownRenderer from '../../markdown/MarkdownRenderer.vue'
import ChatResponseCategorization from './ChatResponseCategorization.vue'
import ChatToolCallBlock from './ChatToolCallBlock.vue'

const props = withDefaults(defineProps<{
Expand Down Expand Up @@ -66,6 +67,12 @@ const boxClasses = computed(() => [
</template>
</div>
<div v-else-if="showLoader" i-eos-icons:three-dots-loading />

<ChatResponseCategorization
v-if="message.categorization"
:message="message"
:variant="variant"
/>
</div>
</div>
</template>
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<script setup lang="ts">
import type { ChatAssistantMessage } from '../../../types/chat'

import { computed } from 'vue'

import MarkdownRenderer from '../../markdown/MarkdownRenderer.vue'
import Collapsable from '../../misc/Collapsable.vue'

const props = defineProps<{
message: ChatAssistantMessage
variant?: 'desktop' | 'mobile'
}>()

const hasReasoning = computed(() => !!props.message.categorization?.reasoning?.trim())

const containerClasses = computed(() => [
'mt-2',
props.variant === 'mobile' ? 'text-xs' : 'text-sm',
])
</script>

<template>
<div v-if="hasReasoning" :class="containerClasses" flex="~ col" gap-1>
<Collapsable :default="false">
<template #trigger="slotProps">
<button
class="w-full flex items-center justify-between rounded-lg bg-neutral-100/50 px-2 py-1 text-xs text-neutral-600 outline-none transition-all duration-200 dark:bg-neutral-800/50 hover:bg-neutral-200/50 dark:text-neutral-400 dark:hover:bg-neutral-700/50"
@click="slotProps.setVisible(!slotProps.visible)"
>
<div flex="~ items-center" gap-1.5>
<div i-solar:lightbulb-bolt-bold-duotone size-3.5 text-amber-500 dark:text-amber-400 />
<span font-medium>Reasoning</span>
</div>
<div
i-solar:alt-arrow-down-linear
size-3
transition="transform duration-200"
:class="{ 'rotate-180': slotProps.visible }"
/>
</button>
</template>
<div
class="mt-1 border border-neutral-200 rounded-md bg-neutral-50/80 px-2 py-1.5 dark:border-neutral-700 dark:bg-neutral-900/80"
>
<MarkdownRenderer
:content="message.categorization?.reasoning ?? ''"
class="break-words"
text="xs neutral-700 dark:neutral-300"
/>
</div>
</Collapsable>
</div>
</template>
1 change: 1 addition & 0 deletions packages/stage-ui/src/composables/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ export * from './micvad'
export * from './queues'
export * from './use-analytics'
export * from './use-build-info'
export * from './use-chat-memory'
export * from './whisper'
38 changes: 38 additions & 0 deletions packages/stage-ui/src/composables/llmmarkerParser.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,4 +142,42 @@ describe('useLlmmarkerParser', async () => {
expect(collectedSpecials).toEqual(expectedSpecials)
}
})

it('should call onEnd with full text', async () => {
const fullText = 'Hello, world!'
let endText = ''

const parser = useLlmmarkerParser({
onEnd(text) {
endText = text
},
})

for (const char of fullText) {
await parser.consume(char)
}

await parser.end()

expect(endText).toBe(fullText)
})

it('should call onEnd with full text including specials', async () => {
const fullText = 'Hello <|special|> world!'
let endText = ''

const parser = useLlmmarkerParser({
onEnd(text) {
endText = text
},
})

for (const char of fullText) {
await parser.consume(char)
}

await parser.end()

expect(endText).toBe(fullText)
})
})
8 changes: 8 additions & 0 deletions packages/stage-ui/src/composables/llmmarkerParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ const TAG_CLOSE = '|>'
export function useLlmmarkerParser(options: {
onLiteral?: (literal: string) => void | Promise<void>
onSpecial?: (special: string) => void | Promise<void>
/**
* Called when parsing ends with the full accumulated text.
* Useful for final processing like categorization or filtering.
*/
onEnd?: (fullText: string) => void | Promise<void>
/**
* The minimum length of text required to emit a literal part.
* Useful for avoiding emitting literal parts too fast.
Expand All @@ -27,6 +32,7 @@ export function useLlmmarkerParser(options: {
const minLiteralEmitLength = Math.max(1, options.minLiteralEmitLength ?? 1)
let buffer = ''
let inTag = false
let fullText = ''

return {
/**
Expand All @@ -36,6 +42,7 @@ export function useLlmmarkerParser(options: {
* @param textPart The chunk of text to consume.
*/
async consume(textPart: string) {
fullText += textPart
buffer += textPart

while (buffer.length > 0) {
Expand Down Expand Up @@ -82,6 +89,7 @@ export function useLlmmarkerParser(options: {
await options.onLiteral?.(buffer)
buffer = ''
}
await options.onEnd?.(fullText)
},
}
}
Loading