Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: OpenAI Integration changes * Add `profile` module and tracing dependency Based only on the changes visible in the diff, this commit: - Adds a new `profile` module in `src/lib.rs`. - Inserts a new macro in the `profile` module in `src/profile.rs`. - Adds a new dependency, `tracing`, in `Cargo.toml`. - Updates the version from `0.2.56` to `0.2.57` in `Cargo.lock`. - Includes the new `tracing` dependency to the dependencies list in `Cargo.lock`. * Add Ollama client implementation for model interactions - Introduce `OllamaClient` for handling requests to the Ollama API. - Implement `OllamaClientTrait` with methods for generating responses and checking model availability. - Create new `client.rs` module for request/response handling and to integrate with both Ollama and OpenAI models. - Modify `Cargo.toml` to include the `parking_lot` dependency for better synchronization. - Set up a structured way to format prompts and parse JSON responses from the Ollama API, ensuring robust error handling and logging. * Remove OllamaClient implementation and references from the codebase. Delete the `ollama.rs` file, which contained the `OllamaClient` struct and its associated trait. Additionally, update `client.rs` to remove all dependencies and usages related to `OllamaClient`. Ensure the logic still supports OpenAI models, maintaining compatibility. This cleanup optimizes the code by eliminating unnecessary components and streamlining model availability checks. * Refactor `truncate_to_fit` function for improved token handling Enhance the `truncate_to_fit` function by adjusting the line retention strategies based on the attempt count. Implement logic to minimize output size progressively with retries, ensuring that the final result adheres to the specified maximum token limit. Return a minimal version of content if all truncation attempts fail, or a truncation message if content is too large. * Fix redundant line in truncate_to_fit function by removing duplicate halving of current_size * Add .cursorignore file to exclude target, tmp, .DS_Store, and .git from cursor operations. * ``` Rename function `get_instruction_token_count` to `create_commit_request` in `commit.rs` Remove the `prompt`, `file_context`, `author`, and `date` parameters from `generate_commit_message` in `openai.rs` ``` * Update prompt file by adding 30 new lines of content - Based only on the changes visible in the diff, this commit adds a significant amount of new content to the prompt.md file. * Remove 'assert_matches' feature flag from hook module Based only on the changes visible in the diff, this commit removes the '#![feature(assert_matches)]' line from the prompt.md file. * Remove lines 43-42 from prompt.md --- Add two lines at the end of prompt.md for additional context --- Add two lines at the end of rust.yml for unspecified purpose * Remove unused 'mod common;' declaration from patch test file * "Update Cargo.toml, commit.rs, Cargo.lock, and prompt.md files to incorporate 'mustache' dependency and enhance commit request creation" * "Refactor commit.rs to use mustache for template rendering and error handling" * Remove commit message scoring and prompt optimization functions in openai.rs * Update the 'get_instruction_template' and 'create_commit_request' functions in commit.rs and modify prompt.md * Remove prompt instruction lines from resources/prompt.md file --------- Co-authored-by: Git AI Test <test@example.com>
- Loading branch information