Translation

prompt = f"""
Translate the following English text to Spanish: \\ 
```Hi, I would like to order a blender```
"""

prompt = f"""
Tell me which language this is: 
```Combien coûte le lampadaire?```
"""

prompt = f"""
Translate the following  text to French and Spanish
and English pirate: \\
```I want to order a basketball```
"""

prompt = f"""
Translate the following text to Spanish in both the \\
formal and informal forms: 
'Would you like to order a pillow?'
"""

Universal Translator

Imagine you are in charge of IT at a large multinational e-commerce company. Users are messaging you with IT issues in all their native languages. Your staff is from all over the world and speaks only their native languages. You need a universal translator!

user_messages = [
  "La performance du système est plus lente que d'habitude.",  # System performance is slower than normal         
  "Mi monitor tiene píxeles que no se iluminan.",              # My monitor has pixels that are not lighting
  "Il mio mouse non funziona",                                 # My mouse is not working
  "Mój klawisz Ctrl jest zepsuty",                             # My keyboard has a broken control key
  "我的屏幕在闪烁"                                               # My screen is flashing
]

for issue in user_messages:
    prompt = f"Tell me what language this is: ```{issue}```"
    lang = get_completion(prompt)
    print(f"Original message ({lang}): {issue}")

    prompt = f"""
    Translate the following  text to English \\
    and Korean: ```{issue}```
    """
    response = get_completion(prompt)
    print(response, "\\n")

Tone Transformation

prompt = f"""
Translate the following from slang to a business letter: 
'Dude, This is Joe, check out this spec on this standing lamp.'
"""

Format Conversion

data_json = { "resturant employees" :[ 
    {"name":"Shyam", "email":"[email protected]"},
    {"name":"Bob", "email":"[email protected]"},
    {"name":"Jai", "email":"[email protected]"}
]}

prompt = f"""
Translate the following python dictionary from JSON to an HTML \\
table with column headers and title: {data_json}
"""

Spellcheck / Grammar check

Here are some examples of common grammar and spelling problems and the LLM's response.

To signal to the LLM that you want it to proofread your text, you instruct the model to 'proofread' or 'proofread and correct'.

prompt = f"""Proofread and correct the following text
and rewrite the corrected version. If you don't find
and errors, just say "No errors found". Don't use 
any punctuation around the text:
```{t}```"""

prompt = f"proofread and correct this review: ```{text}```"

prompt = f"""
proofread and correct this review. Make it more compelling. 
Ensure it follows APA style guide and targets an advanced reader. 
Output in markdown format.
Text: ```{text}```
"""