Update app.py
Browse files
app.py
CHANGED
|
@@ -274,7 +274,7 @@ def translate_text(text_prompt, target_language):
|
|
| 274 |
def chat_avatar(text_prompt):
|
| 275 |
response = client.chat.completions.create(
|
| 276 |
model="gpt-4o-mini",
|
| 277 |
-
messages=[{"role": "system", "content": "You are an interactive, conversational and helpful chatbot. Your role is to assist users by providing clear, engaging, and relevant answers using bare minimum words. Your answer doesn't have to be a complete one line.
|
| 278 |
{"role": "user", "content": f"Hi! I need help with something. Can you assist me with the following: {text_prompt}"},
|
| 279 |
],
|
| 280 |
max_tokens = len(text_prompt) + 300 # Use the length of the input text
|
|
|
|
| 274 |
def chat_avatar(text_prompt):
|
| 275 |
response = client.chat.completions.create(
|
| 276 |
model="gpt-4o-mini",
|
| 277 |
+
messages=[{"role": "system", "content": "You are an interactive, conversational and helpful chatbot. Your role is to assist users by providing clear, engaging, and relevant answers using bare minimum words. Your answer doesn't have to be a complete one line. Do not repeat the question in your response. Provide only the answer. Example: For 'What is 1+1?', respond '2'. Regardless of the language used by the user, you should always respond in English."},
|
| 278 |
{"role": "user", "content": f"Hi! I need help with something. Can you assist me with the following: {text_prompt}"},
|
| 279 |
],
|
| 280 |
max_tokens = len(text_prompt) + 300 # Use the length of the input text
|