Merge pull request 'fix: 修复 deploy 工作流缺少 Node.js 导致 checkout 失败的问题' #72

Merged
huanghaosheng merged 61 commits from develop into main 2026-06-14 14:37:27 +08:00
Showing only changes of commit 00abc6c1e1 - Show all commits

View File

@@ -254,7 +254,7 @@ func TestProcessQuery_Success(t *testing.T) {
mockSender.On("SendTTSAudio", mock.Anything).Return(nil) mockSender.On("SendTTSAudio", mock.Anything).Return(nil)
// 创建 Pipeline // 创建 Pipeline
pipeline := New(mockSTT, mockLLM, mockTTS, mockSession, "gpt-4o") pipeline := New(mockSTT, mockLLM, mockTTS, mockSession, "gpt-4o", "alloy", 1.0)
// 执行 // 执行
ctx := context.Background() ctx := context.Background()
@@ -305,7 +305,7 @@ func TestProcessQuery_STTError(t *testing.T) {
mockSender.On("SendError", mock.Anything).Return(nil) mockSender.On("SendError", mock.Anything).Return(nil)
pipeline := New(mockSTT, mockLLM, mockTTS, mockSession, "gpt-4o") pipeline := New(mockSTT, mockLLM, mockTTS, mockSession, "gpt-4o", "alloy", 1.0)
ctx := context.Background() ctx := context.Background()
err := pipeline.ProcessQuery(ctx, "session-123", req, nil, mockSender) err := pipeline.ProcessQuery(ctx, "session-123", req, nil, mockSender)
@@ -357,7 +357,7 @@ func TestProcessQuery_LLMError(t *testing.T) {
mockSender.On("SendError", mock.Anything).Return(nil) mockSender.On("SendError", mock.Anything).Return(nil)
pipeline := New(mockSTT, mockLLM, mockTTS, mockSession, "gpt-4o") pipeline := New(mockSTT, mockLLM, mockTTS, mockSession, "gpt-4o", "alloy", 1.0)
ctx := context.Background() ctx := context.Background()
err := pipeline.ProcessQuery(ctx, "session-123", req, nil, mockSender) err := pipeline.ProcessQuery(ctx, "session-123", req, nil, mockSender)
@@ -415,7 +415,7 @@ func TestProcessQuery_TTSError(t *testing.T) {
mockTTS.On("SynthesizeStream", mock.Anything, mock.Anything, mock.Anything). mockTTS.On("SynthesizeStream", mock.Anything, mock.Anything, mock.Anything).
Return(nil, errors.New("TTS service unavailable")) Return(nil, errors.New("TTS service unavailable"))
pipeline := New(mockSTT, mockLLM, mockTTS, mockSession, "gpt-4o") pipeline := New(mockSTT, mockLLM, mockTTS, mockSession, "gpt-4o", "alloy", 1.0)
ctx := context.Background() ctx := context.Background()
err := pipeline.ProcessQuery(ctx, "session-123", req, nil, mockSender) err := pipeline.ProcessQuery(ctx, "session-123", req, nil, mockSender)
@@ -485,7 +485,7 @@ func TestProcessQuery_ContextCancelled(t *testing.T) {
}() }()
mockTTS.On("SynthesizeStream", mock.Anything, mock.Anything, mock.Anything).Return((<-chan tts.Chunk)(ttsCh), nil) mockTTS.On("SynthesizeStream", mock.Anything, mock.Anything, mock.Anything).Return((<-chan tts.Chunk)(ttsCh), nil)
pipeline := New(mockSTT, mockLLM, mockTTS, mockSession, "gpt-4o") pipeline := New(mockSTT, mockLLM, mockTTS, mockSession, "gpt-4o", "alloy", 1.0)
// 创建可取消的上下文 // 创建可取消的上下文
ctx, cancel := context.WithCancel(context.Background()) ctx, cancel := context.WithCancel(context.Background())
@@ -545,7 +545,7 @@ func TestProcessQuery_DisabledTTS(t *testing.T) {
mockSender.On("SendLLMChunk", mock.Anything).Return(nil) mockSender.On("SendLLMChunk", mock.Anything).Return(nil)
mockSender.On("SendLLMDone", mock.Anything).Return(nil) mockSender.On("SendLLMDone", mock.Anything).Return(nil)
pipeline := New(mockSTT, mockLLM, mockTTS, mockSession, "gpt-4o") pipeline := New(mockSTT, mockLLM, mockTTS, mockSession, "gpt-4o", "alloy", 1.0)
ctx := context.Background() ctx := context.Background()
err := pipeline.ProcessQuery(ctx, "session-123", req, nil, mockSender) err := pipeline.ProcessQuery(ctx, "session-123", req, nil, mockSender)
@@ -617,7 +617,7 @@ func TestProcessQuery_InvalidAudio(t *testing.T) {
mockSender.On("SendError", mock.Anything).Return(nil) mockSender.On("SendError", mock.Anything).Return(nil)
pipeline := New(mockSTT, mockLLM, mockTTS, mockSession, "gpt-4o") pipeline := New(mockSTT, mockLLM, mockTTS, mockSession, "gpt-4o", "alloy", 1.0)
ctx := context.Background() ctx := context.Background()
err := pipeline.ProcessQuery(ctx, "session-123", req, nil, mockSender) err := pipeline.ProcessQuery(ctx, "session-123", req, nil, mockSender)
@@ -650,7 +650,7 @@ func TestProcessQuery_SessionNotFound(t *testing.T) {
mockSender.On("SendError", mock.Anything).Return(nil) mockSender.On("SendError", mock.Anything).Return(nil)
pipeline := New(mockSTT, mockLLM, mockTTS, mockSession, "gpt-4o") pipeline := New(mockSTT, mockLLM, mockTTS, mockSession, "gpt-4o", "alloy", 1.0)
ctx := context.Background() ctx := context.Background()
err := pipeline.ProcessQuery(ctx, "session-123", req, nil, mockSender) err := pipeline.ProcessQuery(ctx, "session-123", req, nil, mockSender)