gorilla-llm / gorilla-cli

LLMs for your CLI
https://gorilla.cs.berkeley.edu/
Apache License 2.0
1.22k stars 73 forks source link

Fix for issue #17 - Add Check For Gorilla Emoji Encoding Support #18

Closed Fthree closed 11 months ago

Fthree commented 11 months ago

Description This pull request introduces a mechanism to detect whether the gorilla emoji ("🦍") is supported in the current system's encoding (e.g., cp1252). If supported, the emoji is included in specific strings within the application; otherwise, it is omitted.

Changes Added Function to Check Emoji Encoding: Created a function try_encode_gorilla in the go_questionary.util package that checks whether the gorilla emoji can be encoded in the current system. Conditional Emoji Inclusion: Utilized the encoding check function to conditionally include the gorilla emoji in various strings, such as welcome messages and loading indicators. Code Refactoring: Simplified the code related to emoji handling, enhancing readability and maintainability.

Motivation This change ensures that the application behaves consistently across different systems and environments, particularly those that may not support certain Unicode characters. It prevents encoding errors that could lead to crashes or other unexpected behaviors.