We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f8a5b38 commit 1768c00Copy full SHA for 1768c00
router/src/server.rs
@@ -1246,9 +1246,13 @@ async fn chat_completions(
1246
.as_secs();
1247
1248
let (tool_calls, output) = if tool_grammar.is_some() {
1249
- let gen_text_value: Value = serde_json::from_str(&generation.generated_text)
1250
- .map_err(|e| InferError::ToolError(e.to_string()))?;
1251
-
+ let gen_text_value: Value =
+ serde_json::from_str(&generation.generated_text).map_err(|e| {
+ InferError::ToolError(format!(
1252
+ "Failed to parse generated text: {} {:?}",
1253
+ e, generation.generated_text
1254
+ ))
1255
+ })?;
1256
let function = gen_text_value.get("function").ok_or(InferError::ToolError(
1257
"No function found in generated text".to_string(),
1258
))?;
0 commit comments