Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: FIM not caching correctly non-python files #408

Merged
merged 2 commits into from
Dec 19, 2024

Conversation

aponcedeleonch
Copy link
Contributor

Closes: #405

The implemented cache was not working correctly because of the way the context is added for FIM requests in other programming languages which are not python. The context for the LLM is provided as single line comments. In Python this means lines which start with the character #. Other languages may have other starting sequence for single line comments, e.g. Javascript uses //. This PR changes the regex to detect the paths for other languages.

jhrozek
jhrozek previously approved these changes Dec 18, 2024
Copy link
Contributor

@jhrozek jhrozek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some nits here and there but looks good

src/codegate/db/fim_cache.py Outdated Show resolved Hide resolved
src/codegate/db/fim_cache.py Show resolved Hide resolved
src/codegate/db/fim_cache.py Outdated Show resolved Hide resolved
src/codegate/db/fim_cache.py Show resolved Hide resolved
Closes: #405

The implemented cache was not working correctly because of the
way the context is added for FIM requests in other programming
languages which are not python. The context for the LLM is provided
as single line comments. In Python this means lines which start with
the character `#`. Other languages may have other starting sequence
for single line comments, e.g. Javascript uses `//`. This PR changes
the regex to detect the paths for other languages.
@aponcedeleonch aponcedeleonch merged commit 9c57e92 into main Dec 19, 2024
3 checks passed
@aponcedeleonch aponcedeleonch deleted the cachce-non-python-fim-reqs branch December 19, 2024 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FIM not caching correctly JS files
2 participants