Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 8 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
[workspace]
members = [ "crates/tauri-plugin-ipc-audio-transcription-ort", "crates/tauri-plugin-ipc-audio-vad-ort", "crates/tauri-plugin-mcp", "crates/tauri-plugin-rdev", "crates/tauri-plugin-window-pass-through-on-hover", "crates/tauri-plugin-window-router-link" ]
members = [
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why you again.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

autofix is certainly up to something :D

"crates/tauri-plugin-ipc-audio-transcription-ort",
"crates/tauri-plugin-ipc-audio-vad-ort",
"crates/tauri-plugin-mcp",
"crates/tauri-plugin-rdev",
"crates/tauri-plugin-window-pass-through-on-hover",
"crates/tauri-plugin-window-router-link"
]
resolver = "2"

[workspace.package]
Expand Down
2 changes: 2 additions & 0 deletions packages/stage-ui/src/stores/character-orchestrator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@ export const useCharacterOrchestratorStore = defineStore('character-orchestrator
sparkNoResponseTool,
sparkCommandTool,
],
supportsTools: true, // we expect tools to be supported
waitForTools: true, // see https://github.com/moeru-ai/airi/issues/907
onStreamEvent: async (streamEvent: StreamEvent) => {
if (streamEvent.type === 'text-delta') {
if (noResponse)
Expand Down
3 changes: 2 additions & 1 deletion packages/stage-ui/src/stores/llm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export interface StreamOptions {
onStreamEvent?: (event: StreamEvent) => void | Promise<void>
toolsCompatibility?: Map<string, boolean>
supportsTools?: boolean
waitForTools?: boolean // when true,won't resolve on finishReason=='tool_calls';
tools?: Tool[] | (() => Promise<Tool[] | undefined>)
}

Expand Down Expand Up @@ -72,7 +73,7 @@ async function streamFrom(model: string, chatProvider: ChatProvider, messages: M
async onEvent(event) {
try {
await options?.onStreamEvent?.(event as StreamEvent)
if (event.type === 'finish')
if (event.type === 'finish' && (event.finishReason !== 'tool_calls' || !options?.waitForTools))
resolve()
else if (event.type === 'error')
reject(event.error ?? new Error('Stream error'))
Expand Down
Loading