Convert to dictionary.
(self)
| 158 | validate_model_name(self.main_model) |
| 159 | validate_model_name(self.cluster_model) |
| 160 | validate_model_name(self.fallback_model) |
| 161 | |
| 162 | def to_dict(self) -> dict: |
| 163 | """Convert to dictionary.""" |
| 164 | result = { |
| 165 | 'base_url': self.base_url, |
| 166 | 'main_model': self.main_model, |
| 167 | 'cluster_model': self.cluster_model, |
| 168 | 'default_output': self.default_output, |
| 169 | 'provider': self.provider, |
| 170 | 'aws_region': self.aws_region, |
| 171 | 'api_version': self.api_version, |
| 172 | 'azure_deployment': self.azure_deployment, |
| 173 | 'max_tokens': self.max_tokens, |
| 174 | 'max_token_per_module': self.max_token_per_module, |
| 175 | 'max_token_per_leaf_module': self.max_token_per_leaf_module, |
| 176 | 'max_depth': self.max_depth, |
| 177 | 'use_gitignore': self.use_gitignore, |
| 178 | 'fallback_model': self.fallback_model, |
| 179 | } |
| 180 | if self.agent_instructions and not self.agent_instructions.is_empty(): |
| 181 | result['agent_instructions'] = self.agent_instructions.to_dict() |
| 182 | return result |
no test coverage detected