1use serde::{Deserialize, Serialize};
4
5#[derive(Debug, Clone, Serialize, Deserialize)]
7pub struct ReasoningResult {
8 pub problem: String,
10 pub solution: String,
12 pub thought_tree: String,
14 pub depth: usize,
16 pub branches: usize,
18 pub raw_content: String,
20}
21
22#[derive(Debug, Clone, Default)]
24pub struct ReasoningOptions {
25 pub depth: Option<usize>,
27 pub branches: Option<usize>,
29}
30
31impl ReasoningOptions {
32 pub fn new() -> Self {
34 Self::default()
35 }
36
37 pub fn depth(mut self, depth: usize) -> Self {
39 self.depth = Some(depth);
40 self
41 }
42
43 pub fn branches(mut self, branches: usize) -> Self {
45 self.branches = Some(branches);
46 self
47 }
48}
49
50#[derive(Debug, Clone, Copy, Serialize, Deserialize)]
52#[serde(rename_all = "lowercase")]
53pub enum SourceType {
54 Text,
56 Code,
58}
59
60#[derive(Debug, Clone, Serialize, Deserialize)]
62pub struct Concept {
63 pub name: String,
65 pub concept_type: String,
67 pub weight: f64,
69 pub description: Option<String>,
71}
72
73#[derive(Debug, Clone, Serialize, Deserialize)]
75pub struct ConceptResult {
76 pub concepts: Vec<Concept>,
78 pub source_type: SourceType,
80 pub raw_content: String,
82}
83
84#[derive(Debug, Clone, Serialize, Deserialize)]
86pub struct Chunk {
87 pub id: String,
89 pub content: String,
91 pub position: usize,
93 pub priority: String,
95}
96
97#[derive(Debug, Clone, Serialize, Deserialize)]
99pub struct ChunkResult {
100 pub chunks: Vec<Chunk>,
102 pub total_chunks: usize,
104 pub raw_content: String,
106}
107
108#[derive(Debug, Clone, Serialize, Deserialize)]
110pub struct RetrievalResult {
111 pub query: String,
113 pub results: Vec<Chunk>,
115 pub raw_content: String,
117}
118
119#[derive(Debug, Clone, Serialize, Deserialize)]
121pub struct GraphNode {
122 pub id: String,
124 pub name: String,
126 pub node_type: String,
128 pub weight: f64,
130}
131
132#[derive(Debug, Clone, Serialize, Deserialize)]
134pub struct KnowledgeGraphResult {
135 pub operation: String,
137 pub nodes: Vec<GraphNode>,
139 pub stats: Option<serde_json::Value>,
141 pub raw_content: String,
143}
144
145#[derive(Debug, Clone, Copy, Default, Serialize, Deserialize)]
147#[serde(rename_all = "lowercase")]
148pub enum DetailLevel {
149 Brief,
151 #[default]
153 Normal,
154 Detailed,
156}
157
158#[derive(Debug, Clone, Serialize, Deserialize)]
160pub struct PlanStep {
161 pub number: usize,
163 pub title: String,
165 pub description: String,
167 pub priority: String,
169 pub effort: String,
171 pub dependencies: Vec<String>,
173}
174
175#[derive(Debug, Clone, Serialize, Deserialize)]
177pub struct PlanResult {
178 pub task: String,
180 pub category: String,
182 pub steps: Vec<PlanStep>,
184 pub total_effort: String,
186 pub raw_content: String,
188}
189
190#[derive(Debug, Clone, Default)]
192pub struct PlanOptions {
193 pub context: Option<String>,
195 pub max_steps: Option<usize>,
197 pub detail_level: Option<DetailLevel>,
199}
200
201impl PlanOptions {
202 pub fn new() -> Self {
204 Self::default()
205 }
206
207 pub fn context(mut self, context: impl Into<String>) -> Self {
209 self.context = Some(context.into());
210 self
211 }
212
213 pub fn max_steps(mut self, max_steps: usize) -> Self {
215 self.max_steps = Some(max_steps);
216 self
217 }
218
219 pub fn detail_level(mut self, level: DetailLevel) -> Self {
221 self.detail_level = Some(level);
222 self
223 }
224}
225
226#[derive(Debug, Clone, Serialize, Deserialize)]
228pub struct ToolDefinition {
229 pub name: String,
231 pub description: String,
233 pub input_schema: serde_json::Value,
235}
236
237#[derive(Debug, Clone)]
239pub struct ClientOptions {
240 pub server_path: Option<String>,
242 pub timeout_ms: u64,
244 pub auto_connect: bool,
246}
247
248impl Default for ClientOptions {
249 fn default() -> Self {
250 Self {
251 server_path: None,
252 timeout_ms: 30000,
253 auto_connect: true,
254 }
255 }
256}
257
258impl ClientOptions {
259 pub fn new() -> Self {
261 Self::default()
262 }
263
264 pub fn server_path(mut self, path: impl Into<String>) -> Self {
266 self.server_path = Some(path.into());
267 self
268 }
269
270 pub fn timeout_ms(mut self, timeout: u64) -> Self {
272 self.timeout_ms = timeout;
273 self
274 }
275
276 pub fn auto_connect(mut self, auto: bool) -> Self {
278 self.auto_connect = auto;
279 self
280 }
281}