1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
use serde::{Deserialize, Serialize};
use crate::common::Tool;
/// Request to parse function calls from model output text.
#[derive(Debug, Clone, Serialize, Deserialize, schemars::JsonSchema)]
pub struct ParseFunctionCallRequest {
/// The text to parse for function calls.
pub text: String,
/// The parser type/name to use for parsing (e.g., "json", "pythonic").
pub tool_call_parser: String,
/// The list of available tools that the model can call.
pub tools: Vec<Tool>,
}
/// Response from parsing function calls.
#[derive(Debug, Clone, Serialize, Deserialize, schemars::JsonSchema)]
pub struct ParseFunctionCallResponse {
/// Remaining text after extracting function calls.
pub remaining_text: String,
/// Extracted tool calls.
pub tool_calls: Vec<serde_json::Value>,
/// Whether parsing succeeded.
pub success: bool,
}
/// Request to separate reasoning from normal text in model output.
#[derive(Debug, Clone, Serialize, Deserialize, schemars::JsonSchema)]
pub struct SeparateReasoningRequest {
/// The text to parse for reasoning content.
pub text: String,
/// The parser type/name to use for reasoning detection (e.g., "step3", "deepseek_r1").
pub reasoning_parser: String,
}
/// Response from separating reasoning.
#[derive(Debug, Clone, Serialize, Deserialize, schemars::JsonSchema)]
pub struct SeparateReasoningResponse {
/// Normal (non-reasoning) text.
pub normal_text: String,
/// Extracted reasoning text.
pub reasoning_text: String,
/// Whether parsing succeeded.
pub success: bool,
}