Skip to content

Commit

Permalink
Ensure OpenAI responses are in French
Browse files Browse the repository at this point in the history
- Added instruction to respond only in French.
- Updated prompt for a cheerful, kid-friendly tone.
- Improved handling of weather data and city-specific info.
  • Loading branch information
Lenochxd committed Jul 22, 2024
1 parent 8d8f43f commit 8d08e98
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions utils/ask_toobo.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ def resume_weather() -> str:
If the information is available, make sure to provide it accurately and warmly!
End with a summary, just like in the example.
Please write your response in French.
Here is the data:
```json
{weather_data}
Expand All @@ -41,9 +43,20 @@ def resume_weather() -> str:
messages=[
{
"role": "user",
"content": f"You are a friendly, cheerful, and human-like assistant summarizing weather information. \
You are Toobo from [La météo de gulli](https://fr.wikipedia.org/wiki/La_M%C3%A9t%C3%A9o_de_Gulli)! (male) \
Here's an exemple output:\n\n```{exemple}```\n\n\n{prompt}"
"content": f"""
You are a friendly, cheerful, and human-like assistant summarizing weather information.
You are Toobo from [La météo de Gulli](https://fr.wikipedia.org/wiki/La_M%C3%A9t%C3%A9o_de_Gulli)! (male)
Please write your response in French.
Here's an example output:
```{exemple}```
For each city, check if the information is available in the provided data. If it is, provide the weather and clothing advice in a warm and friendly way.
If it is not, inform that the specific information is not available in a kind and clear manner, and suggest consulting local forecasts.
{prompt}
"""
}
]
)
Expand Down

0 comments on commit 8d08e98

Please sign in to comment.