feat(kit): central tools for harnesses through the egress proxy and gateway task-tool RPCs
This commit is contained in:
41 files changed
+2187
-189
No files matched your search
@@ -14,6 +14,12 @@ import (
|
||||
// "provider/model"; its Reasoning flag tells the runtime which models need
|
||||
// max_completion_tokens instead of max_tokens.
|
||||
func NewRuntime(providers map[string]agentrun.Provider, limits map[string]config.ModelLimits) *runtime.Runtime {
|
||||
return NewRuntimeWithKeys(providers, limits, nil)
|
||||
}
|
||||
|
||||
// NewRuntimeWithKeys binds host-resolved credentials to one runtime without
|
||||
// exporting them into the process environment or the task protocol.
|
||||
func NewRuntimeWithKeys(providers map[string]agentrun.Provider, limits map[string]config.ModelLimits, keys map[string]string) *runtime.Runtime {
|
||||
if len(providers) == 0 {
|
||||
return nil
|
||||
}
|
||||
@@ -21,7 +27,9 @@ func NewRuntime(providers map[string]agentrun.Provider, limits map[string]config
|
||||
catalog := make(map[string]runtime.ProviderConfig, len(providers))
|
||||
for name, provider := range providers {
|
||||
cfg := runtime.ProviderConfig{ID: name, Class: provider.Class, BaseURL: provider.BaseURL, Models: reasoningModels(name, limits)}
|
||||
if provider.APIKeyEnv == "" {
|
||||
if key, ok := keys[name]; ok {
|
||||
cfg.Auth = runtime.AuthConfig{APIKey: key}
|
||||
} else if provider.APIKeyEnv == "" {
|
||||
cfg.Auth = runtime.AuthConfig{Type: runtime.AuthTypeNone}
|
||||
} else {
|
||||
cfg.Auth = runtime.AuthConfig{APIKeyEnv: provider.APIKeyEnv}
|
||||
|
||||
Reference in new issue
Block a user