Skip to content

Commit f257b72

Browse files
committed
Add config file support and structure for multiple LLMs
## Migrations - Adjusted the version specification of `serde` for consistency and clarity. - Enhanced release profile settings for optimization. ## Dependencies - Introduced the `dirs` and `toml` crates to facilitate reading from configuration files. - Added development dependencies (`assert_cmd` and `predicates`) to aid in testing and command assertions. ## README - Updated the README.md to detail reading from a configuration file and future multi-LLM support. - Added a privacy notice for OpenAI processing only. - Included a new "Prove It!" section for practical usage demonstration. - Clarified installation prerequisites regarding the OpenAI API key. ## Models ### src/config.rs - Introduced a `Config` struct consolidating configuration settings for model selection. - Implemented `from_sources` method to read configurations from multiple sources (CLI, env vars, TOML, defaults). - Created utility functions to find and read a TOML configuration file, enhancing user customization. - Established groundwork for supporting multiple models in the future. ### src/llm/mod.rs - Introduced `LlmClient` trait for a standardized LLM interface. - Implemented `NoopClient` struct for testing purposes without a functional LLM. - Prepared code structure for future LLM integration. ### src/llm/ollama.rs - Introduced `ollama.rs` for future functionality related to a specific LLM. - Organized code structure to lay the groundwork for multiple LLM support. ### src/llm/openai.rs - Introduced `LlmClient` implementation for OpenAI, enabling requests to the OpenAI Chat Completions API. - Implemented methods for summarizing files and generating commit/PR messages. - Added data structures for managing API requests/responses. ## Main Application ### src/main.rs - Introduced `config` and `llm` modules for better organization and future multi-LLM support. - Changed struct fields and methods to public for external access. - Updated configuration resolution to use the new `Config` module. ## Tests ### tests/cli_basics.rs - Added `cli_basics.rs` to validate CLI behavior, ensuring correct responses to `--help` and `--version` flags. - This supports the ability to read from a config file while ensuring proper CLI interaction.
1 parent bd6210e commit f257b72

File tree

9 files changed

+1001
-621
lines changed

9 files changed

+1001
-621
lines changed

Cargo.lock

Lines changed: 271 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)