Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -101,18 +101,16 @@ def get_chat_response(query: str, knowledge_base: dict) -> str:
|
|
101 |
client = get_openai_client()
|
102 |
|
103 |
# Generate response
|
104 |
-
response = client.
|
105 |
model="gpt-4o-mini",
|
106 |
-
messages=[
|
107 |
-
{"role": "system", "content": prompt},
|
108 |
-
{"role": "user", "content": query}
|
109 |
-
],
|
110 |
max_tokens=200,
|
111 |
-
temperature=0.7
|
|
|
|
|
112 |
)
|
113 |
|
114 |
# Extract and clean response
|
115 |
-
response_text = response.choices[0].
|
116 |
|
117 |
return response_text
|
118 |
|
|
|
101 |
client = get_openai_client()
|
102 |
|
103 |
# Generate response
|
104 |
+
response = client.create_completion(
|
105 |
model="gpt-4o-mini",
|
|
|
|
|
|
|
|
|
106 |
max_tokens=200,
|
107 |
+
temperature=0.7,
|
108 |
+
n=1,
|
109 |
+
stop=None
|
110 |
)
|
111 |
|
112 |
# Extract and clean response
|
113 |
+
response_text = response.choices[0].text.strip()
|
114 |
|
115 |
return response_text
|
116 |
|