-
Notifications
You must be signed in to change notification settings - Fork 7
pref(provider):删掉产品不需要的driver capabilities值 #225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,7 +17,6 @@ type DriverDefinition struct { | |
| Build Builder | ||
| Discover DiscoveryFunc | ||
| ValidateCatalogIdentity func(identity ProviderIdentity) error | ||
| Capabilities DriverTransportCapabilities | ||
| } | ||
|
|
||
| type Registry struct { | ||
|
|
@@ -43,6 +42,9 @@ func (r *Registry) Register(driver DriverDefinition) error { | |
| if driver.Build == nil { | ||
| return fmt.Errorf("provider: driver %q build func is nil", driver.Name) | ||
| } | ||
| if driver.Discover == nil { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hard-requiring |
||
| return fmt.Errorf("provider: driver %q discover func is nil", driver.Name) | ||
| } | ||
| if _, exists := r.drivers[driverType]; exists { | ||
| return fmt.Errorf("%w: %s", ErrDriverAlreadyRegistered, driver.Name) | ||
| } | ||
|
|
@@ -63,9 +65,6 @@ func (r *Registry) DiscoverModels(ctx context.Context, cfg RuntimeConfig) ([]pro | |
| if err != nil { | ||
| return nil, err | ||
| } | ||
| if driver.Discover == nil { | ||
| return nil, nil | ||
| } | ||
| return driver.Discover(ctx, cfg) | ||
| } | ||
|
|
||
|
|
@@ -74,15 +73,6 @@ func (r *Registry) Supports(driverType string) bool { | |
| return err == nil | ||
| } | ||
|
|
||
| // DriverTransportCapabilities 返回指定 driver 的传输能力声明;driver 不存在时返回对应错误。 | ||
| func (r *Registry) DriverTransportCapabilities(driverType string) (DriverTransportCapabilities, error) { | ||
| driver, err := r.driver(driverType) | ||
| if err != nil { | ||
| return DriverTransportCapabilities{}, err | ||
| } | ||
| return driver.Capabilities, nil | ||
| } | ||
|
|
||
| // ValidateCatalogIdentity 在读取 catalog 快照或执行默认模型回退前执行无需密钥的静态校验,避免无效配置被误判为可用。 | ||
| func (r *Registry) ValidateCatalogIdentity(identity ProviderIdentity) error { | ||
| if r == nil { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -42,9 +42,6 @@ func (g *compactSummaryGenerator) Generate(ctx context.Context, input contextcom | |
| strings.TrimSpace(g.providerConfig.APIKey) == "" { | ||
| return "", errors.New("runtime: compact summary generator provider config is incomplete") | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The same regression exists in compact generation: without the old streaming capability check, we now invoke the provider and only fail after the call returns, often as a generic stream/protocol error. That makes unsupported drivers look like flaky runtime failures instead of a clear configuration/contract problem. |
||
| } | ||
| if err := ensureDriverTransportCapabilities(g.providerFactory, g.providerConfig, true, false); err != nil { | ||
| return "", err | ||
| } | ||
|
|
||
| prompt := agentcontext.BuildCompactPrompt(agentcontext.CompactPromptInput{ | ||
| Mode: string(input.Mode), | ||
|
|
||
This comment was marked as outdated.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.