MCPcopy Create free account
hub / github.com/FSoft-AI4Code/CodeWiki / Configuration

Class Configuration

codewiki/cli/models/config.py:106–277  ·  view source on GitHub ↗

CodeWiki configuration data model. Attributes: base_url: LLM API base URL main_model: Primary model for documentation generation cluster_model: Model for module clustering fallback_model: Fallback model for documentation generation default_output: De

Source from the content-addressed store, hash-verified

104 additions.append(
105 f"Pay special attention to and provide more detailed documentation for these modules: {', '.join(self.focus_modules)}"
106 )
107
108 if self.custom_instructions:
109 additions.append(f"Additional instructions: {self.custom_instructions}")
110
111 return "\n".join(additions) if additions else ""
112
113
114@dataclass
115class Configuration:
116 """
117 CodeWiki configuration data model.
118
119 Attributes:
120 base_url: LLM API base URL
121 main_model: Primary model for documentation generation
122 cluster_model: Model for module clustering
123 fallback_model: Fallback model for documentation generation
124 default_output: Default output directory
125 provider: LLM provider type (openai-compatible, atlas-cloud, anthropic, bedrock, azure-openai)
126 aws_region: AWS region for Bedrock provider
127 api_version: Azure OpenAI API version
128 azure_deployment: Azure OpenAI deployment name
129 max_tokens: Maximum tokens for LLM response (default: 32768)
130 max_token_per_module: Maximum tokens per module for clustering (default: 36369)
131 max_token_per_leaf_module: Maximum tokens per leaf module (default: 16000)
132 max_depth: Maximum depth for hierarchical decomposition (default: 2)
133 use_gitignore: Apply Git ignore rules during repository analysis
134 prompt_caching: Add prompt-cache breakpoints to agentic LLM calls (default: True)
135 agent_instructions: Custom agent instructions for documentation generation
136 """
137
138 base_url: str
139 main_model: str
140 cluster_model: str
141 fallback_model: str = "glm-4p5"
142 default_output: str = "docs"
143 provider: str = "openai-compatible"
144 aws_region: str = "us-east-1"
145 api_version: str = "2024-12-01-preview"
146 azure_deployment: str = ""
147 max_tokens: int = 32768
148 max_token_per_module: int = 36369
149 max_token_per_leaf_module: int = 16000
150 max_depth: int = 2
151 use_gitignore: bool = True
152 prompt_caching: bool = True
153 agent_instructions: AgentInstructions = field(default_factory=AgentInstructions)
154
155 def validate(self):
156 """
157 Validate all configuration fields.
158
159 Subscription-mode providers (claude-code, codex) authenticate via the
160 underlying CLI's OAuth and do not require a base URL or fallback model.
161
162 Raises:
163 ConfigurationError: If validation fails

Callers 1

saveMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected