MCPcopy Create free account
hub / github.com/astercloud/aster / MockProvider

Struct MockProvider

pkg/agent/model_fallback_test.go:15–24  ·  view source on GitHub ↗

MockProvider 模拟 Provider

Source from the content-addressed store, hash-verified

13
14// MockProvider 模拟 Provider
15type MockProvider struct {
16 name string
17 shouldFail bool
18 failCount int
19 currentFails int
20 completeFunc func(context.Context, []types.Message, *provider.StreamOptions) (*provider.CompleteResponse, error)
21 streamFunc func(context.Context, []types.Message, *provider.StreamOptions) (<-chan provider.StreamChunk, error)
22 capabilities provider.ProviderCapabilities
23 systemPrompt string
24}
25
26func (m *MockProvider) Complete(ctx context.Context, messages []types.Message, opts *provider.StreamOptions) (*provider.CompleteResponse, error) {
27 if m.completeFunc != nil {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected