mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-02-03 13:00:52 +08:00
refactor(wsrelay): rename RoundTrip to NonStream
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user