Skip to content

Latest commit

 

History

History
45 lines (35 loc) · 1.55 KB

AGENTS.md

File metadata and controls

45 lines (35 loc) · 1.55 KB

Agent Guidelines for ai_cookbook

Build/Lint/Test Commands

  • Install dependencies: uv sync
  • Run project: uv run python <script.py>
  • No linting tools configured - use your judgment for code quality
  • No test framework configured - test manually by running scripts

Code Style Guidelines

Python Version

  • Use Python 3.11+ (as specified in .python-version and pyproject.toml)

Imports

  • Group imports: standard library first, then third-party packages
  • Use absolute imports
  • Sort imports alphabetically within groups

Naming Conventions

  • Variables/Functions: snake_case (e.g., get_weather, model_id)
  • Classes: PascalCase (not observed in codebase yet)
  • Constants: UPPER_CASE (not observed in codebase yet)

Type Hints

  • Use type hints for function parameters and return types
  • Use Optional from typing for optional parameters
  • Example: def get_weather(location: str, celsius: Optional[bool] = False) -> str:

Documentation

  • Use docstrings for all functions with descriptions and Args sections
  • Keep docstrings concise but informative

Error Handling

  • Use context managers (with statements) for resource management
  • Handle exceptions appropriately (not extensively observed in codebase)

Code Structure

  • Keep functions focused on single responsibilities
  • Use meaningful variable names
  • Prefer f-strings for string formatting
  • Follow PEP 8 conventions

Dependencies

  • Only use packages already in pyproject.toml: smolagents, sqlalchemy
  • Check pyproject.toml before adding new dependencies