Refactor codebase to package utility modules for distribution#57
Refactor codebase to package utility modules for distribution#57
Conversation
|
@fcogidi great initiative! Was super happy to see this PR. Will review it shortly. |
There was a problem hiding this comment.
Pull request overview
This PR refactors the codebase by extracting utility modules into a separate installable package (aieng-agents-utils), improving code organization and reusability across the Vector Institute Agent Bootcamp implementations.
Changes:
- Created a new Python package structure with proper build configuration, console scripts, and comprehensive documentation
- Migrated all utility modules (tools, data processing, async utilities, Langfuse integration, etc.) to the new package namespace
- Updated all import statements across reference implementations to use the new package structure
Reviewed changes
Copilot reviewed 63 out of 77 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| pyproject.toml | Updated project metadata and dependencies to use the new workspace package |
| aieng-agents-utils/pyproject.toml | Added package configuration with build system, dependencies, and console scripts |
| aieng-agents-utils/README.md | Created comprehensive documentation for the new utility package |
| aieng-agents-utils/aieng/agents/init.py | Created main package entry point with public API exports |
| aieng-agents-utils/aieng/agents/tools/init.py | Organized tool exports with proper all definitions |
| aieng-agents-utils/aieng/agents/prompts.py | Consolidated system prompts into centralized module |
| src//app.py, src//cli.py | Updated imports to reference new package namespace |
| tests/tool_tests/test_integration.py | Updated test imports to use new package structure |
| aieng-agents-utils/tests/README.md | Added test documentation with updated command paths |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@fcogidi, Can the |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 71 out of 92 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (4)
aieng-agents-utils/aieng/agents/tools/README.md:8
- This usage example points to
aieng-agents-utils/aieng/tools/news_events.py, but the module is located underaieng-agents-utils/aieng/agents/tools/news_events.py(or can be run viapython -m aieng.agents.tools.news_events). As written, the command will fail.
aieng-agents-utils/aieng/agents/web_search/README.md:117 - The README still instructs running
uvicorn utils.web_search.app:app, but the module path is nowaieng.agents.web_search.app:app. Updating the command prevents local-dev instructions from breaking.
aieng-agents-utils/aieng/agents/data/pdf_to_hf_dataset.py:20 - The docstring examples invoke
pdf_to_hf_dataset.py, but this module is exposed as a console script (pdf_to_hf_dataset) viaproject.scripts. Using the script name (orpython -m aieng.agents.data.pdf_to_hf_dataset) will make the examples runnable after installation.
aieng-agents-utils/aieng/agents/env_vars.py:72 - The docstring example imports
Configsfromimplementations.utils.env_vars, but the class lives inaieng.agents.env_vars(and is re-exported asaieng.agents.Configs). Updating the example avoids broken copy/paste for users.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
amrit110
left a comment
There was a problem hiding this comment.
Move looks pretty straight-forward. Just wondering about the package name for distribution.
There was a problem hiding this comment.
why aieng-agents-utils rather than aieng-agents? Do we just see this is a support/utility package?
There was a problem hiding this comment.
Importing it will look like:
from aieng.agents import ...But yeah, I think it's more a utility package. It's a bunch of helpful functions and tools for building agents, not an agent framework.
I guess aieng-agents is more consistent with the import pattern, plus a lot of the packages under the aieng namespace will be utility packages.
There was a problem hiding this comment.
I renamed the package to aieng-agents as that keeps things consistent. I still see it as a utility package though.
Summary
This PR converts utility modules/scripts into a package (
aieng-agents-utils).Type of Change
Changes Made
New Utility Package (
aieng-agents-utils)CLI Tools
pdf_to_hf_dataset: Console script for converting PDFs to chunked HuggingFace datasetschunk_hf_dataset: Console script for re-chunking existing HuggingFace datasetsAPI Key Management
--owners-fileDocumentation
Package Configuration
pyproject.tomlwith build system (hatchling)Testing
uv run pytest tests/)uv run ruff check src_dir/)Manual testing details:
Checklist