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
30#[inline]
31const fn default_loop_detection_enabled() -> bool {
32 false
33}
34
35#[inline]
36const fn default_loop_detection_threshold() -> usize {
37 3
38}
39
40#[inline]
41const fn default_loop_detection_interactive() -> bool {
42 true
43}