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

Interface Provider

pkg/provider/interface.go:235–256  ·  view source on GitHub ↗

Provider 模型提供商接口

Source from the content-addressed store, hash-verified

233
234// Provider 模型提供商接口
235type Provider interface {
236 // Stream 流式对话
237 Stream(ctx context.Context, messages []types.Message, opts *StreamOptions) (<-chan StreamChunk, error)
238
239 // Complete 非流式对话(阻塞式,返回完整响应)
240 Complete(ctx context.Context, messages []types.Message, opts *StreamOptions) (*CompleteResponse, error)
241
242 // Config 返回配置
243 Config() *types.ModelConfig
244
245 // Capabilities 返回模型能力
246 Capabilities() ProviderCapabilities
247
248 // SetSystemPrompt 设置系统提示词
249 SetSystemPrompt(prompt string) error
250
251 // GetSystemPrompt 获取系统提示词
252 GetSystemPrompt() string
253
254 // Close 关闭连接
255 Close() error
256}
257
258// Factory 模型提供商工厂
259type Factory interface {

Callers 51

StreamMethod · 0.65
StreamChatMethod · 0.65
streamingExampleFunction · 0.65
collectExampleFunction · 0.65
filterExampleFunction · 0.65
lastEventExampleFunction · 0.65
SummarizeSessionMethod · 0.65
SummarizeIncrementalMethod · 0.65
ScoreMethod · 0.65
CompleteMethod · 0.65
GenerateMethod · 0.65
executeReasoningStepMethod · 0.65

Implementers 12

MockSummaryProviderpkg/memory/session_summary_test.go
MockProviderWithErrorpkg/memory/session_summary_test.go
MockProviderpkg/evals/llm_scorer_test.go
GLMProviderpkg/provider/glm.go
GeminiProviderpkg/provider/gemini.go
AnthropicProviderpkg/provider/anthropic.go
CustomClaudeProviderpkg/provider/custom_claude.go
DeepseekProviderpkg/provider/deepseek.go
GatewayProviderpkg/provider/gateway.go
OpenAICompatibleProviderpkg/provider/openai_compatible.go
MockProviderpkg/agent/model_fallback_test.go
MockProviderserver/test_helpers.go

Calls

no outgoing calls

Tested by

no test coverage detected