vtcode_config/core/
model.rs1use serde::{Deserialize, Serialize};
2
3#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
5#[derive(Debug, Clone, Deserialize, Serialize)]
6pub struct ModelConfig {
7 #[serde(default = "default_loop_detection_enabled")]
9 pub skip_loop_detection: bool,
10
11 #[serde(default = "default_loop_detection_threshold")]
13 pub loop_detection_threshold: usize,
14
15 #[serde(default = "default_loop_detection_interactive")]
17 pub loop_detection_interactive: bool,
18}
19
20impl Default for ModelConfig {
21 fn default() -> Self {
22 Self {
23 skip_loop_detection: default_loop_detection_enabled(),
24 loop_detection_threshold: default_loop_detection_threshold(),
25 loop_detection_interactive: default_loop_detection_interactive(),
26 }
27 }
28}
29
30fn default_loop_detection_enabled() -> bool {
31 false
32}
33
34fn default_loop_detection_threshold() -> usize {
35 3
36}
37
38fn default_loop_detection_interactive() -> bool {
39 true
40}