Skip to content

Commit

Permalink
feat: format meta response as monospaced text
Browse files Browse the repository at this point in the history
  • Loading branch information
F33RNI committed Apr 2, 2024
1 parent 80ef5dd commit 44e46e3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/lmao/ms_copilot/ms_copilot_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,14 @@ def _code_language_callback(element_) -> str or None:

# Fix no text by using meta or empty string
if not response_text:
response_text = response.get("meta", "")
meta_response = response.get("meta")

# Format meta as monospaced text
if meta_response and convert_to_markdown:
meta_response = f"`{meta_response}`"

# Use meta response or empty text
response_text = meta_response if meta_response else ""

response_parsed["response"] = response_text.strip()

Expand Down

0 comments on commit 44e46e3

Please sign in to comment.