feat: CI/CD pipeline + Learning/Medicine/Travel services
- Add Gitea Actions workflow for automated build & deploy - Add K8s manifests: webui, travel-svc, medicine-svc, sandbox-svc - Update kustomization for localhost:5000 registry - Add ingress for gooseek.ru and api.gooseek.ru - Learning cabinet with onboarding, courses, sandbox integration - Medicine service with symptom analysis and doctor matching - Travel service with itinerary planning - Server setup scripts (NVIDIA/CUDA, K3s, Gitea runner) Made-with: Cursor
This commit is contained in:
36
backend/internal/learning/mock_llm_test.go
Normal file
36
backend/internal/learning/mock_llm_test.go
Normal file
@@ -0,0 +1,36 @@
|
||||
package learning
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/gooseek/backend/internal/llm"
|
||||
)
|
||||
|
||||
type mockLLMClient struct {
|
||||
generateFunc func(ctx context.Context, req llm.StreamRequest) (string, error)
|
||||
streamFunc func(ctx context.Context, req llm.StreamRequest) (<-chan llm.StreamChunk, error)
|
||||
}
|
||||
|
||||
func (m *mockLLMClient) StreamText(ctx context.Context, req llm.StreamRequest) (<-chan llm.StreamChunk, error) {
|
||||
if m.streamFunc != nil {
|
||||
return m.streamFunc(ctx, req)
|
||||
}
|
||||
ch := make(chan llm.StreamChunk)
|
||||
close(ch)
|
||||
return ch, nil
|
||||
}
|
||||
|
||||
func (m *mockLLMClient) GenerateText(ctx context.Context, req llm.StreamRequest) (string, error) {
|
||||
if m.generateFunc != nil {
|
||||
return m.generateFunc(ctx, req)
|
||||
}
|
||||
return "", nil
|
||||
}
|
||||
|
||||
func (m *mockLLMClient) GetProviderID() string {
|
||||
return "mock"
|
||||
}
|
||||
|
||||
func (m *mockLLMClient) GetModelKey() string {
|
||||
return "mock-model"
|
||||
}
|
||||
Reference in New Issue
Block a user