refactor(wsrelay): rename RoundTrip to NonStream

This commit is contained in:
hkfires
2025-10-26 20:01:46 +08:00
parent 7061cd6058
commit f3f31274e8
2 changed files with 4 additions and 4 deletions

View File

@@ -72,7 +72,7 @@ func (e *AistudioExecutor) Execute(ctx context.Context, auth *cliproxyauth.Auth,
AuthValue: authValue, AuthValue: authValue,
}) })
wsResp, err := e.relay.RoundTrip(ctx, e.provider, wsReq) wsResp, err := e.relay.NonStream(ctx, e.provider, wsReq)
if err != nil { if err != nil {
recordAPIResponseError(ctx, e.cfg, err) recordAPIResponseError(ctx, e.cfg, err)
return resp, err return resp, err
@@ -220,7 +220,7 @@ func (e *AistudioExecutor) CountTokens(ctx context.Context, auth *cliproxyauth.A
AuthType: authType, AuthType: authType,
AuthValue: authValue, AuthValue: authValue,
}) })
resp, err := e.relay.RoundTrip(ctx, e.provider, wsReq) resp, err := e.relay.NonStream(ctx, e.provider, wsReq)
if err != nil { if err != nil {
recordAPIResponseError(ctx, e.cfg, err) recordAPIResponseError(ctx, e.cfg, err)
return cliproxyexecutor.Response{}, err return cliproxyexecutor.Response{}, err

View File

@@ -35,8 +35,8 @@ type StreamEvent struct {
Err error Err error
} }
// RoundTrip executes a non-streaming HTTP request using the websocket provider. // NonStream executes a non-streaming HTTP request using the websocket provider.
func (m *Manager) RoundTrip(ctx context.Context, provider string, req *HTTPRequest) (*HTTPResponse, error) { func (m *Manager) NonStream(ctx context.Context, provider string, req *HTTPRequest) (*HTTPResponse, error) {
if req == nil { if req == nil {
return nil, fmt.Errorf("wsrelay: request is nil") return nil, fmt.Errorf("wsrelay: request is nil")
} }