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

Automatically sanitize input sent to copilot API #467

Merged
merged 1 commit into from
Nov 12, 2024

Conversation

deathbeam
Copy link
Collaborator

@deathbeam deathbeam commented Nov 10, 2024

Removes all non-standard characters to avoid issues with copilot API (especially claude).

Closes #464

@GitMurf
Copy link
Contributor

GitMurf commented Nov 10, 2024

One thought @deathbeam is that maybe we want to make this a config option to opt into? or at least have a way to disable if there is a reason a user wants to send icons / emojis. For example, I actually do sometimes ask about emojis / icons for different configs for neovim plugins (and for other similar stuff). "Can you provide me some alternative icons or emojis for 📣 ?"

Another thought is that I have NEVER experienced this with any other model other than Claude. So my proposal would be that this sanitization is only done for claude (at least to start). You then could probably get away with not providing the suggested config item above if it was a documented requirement for Claude due to its issues with certain characters. Although I would still recommend a config item so that users aren't caught off guard why all the sudden certain characters are being removed "randomly".

Lastly I have no clue, but would this affect other non english languages in more significant ways (again why I would suggest a config item)?

@deathbeam
Copy link
Collaborator Author

I dont like config option for something that just breaks the API. Like if the API do not works with some emojis then enabling asking about them doesnt rly achieve anything either right. But I guess we can just limit it to claude as other models dont have this issue. Also good point about other languages as I guess this would also filter out chinese and other characters.

Removes all non-standard characters to avoid issues with copilot API
(especially claude).

Possibly related: CopilotC-Nvim#464

Signed-off-by: Tomas Slusny <[email protected]>
@GitMurf
Copy link
Contributor

GitMurf commented Nov 11, 2024

I dont like config option for something that just breaks the API. Like if the API do not works with some emojis then enabling asking about them doesnt rly achieve anything either right. But I guess we can just limit it to claude as other models dont have this issue. Also good point about other languages as I guess this would also filter out chinese and other characters.

Yeah then if someone has an issue with characters they need (or language) then the solution can be to just use a non Claude model.

@deathbeam deathbeam merged commit ec9c848 into CopilotC-Nvim:canary Nov 12, 2024
1 check passed
@deathbeam deathbeam deleted the sanitize branch November 12, 2024 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

claude-3.5-sonnet returns 500 on some special unicode characters
2 participants