Skip to content

Commit

Permalink
Chat GPT: Add system content to the model
Browse files Browse the repository at this point in the history
  • Loading branch information
VesnaT committed Aug 24, 2023
1 parent a2782e4 commit f4921c1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion orangecontrib/prototypes/widgets/owchatgpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ def run_gpt(
content = f"{prompt_start}\n{text}.\n{prompt_end}"
response = openai.ChatCompletion.create(
model=model,
messages=[{"role": "user", "content": content}]
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": content},
]
)
return response.choices[0].message.content

Expand Down

0 comments on commit f4921c1

Please sign in to comment.