m1guelpf / auto-commit

A CLI tool that automatically writes commit messages for you.
MIT License
1.2k stars 54 forks source link

How to reduce prompt/ completion length? #13

Closed metart43 closed 1 year ago

metart43 commented 1 year ago
auto-commit
Loading Data...
▗ Analyzing Codebase...thread 'main' panicked at 'Couldn't complete prompt.: Api(ErrorMessage { message: "This model's maximum context length is 8001 tokens, however you requested 11523 tokens (9523 in your prompt; 2000 for the completion). Please reduce your prompt; or completion length.", error_type: "invalid_request_error" })', src/main.rs:137:10
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
▖ Analyzing Codebase...%    

I assume my codebase && commit history is too big and exceeds open AI limitations. Is there a way to reduce codebase analysis?

metart43 commented 1 year ago

Nvmd, I just realised it's related to the number of changes you are trying to commit. All I did is reduced the number of changes I was under the impression that it analyses the entire codebase before running auto-commit