- 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
37 lines
848 B
Go
37 lines
848 B
Go
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"
|
|
}
|