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

Method from_dict

codewiki/cli/models/config.py:182–211  ·  view source on GitHub ↗

Create Configuration from dictionary. Args: data: Configuration dictionary Returns: Configuration instance

(cls, data: dict)

Source from the content-addressed store, hash-verified

180 use_gitignore: bool = True
181 prompt_caching: bool = True
182 agent_instructions: AgentInstructions = field(default_factory=AgentInstructions)
183
184 def validate(self):
185 """
186 Validate all configuration fields.
187
188 Subscription-mode providers (claude-code, codex) authenticate via the
189 underlying CLI's OAuth and do not require a base URL or fallback model.
190
191 Raises:
192 ConfigurationError: If validation fails
193 """
194 from codewiki.src.be.backend import is_caw_provider
195
196 if is_caw_provider(self.provider):
197 validate_model_name(self.main_model)
198 return
199 validate_url(self.base_url)
200 validate_model_name(self.main_model)
201 validate_model_name(self.cluster_model)
202 validate_model_name(self.fallback_model)
203
204 def to_dict(self) -> dict:
205 """Convert to dictionary."""
206 result = {
207 "base_url": self.base_url,
208 "main_model": self.main_model,
209 "cluster_model": self.cluster_model,
210 "default_output": self.default_output,
211 "provider": self.provider,
212 "aws_region": self.aws_region,
213 "api_version": self.api_version,
214 "azure_deployment": self.azure_deployment,

Callers 1

loadMethod · 0.45

Calls 2

AgentInstructionsClass · 0.85
getMethod · 0.80

Tested by

no test coverage detected