| package executor |
|
|
| import ( |
| "context" |
| "net/http" |
|
|
| "github.com/router-for-me/CLIProxyAPI/v6/internal/config" |
| cliproxyauth "github.com/router-for-me/CLIProxyAPI/v6/sdk/cliproxy/auth" |
| cliproxyexecutor "github.com/router-for-me/CLIProxyAPI/v6/sdk/cliproxy/executor" |
| ) |
|
|
| |
| |
| type GeminiCLIExecutor struct { |
| ref *GeminiCLIExecutorRefactored |
| } |
|
|
| |
| func NewGeminiCLIExecutor(cfg *config.Config) *GeminiCLIExecutor { |
| return &GeminiCLIExecutor{ref: NewGeminiCLIExecutorRefactored(cfg)} |
| } |
|
|
| |
| func (e *GeminiCLIExecutor) Identifier() string { |
| return e.ref.Identifier() |
| } |
|
|
| |
| func (e *GeminiCLIExecutor) PrepareRequest(req *http.Request, auth *cliproxyauth.Auth) error { |
| return e.ref.PrepareRequest(req, auth) |
| } |
|
|
| |
| func (e *GeminiCLIExecutor) HttpRequest(ctx context.Context, auth *cliproxyauth.Auth, req *http.Request) (*http.Response, error) { |
| return e.ref.HttpRequest(ctx, auth, req) |
| } |
|
|
| |
| func (e *GeminiCLIExecutor) Execute(ctx context.Context, auth *cliproxyauth.Auth, req cliproxyexecutor.Request, opts cliproxyexecutor.Options) (cliproxyexecutor.Response, error) { |
| return e.ref.Execute(ctx, auth, req, opts) |
| } |
|
|
| |
| func (e *GeminiCLIExecutor) ExecuteStream(ctx context.Context, auth *cliproxyauth.Auth, req cliproxyexecutor.Request, opts cliproxyexecutor.Options) (*cliproxyexecutor.StreamResult, error) { |
| return e.ref.ExecuteStream(ctx, auth, req, opts) |
| } |
|
|
| |
| func (e *GeminiCLIExecutor) CountTokens(ctx context.Context, auth *cliproxyauth.Auth, req cliproxyexecutor.Request, opts cliproxyexecutor.Options) (cliproxyexecutor.Response, error) { |
| return e.ref.CountTokens(ctx, auth, req, opts) |
| } |
|
|
| |
| func (e *GeminiCLIExecutor) Refresh(ctx context.Context, auth *cliproxyauth.Auth) (*cliproxyauth.Auth, error) { |
| return e.ref.Refresh(ctx, auth) |
| } |
|
|