@@ -625,6 +625,10 @@ void ChatServiceImpl::process_async_impl(std::shared_ptr<ChatCall> call) {
625625 CHECK (stream_parser != nullptr ) << " create StreamOutputParser failed!" ;
626626 }
627627
628+ auto saved_tools = request_params.tools ;
629+ auto saved_streaming = request_params.streaming ;
630+ auto saved_request_id = request_params.request_id ;
631+
628632 master_->handle_request (
629633 std::move (messages),
630634 std::move (prompt_tokens),
@@ -633,12 +637,12 @@ void ChatServiceImpl::process_async_impl(std::shared_ptr<ChatCall> call) {
633637 [call,
634638 model,
635639 master = master_,
636- stream = request_params. streaming ,
640+ stream = std::move (saved_streaming) ,
637641 include_usage = include_usage,
638642 first_message_sent = std::unordered_set<size_t >(),
639- request_id = request_params. request_id ,
643+ request_id = std::move (saved_request_id) ,
640644 created_time = absl::ToUnixSeconds (absl::Now ()),
641- json_tools = request_params. tools ,
645+ json_tools = std::move (saved_tools) ,
642646 tool_call_parser_format = tool_call_parser_format_,
643647 reasoning_parser_format = reasoning_parser_format_,
644648 is_force_reasoning = is_force_reasoning_,
@@ -741,6 +745,9 @@ void MMChatServiceImpl::process_async_impl(std::shared_ptr<MMChatCall> call) {
741745 include_usage = rpc_request.stream_options ().include_usage ();
742746 }
743747
748+ auto saved_streaming = request_params.streaming ;
749+ auto saved_request_id = request_params.request_id ;
750+
744751 // schedule the request
745752 master_->handle_request (
746753 std::move (messages),
@@ -749,10 +756,10 @@ void MMChatServiceImpl::process_async_impl(std::shared_ptr<MMChatCall> call) {
749756 [call,
750757 model,
751758 master = master_,
752- stream = request_params. streaming ,
759+ stream = std::move (saved_streaming) ,
753760 include_usage = include_usage,
754761 first_message_sent = std::unordered_set<size_t >(),
755- request_id = request_params. request_id ,
762+ request_id = std::move (saved_request_id) ,
756763 created_time = absl::ToUnixSeconds (absl::Now ())](
757764 const RequestOutput& req_output) mutable -> bool {
758765 if (req_output.status .has_value ()) {
0 commit comments