feat(*): 模型渠道 - 支持系统模型图标并升级 Agnes 视频协议

This commit is contained in:
ddCat committed 2026-08-27 23:31:38 +08:00
1 parent 7cb6aed27d
commit b3e977a985
30 files changed
+861 -44

No files matched your search

@@ -18,12 +18,16 @@ func withProtocolRegistry(ctx context.Context, registry *protocol.Registry) cont
return context.WithValue(ctx, protocolRegistryContextKey{}, registry)
}
func declarativeProtocolAdapterForContext(ctx context.Context, id string) (protocol.Adapter, bool) {
func protocolAdapterForContext(ctx context.Context, id string) (protocol.Adapter, bool) {
registry, _ := ctx.Value(protocolRegistryContextKey{}).(*protocol.Registry)
if registry == nil {
registry = protocol.Builtins()
}
adapter, ok := registry.Resolve(strings.TrimSpace(id))
return registry.Resolve(strings.TrimSpace(id))
}
func declarativeProtocolAdapterForContext(ctx context.Context, id string) (protocol.Adapter, bool) {
adapter, ok := protocolAdapterForContext(ctx, id)
if !ok || adapter.Metadata().Execution != "declarative" {
return nil, false
}