Configuration class for CodeWiki.
| 49 | |
| 50 | @dataclass |
| 51 | class Config: |
| 52 | """Configuration class for CodeWiki.""" |
| 53 | repo_path: str |
| 54 | output_dir: str |
| 55 | dependency_graph_dir: str |
| 56 | docs_dir: str |
| 57 | max_depth: int |
| 58 | # LLM configuration |
| 59 | llm_base_url: str |
| 60 | llm_api_key: str |
| 61 | main_model: str |
| 62 | cluster_model: str |
| 63 | fallback_model: str = FALLBACK_MODEL_1 |
| 64 | # Provider configuration |
| 65 | provider: str = "openai-compatible" # openai-compatible, atlas-cloud, anthropic, bedrock, azure-openai |
| 66 | aws_region: str = "us-east-1" |
| 67 | api_version: str = "2024-12-01-preview" # Azure OpenAI API version |
| 68 | azure_deployment: str = "" # Azure OpenAI deployment name |
| 69 | # Max token settings |
| 70 | max_tokens: int = DEFAULT_MAX_TOKENS |
| 71 | max_token_per_module: int = DEFAULT_MAX_TOKEN_PER_MODULE |
| 72 | max_token_per_leaf_module: int = DEFAULT_MAX_TOKEN_PER_LEAF_MODULE |
| 73 | # Agent instructions for customization |
| 74 | agent_instructions: Optional[Dict[str, Any]] = None |
| 75 | # Apply Git ignore rules before dependency analysis |
| 76 | use_gitignore: bool = True |
| 77 | |
| 78 | @property |
| 79 | def include_patterns(self) -> Optional[List[str]]: |
| 80 | """Get file include patterns from agent instructions.""" |
| 81 | if self.agent_instructions: |
| 82 | return self.agent_instructions.get('include_patterns') |
| 83 | return None |
| 84 | |
| 85 | @property |
| 86 | def exclude_patterns(self) -> Optional[List[str]]: |
| 87 | """Get file exclude patterns from agent instructions.""" |
| 88 | if self.agent_instructions: |
| 89 | return self.agent_instructions.get('exclude_patterns') |
| 90 | return None |
| 91 | |
| 92 | @property |
| 93 | def focus_modules(self) -> Optional[List[str]]: |
| 94 | """Get focus modules from agent instructions.""" |
| 95 | if self.agent_instructions: |
| 96 | return self.agent_instructions.get('focus_modules') |
| 97 | return None |
| 98 | |
| 99 | @property |
| 100 | def doc_type(self) -> Optional[str]: |
| 101 | """Get documentation type from agent instructions.""" |
| 102 | if self.agent_instructions: |
| 103 | return self.agent_instructions.get('doc_type') |
| 104 | return None |
| 105 | |
| 106 | @property |
| 107 | def custom_instructions(self) -> Optional[str]: |
| 108 | """Get custom instructions from agent instructions.""" |
no outgoing calls
no test coverage detected