Convert to dictionary, excluding None values.
(self)
| 42 | custom_instructions: Optional[str] = None # Free-form instructions |
| 43 | |
| 44 | def to_dict(self) -> dict: |
| 45 | """Convert to dictionary, excluding None values.""" |
| 46 | result = {} |
| 47 | if self.include_patterns: |
| 48 | result['include_patterns'] = self.include_patterns |
| 49 | if self.exclude_patterns: |
| 50 | result['exclude_patterns'] = self.exclude_patterns |
| 51 | if self.focus_modules: |
| 52 | result['focus_modules'] = self.focus_modules |
| 53 | if self.doc_type: |
| 54 | result['doc_type'] = self.doc_type |
| 55 | if self.custom_instructions: |
| 56 | result['custom_instructions'] = self.custom_instructions |
| 57 | return result |
| 58 | |
| 59 | @classmethod |
| 60 | def from_dict(cls, data: dict) -> 'AgentInstructions': |
no outgoing calls
no test coverage detected