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

Strip code snippets through a client interface #1227

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jhrozek
Copy link
Contributor

@jhrozek jhrozek commented Mar 5, 2025

Different clients need different ways of stripping away the context in
order to analyze just the human text in the user message. Let's start
with this as the first method of a client interface.

Related: #831

Different clients need different ways of stripping away the context in
order to analyze just the human text in the user message. Let's start
with this as the first method of a client interface.

Related: #831
@jhrozek
Copy link
Contributor Author

jhrozek commented Mar 5, 2025

I have additional patches that move the cli pipeline step to this interface but I don't want to cause more chaos and rebasing at this moment and make the rebase of the litellm-less branch easier.

Comment on lines +35 to +41
class ClineClient(ClientInterface):
"""Cline-specific client interface"""

_CLINE_FILE_REGEX = re.compile(
r"(?i)<\s*file_content\s*[^>]*>.*?</\s*file_content\s*>", re.DOTALL
)

Copy link
Contributor

Choose a reason for hiding this comment

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

This seems similar to the regex and functionality we have in message_extractor.py. Could we reuse that? It's just a thought.. feel free to disregard the comment if you think it's too hard or doesn't make sense

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah, this is great. I guess we can at least move the regexes to the same interface or unify them.

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.

3 participants