Skip to main content

vtcode_config/core/agent/
prompt_suggestions.rs

1//! Inline prompt-suggestion configuration.
2
3use serde::{Deserialize, Serialize};
4
5/// Inline prompt suggestion configuration for the chat composer.
6#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
7#[derive(Debug, Clone, Deserialize, Serialize)]
8pub struct AgentPromptSuggestionsConfig {
9    /// Enable inline prompt suggestions in the chat composer.
10    #[serde(default = "default_prompt_suggestions_enabled")]
11    pub enabled: bool,
12
13    /// Lightweight model to use for suggestions.
14    /// Leave empty to auto-select an efficient sibling of the main model.
15    #[serde(default)]
16    pub model: String,
17
18    /// Temperature for inline prompt suggestion generation.
19    #[serde(default = "default_prompt_suggestions_temperature")]
20    pub temperature: f32,
21
22    /// Whether VT Code should remind users that LLM-backed suggestions consume tokens.
23    #[serde(default = "default_prompt_suggestions_show_cost_notice")]
24    pub show_cost_notice: bool,
25}
26
27impl Default for AgentPromptSuggestionsConfig {
28    fn default() -> Self {
29        Self {
30            enabled: default_prompt_suggestions_enabled(),
31            model: String::new(),
32            temperature: default_prompt_suggestions_temperature(),
33            show_cost_notice: default_prompt_suggestions_show_cost_notice(),
34        }
35    }
36}
37
38#[inline]
39const fn default_prompt_suggestions_enabled() -> bool {
40    true
41}
42
43#[inline]
44const fn default_prompt_suggestions_temperature() -> f32 {
45    0.3
46}
47
48#[inline]
49const fn default_prompt_suggestions_show_cost_notice() -> bool {
50    true
51}