Spaces:
Sleeping
Sleeping
Ilyas KHIAT
commited on
Commit
·
3186d0c
1
Parent(s):
9a4c626
style and ton
Browse files
main.py
CHANGED
|
@@ -146,7 +146,10 @@ def generate_answer(user_input: UserInput):
|
|
| 146 |
if not context:
|
| 147 |
context = "No context found"
|
| 148 |
|
| 149 |
-
|
|
|
|
|
|
|
|
|
|
| 150 |
|
| 151 |
if user_input.stream:
|
| 152 |
return StreamingResponse(answer, media_type="application/json")
|
|
|
|
| 146 |
if not context:
|
| 147 |
context = "No context found"
|
| 148 |
|
| 149 |
+
if user_input.style_tonality is None:
|
| 150 |
+
answer = generate_response_via_langchain(prompt, model="gpt-4o",stream=user_input.stream,context = context , messages=user_input.messages)
|
| 151 |
+
else:
|
| 152 |
+
answer = generate_response_via_langchain(prompt, model="gpt-4o",stream=user_input.stream,context = context , messages=user_input.messages,style=user_input.style_tonality.style,tonality=user_input.style_tonality.tonality)
|
| 153 |
|
| 154 |
if user_input.stream:
|
| 155 |
return StreamingResponse(answer, media_type="application/json")
|