mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-02-02 04:20:50 +08:00
25 lines
755 B
Go
25 lines
755 B
Go
// Package util provides utility functions used across the CLIProxyAPI application.
|
|
// These functions handle common tasks such as determining AI service providers
|
|
// from model names and managing HTTP proxies.
|
|
package util
|
|
|
|
import (
|
|
"strings"
|
|
)
|
|
|
|
// GetProviderName determines the AI service provider based on the model name.
|
|
// It analyzes the model name string to identify which service provider it belongs to.
|
|
//
|
|
// Supported providers:
|
|
// - "gemini" for Google's Gemini models
|
|
// - "gpt" for OpenAI's GPT models
|
|
// - "unknow" for unrecognized model names
|
|
func GetProviderName(modelName string) string {
|
|
if strings.Contains(modelName, "gemini") {
|
|
return "gemini"
|
|
} else if strings.Contains(modelName, "gpt") {
|
|
return "gpt"
|
|
}
|
|
return "unknow"
|
|
}
|