(exchange *pendingExchange, params *rpc.LlmInferenceHTTPRequestChunkRequest)
| 638 | } |
| 639 | |
| 640 | func (a *copilotRequestAdapter) routeChunk(exchange *pendingExchange, params *rpc.LlmInferenceHTTPRequestChunkRequest) { |
| 641 | if params.Cancel != nil && *params.Cancel { |
| 642 | exchange.cancel() |
| 643 | exchange.queue.close() |
| 644 | return |
| 645 | } |
| 646 | if params.Data != "" { |
| 647 | binary := params.Binary != nil && *params.Binary |
| 648 | if data, err := decodeChunkData(params.Data, binary); err == nil { |
| 649 | exchange.queue.push(CopilotWebSocketMessage{Data: data, Binary: binary}) |
| 650 | } |
| 651 | } |
| 652 | if params.End != nil && *params.End { |
| 653 | exchange.queue.close() |
| 654 | } |
| 655 | } |
| 656 | |
| 657 | func (a *copilotRequestAdapter) runHandler(rctx *CopilotRequestContext, sink *responseSink, exchange *pendingExchange) { |
| 658 | err := a.handler.handle(rctx, sink) |
no test coverage detected