dev-backpack / cllm

Empower your CLI experience with a command search tool driven by LLM magic!
https://dev-backpack.github.io/cllm/
MIT License
33 stars 0 forks source link

Fix intermittent appearance of "AI: " text by adding prompt and text slicing #19

Closed ykdy3951 closed 8 months ago

ykdy3951 commented 8 months ago

What type of PR is this?:

Bug

What this PR does / why we need it:

This PR addresses the issue of intermittent appearance of the text "AI: " by implementing a solution that involves adding a prompt and performing text slicing.

Which issue(s) this PR fixes:

Fixes #4

Special notes for your reviewer:

Currently, there is an issue where the text "AI: " intermittently appears in the output. This issue is caused by the model generating incomplete text outputs, which include the prompt "AI: ". To overcome this problem, we can add an explicit prompt at the beginning of each generation request. Additionally, we need to slice the generated text to exclude the prompt when returning the final output.

Does this PR introduce a user-facing change?

Additional documentation: