picoclaw/pkg/providers/streaming.go
kkroid 350f5a20fd feat(voice): 新增 picoclaw-voice 语音对话网关
独立模块 cmd/picoclaw-voice,实现端到端语音对话链路(ASR → LLM → TTS)。
协议层基于 xiaozhi WebSocket 协议,做了适当扩展。

- 流式 ASR:豆包 / FunASR(本地)
- 流式 TTS:豆包 / Fish Speech(本地)
- Docker Compose 一键部署本地 ASR + TTS 服务
- Python demo 客户端用于联调
2026-03-16 17:23:34 +08:00

23 lines
595 B
Go

// PicoClaw - Ultra-lightweight personal AI agent
// License: MIT
//
// Copyright (c) 2026 PicoClaw contributors
package providers
import "context"
// StreamingProvider extends LLMProvider with streaming capability.
// Text tokens are delivered via onToken as they arrive from the API.
// Tool calls are accumulated internally and returned in the final *LLMResponse.
type StreamingProvider interface {
LLMProvider
ChatStream(
ctx context.Context,
messages []Message,
tools []ToolDefinition,
model string,
options map[string]any,
onToken func(string),
) (*LLMResponse, error)
}