File size: 3,682 Bytes
6434782 3e5ab39 6434782 3e5ab39 6434782 3e5ab39 6434782 3e5ab39 6434782 3e5ab39 6434782 3e5ab39 6434782 3e5ab39 6434782 3e5ab39 6434782 3e5ab39 6434782 3e5ab39 6434782 3e5ab39 6434782 3e5ab39 6434782 3e5ab39 6434782 3e5ab39 6434782 3e5ab39 6434782 3e5ab39 6434782 3e5ab39 6434782 3e5ab39 6434782 0e32196 3e5ab39 6434782 3e5ab39 6434782 3e5ab39 6434782 3e5ab39 6434782 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 | 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"
)
// CodexWebsocketsExecutor is a compatibility wrapper delegating to CodexWebsocketsExecutorRefactored.
type CodexWebsocketsExecutor struct {
ref *CodexWebsocketsExecutorRefactored
}
func NewCodexWebsocketsExecutor(cfg *config.Config) *CodexWebsocketsExecutor {
return &CodexWebsocketsExecutor{ref: NewCodexWebsocketsExecutorRefactored(cfg)}
}
func (e *CodexWebsocketsExecutor) Identifier() string { return e.ref.Identifier() }
func (e *CodexWebsocketsExecutor) PrepareRequest(req *http.Request, auth *cliproxyauth.Auth) error {
return e.ref.PrepareRequest(req, auth)
}
func (e *CodexWebsocketsExecutor) HttpRequest(ctx context.Context, auth *cliproxyauth.Auth, req *http.Request) (*http.Response, error) {
return e.ref.HttpRequest(ctx, auth, req)
}
func (e *CodexWebsocketsExecutor) 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 *CodexWebsocketsExecutor) 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 *CodexWebsocketsExecutor) Refresh(ctx context.Context, auth *cliproxyauth.Auth) (*cliproxyauth.Auth, error) {
return e.ref.Refresh(ctx, auth)
}
func (e *CodexWebsocketsExecutor) 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 *CodexWebsocketsExecutor) CloseExecutionSession(sessionID string) {
e.ref.CloseExecutionSession(sessionID)
}
// CodexAutoExecutor is a compatibility wrapper delegating to CodexAutoExecutorRefactored.
type CodexAutoExecutor struct {
ref *CodexAutoExecutorRefactored
}
func NewCodexAutoExecutor(cfg *config.Config) *CodexAutoExecutor {
return &CodexAutoExecutor{ref: NewCodexAutoExecutorRefactored(cfg)}
}
func (e *CodexAutoExecutor) Identifier() string { return e.ref.Identifier() }
func (e *CodexAutoExecutor) PrepareRequest(req *http.Request, auth *cliproxyauth.Auth) error {
return e.ref.PrepareRequest(req, auth)
}
func (e *CodexAutoExecutor) HttpRequest(ctx context.Context, auth *cliproxyauth.Auth, req *http.Request) (*http.Response, error) {
return e.ref.HttpRequest(ctx, auth, req)
}
func (e *CodexAutoExecutor) 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 *CodexAutoExecutor) 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 *CodexAutoExecutor) Refresh(ctx context.Context, auth *cliproxyauth.Auth) (*cliproxyauth.Auth, error) {
return e.ref.Refresh(ctx, auth)
}
func (e *CodexAutoExecutor) 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 *CodexAutoExecutor) CloseExecutionSession(sessionID string) {
e.ref.CloseExecutionSession(sessionID)
}
|