|
24 | 24 | │ ├── sqlite_context_store.py # SQLite implementation |
25 | 25 | │ ├── postgres_context_store.py # PostgreSQL implementation |
26 | 26 | │ └── storage_factory.py # Factory for creating stores |
27 | | -├── auth/ # Authentication modules (k8s, jwk, noop) |
| 27 | +├── authentication/ # Authentication modules (k8s, jwk, noop, rh-identity) |
28 | 28 | ├── authorization/ # Authorization middleware & resolvers |
29 | 29 | ├── cache/ # Conversation cache implementations |
| 30 | +├── quota/ # Quota limiter and token usage tracking |
| 31 | +├── metrics/ # Prometheus metrics |
| 32 | +├── runners/ # Agent runners |
30 | 33 | ├── models/ # Pydantic models |
31 | 34 | │ ├── config.py # Configuration classes |
32 | 35 | │ ├── requests.py # Request models |
33 | | -│ └── responses.py # Response models |
| 36 | +│ ├── responses.py # Response models |
| 37 | +│ └── database/ # Database models |
34 | 38 | ├── utils/ # Utility functions |
35 | | -├── client.py # Llama Stack client wrapper |
36 | | -└── configuration.py # Config management |
| 39 | +├── client.py # Llama Stack client wrapper (Singleton) |
| 40 | +├── configuration.py # Config management (Singleton) |
| 41 | +└── constants.py # Shared constants |
37 | 42 | ``` |
38 | 43 |
|
39 | 44 | ### Coding Standards |
40 | 45 |
|
41 | 46 | #### Imports & Dependencies |
42 | | -- Use absolute imports for internal modules: `from auth import get_auth_dependency` |
| 47 | +- Use absolute imports for internal modules: `from authentication import get_auth_dependency` |
43 | 48 | - FastAPI dependencies: `from fastapi import APIRouter, HTTPException, Request, status, Depends` |
44 | 49 | - Llama Stack imports: `from llama_stack_client import AsyncLlamaStackClient` |
45 | 50 | - **ALWAYS** check `pyproject.toml` for existing dependencies before adding new ones |
46 | 51 | - **ALWAYS** verify current library versions in `pyproject.toml` rather than assuming versions |
| 52 | +- Check `constants.py` for shared constants before defining new ones |
47 | 53 |
|
48 | 54 | #### Module Standards |
49 | 55 | - All modules start with descriptive docstrings explaining purpose |
@@ -167,7 +173,7 @@ uv run make test-e2e # End-to-end tests |
167 | 173 | ### Linting Tools |
168 | 174 | - **black**: Code formatting |
169 | 175 | - **pylint**: Static analysis (`source-roots = "src"`) |
170 | | -- **pyright**: Type checking (excludes `src/auth/k8s.py`) |
| 176 | +- **pyright**: Type checking (excludes `src/authentication/k8s.py`) |
171 | 177 | - **ruff**: Fast linter |
172 | 178 | - **pydocstyle**: Docstring style |
173 | 179 | - **mypy**: Additional type checking |
|
0 commit comments