mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-02-19 04:40:52 +08:00
feat(translator): add built-in translator registry and helpers
- Introduced `builtin` package exposing a default registry and pipeline for built-in translators. - Added format constants for common schemas (e.g., OpenAI, Gemini, Codex). - Implemented helper functions for schema translation using format name strings. - Provided example usage for integration with translator helpers.
This commit is contained in:
18
sdk/translator/builtin/builtin.go
Normal file
18
sdk/translator/builtin/builtin.go
Normal file
@@ -0,0 +1,18 @@
|
||||
// Package builtin exposes the built-in translator registrations for SDK users.
|
||||
package builtin
|
||||
|
||||
import (
|
||||
sdktranslator "github.com/router-for-me/CLIProxyAPI/v6/sdk/translator"
|
||||
|
||||
_ "github.com/router-for-me/CLIProxyAPI/v6/internal/translator"
|
||||
)
|
||||
|
||||
// Registry exposes the default registry populated with all built-in translators.
|
||||
func Registry() *sdktranslator.Registry {
|
||||
return sdktranslator.Default()
|
||||
}
|
||||
|
||||
// Pipeline returns a pipeline that already contains the built-in translators.
|
||||
func Pipeline() *sdktranslator.Pipeline {
|
||||
return sdktranslator.NewPipeline(sdktranslator.Default())
|
||||
}
|
||||
Reference in New Issue
Block a user