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

Function findAgentAccountModelForProvider

agent/app/service/agents_utils.go:1434–1441  ·  view source on GitHub ↗
(provider string, models []dto.AgentAccountModel, modelID string)

Source from the content-addressed store, hash-verified

1432}
1433
1434func findAgentAccountModelForProvider(provider string, models []dto.AgentAccountModel, modelID string) (dto.AgentAccountModel, bool) {
1435 for _, item := range models {
1436 if sameProviderModelID(provider, item.ID, modelID) {
1437 return item, true
1438 }
1439 }
1440 return dto.AgentAccountModel{}, false
1441}
1442
1443func requireAgentAccountModelForProvider(provider string, models []dto.AgentAccountModel, modelID string) (dto.AgentAccountModel, error) {
1444 selectedAccountModel, ok := findAgentAccountModelForProvider(provider, models, modelID)

Callers 3

CreateAccountModelMethod · 0.85

Calls 1

sameProviderModelIDFunction · 0.85

Tested by

no test coverage detected