(auth *Auth)
| 5635 | } |
| 5636 | |
| 5637 | func executorKeyFromAuth(auth *Auth) string { |
| 5638 | if auth == nil { |
| 5639 | return "" |
| 5640 | } |
| 5641 | if auth.Attributes != nil { |
| 5642 | providerKey := strings.TrimSpace(auth.Attributes["provider_key"]) |
| 5643 | compatName := strings.TrimSpace(auth.Attributes["compat_name"]) |
| 5644 | if compatName != "" { |
| 5645 | if providerKey == "" { |
| 5646 | providerKey = compatName |
| 5647 | } |
| 5648 | return util.OpenAICompatibleProviderKey(providerKey) |
| 5649 | } |
| 5650 | } |
| 5651 | if strings.EqualFold(strings.TrimSpace(auth.Provider), "openai-compatibility") { |
| 5652 | providerKey := strings.TrimSpace(auth.Label) |
| 5653 | if providerKey == "" { |
| 5654 | providerKey = "openai-compatibility" |
| 5655 | } |
| 5656 | return util.OpenAICompatibleProviderKey(providerKey) |
| 5657 | } |
| 5658 | return strings.ToLower(strings.TrimSpace(auth.Provider)) |
| 5659 | } |
| 5660 | |
| 5661 | // logEntryWithRequestID returns a logrus entry with request_id field if available in context. |
| 5662 | func logEntryWithRequestID(ctx context.Context) *log.Entry { |
no test coverage detected