Spaces:
Sleeping
Sleeping
Update llm/reasoning.py
Browse files- llm/reasoning.py +4 -9
llm/reasoning.py
CHANGED
|
@@ -7,20 +7,16 @@ from llm.prompts import reasoning_prompt
|
|
| 7 |
|
| 8 |
_client = get_llm_client()
|
| 9 |
|
| 10 |
-
|
| 11 |
def _call_llm(prompt: str) -> str:
|
| 12 |
-
"""
|
| 13 |
-
Lågnivå-anrop till LLM.
|
| 14 |
-
ALLA resonemang går via denna funktion.
|
| 15 |
-
"""
|
| 16 |
response = _client.chat_completion(
|
| 17 |
messages=[
|
| 18 |
{
|
| 19 |
"role": "system",
|
| 20 |
"content": (
|
| 21 |
-
"Du är en expertassistent
|
| 22 |
-
"
|
| 23 |
-
"
|
|
|
|
| 24 |
)
|
| 25 |
},
|
| 26 |
{
|
|
@@ -34,7 +30,6 @@ def _call_llm(prompt: str) -> str:
|
|
| 34 |
|
| 35 |
return response.choices[0].message["content"]
|
| 36 |
|
| 37 |
-
|
| 38 |
# =========================
|
| 39 |
# FÖRDEFINIERADE FRÅGOR
|
| 40 |
# =========================
|
|
|
|
| 7 |
|
| 8 |
_client = get_llm_client()
|
| 9 |
|
|
|
|
| 10 |
def _call_llm(prompt: str) -> str:
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
response = _client.chat_completion(
|
| 12 |
messages=[
|
| 13 |
{
|
| 14 |
"role": "system",
|
| 15 |
"content": (
|
| 16 |
+
"Du är en expertassistent.\n"
|
| 17 |
+
"Du ska ALLTID svara på svenska.\n"
|
| 18 |
+
"Du får endast använda information från det givna underlaget.\n"
|
| 19 |
+
"Du får inte tillföra ny fakta."
|
| 20 |
)
|
| 21 |
},
|
| 22 |
{
|
|
|
|
| 30 |
|
| 31 |
return response.choices[0].message["content"]
|
| 32 |
|
|
|
|
| 33 |
# =========================
|
| 34 |
# FÖRDEFINIERADE FRÅGOR
|
| 35 |
# =========================
|