Skip to content

Commit 169ae9e

Browse files
Sync fork
1 parent 418c317 commit 169ae9e

File tree

4 files changed

+20
-10
lines changed

4 files changed

+20
-10
lines changed

mistralrs-server-core/src/chat_completion.rs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -327,9 +327,16 @@ async fn parse_request(
327327

328328
images.push(image);
329329
}
330-
RequestMessage::VisionChat { messages, images }
330+
RequestMessage::VisionChat {
331+
messages,
332+
images,
333+
enable_thinking: oairequest.enable_thinking,
334+
}
331335
} else {
332-
RequestMessage::Chat(messages)
336+
RequestMessage::Chat {
337+
messages,
338+
enable_thinking: oairequest.enable_thinking,
339+
}
333340
}
334341
}
335342
Either::Right(prompt) => {
@@ -339,7 +346,10 @@ async fn parse_request(
339346
message_map.insert("role".to_string(), Either::Left("user".to_string()));
340347
message_map.insert("content".to_string(), Either::Left(prompt));
341348
messages.push(message_map);
342-
RequestMessage::Chat(messages)
349+
RequestMessage::Chat {
350+
messages,
351+
enable_thinking: oairequest.enable_thinking,
352+
}
343353
}
344354
};
345355

mistralrs-server-core/src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,17 +161,17 @@ pub struct Args {
161161
#[arg(long)]
162162
pub cpu: bool,
163163

164-
/// Enable web searching for interactive mode.
165-
#[arg(long = "interactive-search")]
166-
pub interactive_search: bool,
167-
168164
/// Enable searching compatible with the OpenAI `web_search_options` setting. This uses the BERT model specified below or the default.
169165
#[arg(long = "enable-search")]
170166
pub enable_search: bool,
171167

172168
/// Specify a Hugging Face model ID for a BERT model to assist web searching. Defaults to Snowflake Arctic Embed L.
173169
#[arg(long = "search-bert-model")]
174170
pub search_bert_model: Option<String>,
171+
172+
/// Enable thinking for interactive mode and models that support it.
173+
#[arg(long = "enable-thinking")]
174+
pub enable_thinking: bool,
175175
}
176176

177177
fn parse_token_source(s: &str) -> Result<TokenSource, String> {
@@ -345,7 +345,7 @@ pub async fn bootstrap_mistralrs_router(
345345
pipeline,
346346
scheduler_config,
347347
args.interactive_mode,
348-
bert_model,
348+
bert_model.clone(),
349349
args.log,
350350
args.truncate_sequence,
351351
args.no_kv_cache,

mistralrs-server-core/src/openai.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,8 @@ pub struct ChatCompletionRequest {
173173
pub dry_allowed_length: Option<usize>,
174174
#[schema(example = json!(Option::None::<String>))]
175175
pub dry_sequence_breakers: Option<Vec<String>>,
176+
#[schema(example = json!(Option::None::<bool>))]
177+
pub enable_thinking: Option<bool>,
176178
}
177179

178180
#[derive(Debug, Serialize, ToSchema)]

mistralrs-server-core/src/util.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,6 @@ mod tests {
112112
xjApU46pnBe8fwF4pb+/8Ywv/DK9zbCKsfWXUBhf+A1dOX00S+xfgc3L3dmKWSn7iklDjthxbSaH
113113
c7YCVIAfi6JYn5bHjTHTGmurQJXJ8C/um928G9zK4gAAAABJRU5ErkJggg==
114114
";
115-
let image = parse_image_url(url).await.unwrap();
116-
assert_eq!(image.dimensions(), (32, 32));
117115

118116
let url = format!("data:image/png;base64,{}", url);
119117
let image = parse_image_url(&url).await.unwrap();

0 commit comments

Comments
 (0)