Update app.py
Browse files
app.py
CHANGED
@@ -34,13 +34,16 @@ def respond(
|
|
34 |
response = ""
|
35 |
|
36 |
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
|
|
|
|
|
|
44 |
|
45 |
return response
|
46 |
|
|
|
34 |
response = ""
|
35 |
|
36 |
|
37 |
+
# Chama a API do modelo de linguagem para gerar a resposta
|
38 |
+
try:
|
39 |
+
response = client.chat_completion(
|
40 |
+
messages=messages,
|
41 |
+
max_tokens=max_tokens,
|
42 |
+
temperature=temperature,
|
43 |
+
top_p=top_p,
|
44 |
+
).choices[0].message.content
|
45 |
+
except Exception as e:
|
46 |
+
response = f"Error: {e}"
|
47 |
|
48 |
return response
|
49 |
|