refactor(providers): reorganize provider packages and facades

This commit is contained in:
lc6464
2026-04-17 12:42:03 +08:00
parent 72f30c58e9
commit ee634dc8db
29 changed files with 573 additions and 102 deletions
+46
View File
@@ -0,0 +1,46 @@
package providers
import httpapi "github.com/sipeed/picoclaw/pkg/providers/httpapi"
type (
GeminiProvider = httpapi.GeminiProvider
HTTPProvider = httpapi.HTTPProvider
)
func NewGeminiProvider(
apiKey string,
apiBase string,
proxy string,
userAgent string,
requestTimeoutSeconds int,
extraBody map[string]any,
customHeaders map[string]string,
) *GeminiProvider {
return httpapi.NewGeminiProvider(apiKey, apiBase, proxy, userAgent, requestTimeoutSeconds, extraBody, customHeaders)
}
func NewHTTPProvider(apiKey, apiBase, proxy string) *HTTPProvider {
return httpapi.NewHTTPProvider(apiKey, apiBase, proxy)
}
func NewHTTPProviderWithMaxTokensField(apiKey, apiBase, proxy, maxTokensField string) *HTTPProvider {
return httpapi.NewHTTPProviderWithMaxTokensField(apiKey, apiBase, proxy, maxTokensField)
}
func NewHTTPProviderWithMaxTokensFieldAndRequestTimeout(
apiKey, apiBase, proxy, maxTokensField, userAgent string,
requestTimeoutSeconds int,
extraBody map[string]any,
customHeaders map[string]string,
) *HTTPProvider {
return httpapi.NewHTTPProviderWithMaxTokensFieldAndRequestTimeout(
apiKey,
apiBase,
proxy,
maxTokensField,
userAgent,
requestTimeoutSeconds,
extraBody,
customHeaders,
)
}