MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / resolveAgentAccountInput

Function resolveAgentAccountInput

agent/app/service/agents_utils.go:62–83  ·  view source on GitHub ↗
(provider, apiKey, baseURL string)

Source from the content-addressed store, hash-verified

60}
61
62func resolveAgentAccountInput(provider, apiKey, baseURL string) (resolvedAgentAccountInput, error) {
63 resolvedAPIKey := strings.TrimSpace(apiKey)
64 resolvedBaseURL := strings.TrimSpace(baseURL)
65 if resolvedBaseURL == "" {
66 if requiresInitialAgentAccountModels(provider) {
67 return resolvedAgentAccountInput{}, buserr.New("ErrAgentBaseURLRequired")
68 }
69 if defaultURL, ok := providercatalog.DefaultBaseURL(provider); ok {
70 resolvedBaseURL = defaultURL
71 }
72 }
73 if !providercatalog.SkipVerification(provider) {
74 if err := providercatalog.VerifyAccount(provider, resolvedBaseURL, resolvedAPIKey); err != nil {
75 return resolvedAgentAccountInput{}, err
76 }
77 }
78 return resolvedAgentAccountInput{
79 Provider: provider,
80 APIKey: resolvedAPIKey,
81 BaseURL: resolvedBaseURL,
82 }, nil
83}
84
85func readOpenclawConfig(configPath string) (map[string]interface{}, error) {
86 if strings.TrimSpace(configPath) == "" {

Callers 3

CreateAccountMethod · 0.85
UpdateAccountMethod · 0.85
VerifyAccountMethod · 0.85

Calls 2

VerifyAccountMethod · 0.65

Tested by

no test coverage detected