Add manual routing policy for router (#15586)
This commit is contained in:
@@ -492,6 +492,7 @@ pub(super) async fn execute_tool_loop(
|
||||
top_k: current_request.top_k,
|
||||
min_p: current_request.min_p,
|
||||
repetition_penalty: current_request.repetition_penalty,
|
||||
routing_id: current_request.routing_id.clone(),
|
||||
};
|
||||
|
||||
// Continue to next iteration
|
||||
@@ -1070,6 +1071,7 @@ async fn execute_tool_loop_streaming_internal(
|
||||
top_k: current_request.top_k,
|
||||
min_p: current_request.min_p,
|
||||
repetition_penalty: current_request.repetition_penalty,
|
||||
routing_id: current_request.routing_id.clone(),
|
||||
};
|
||||
|
||||
continue;
|
||||
|
||||
@@ -96,6 +96,7 @@ impl ChatPreparationStage {
|
||||
// Store results in context
|
||||
ctx.state.preparation = Some(PreparationOutput {
|
||||
original_text: Some(processed_messages.text.clone()),
|
||||
routing_id: request.routing_id.clone(),
|
||||
token_ids,
|
||||
processed_messages: Some(processed_messages),
|
||||
tool_constraints: tool_call_constraint,
|
||||
|
||||
@@ -47,8 +47,9 @@ impl PipelineStage for EmbeddingPreparationStage {
|
||||
));
|
||||
};
|
||||
|
||||
// Extract text from request
|
||||
// Extract text and routing_id from request before borrowing ctx mutably
|
||||
let text = request.extract_text_for_routing();
|
||||
let routing_id = request.routing_id.clone();
|
||||
if text.is_empty() {
|
||||
return Err(error::bad_request(
|
||||
"empty_input",
|
||||
@@ -77,6 +78,7 @@ impl PipelineStage for EmbeddingPreparationStage {
|
||||
// Store preparation output
|
||||
ctx.state.preparation = Some(PreparationOutput {
|
||||
original_text: Some(text),
|
||||
routing_id,
|
||||
token_ids,
|
||||
processed_messages: None,
|
||||
tool_constraints: None,
|
||||
|
||||
@@ -68,6 +68,7 @@ impl GeneratePreparationStage {
|
||||
|
||||
ctx.state.preparation = Some(PreparationOutput {
|
||||
original_text,
|
||||
routing_id: request.routing_id.clone(),
|
||||
token_ids,
|
||||
processed_messages: None,
|
||||
tool_constraints: None,
|
||||
|
||||
Reference in New Issue
Block a user