Skip to content

Commit f43a9b3

Browse files
committed
add temprature to llm
1 parent 77dad9b commit f43a9b3

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

src/llm.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,24 @@
1616
api_key="token",
1717
)
1818

19-
def get_llm_reply(prompt):
20-
completion = llm_client.chat.completions.create(
21-
model=LLM_MODEL_NAME,
22-
messages=[
23-
{"role": "user", "content": prompt}
24-
]
25-
)
26-
return completion.choices[0].message.content
19+
def get_llm_reply(prompt, temperature=0):
20+
completion = llm_client.chat.completions.create(
21+
model=LLM_MODEL_NAME,
22+
messages=[
23+
{"role": "user", "content": prompt}
24+
],
25+
temperature=temperature,
26+
)
27+
return completion.choices[0].message.content
2728

2829
"""
2930
Get list of statements from input.
3031
"""
3132
def get_statements(input):
3233
system_message = '''You are a helpful AI assistant.
3334
Solve tasks using your fact extraction skills.
34-
Extract key facts from the given content.
35-
Provide a list of the facts in array format as response only.'''
35+
Extract key statements from the given content.
36+
Provide in array format as response only.'''
3637

3738
prompt = f'''{system_message}
3839
```

0 commit comments

Comments
 (0)