Skip to content

Commit

Permalink
Merge pull request #146 from bptlab/hotfix/prompts-to-database
Browse files Browse the repository at this point in the history
Hotfix/prompts to database
  • Loading branch information
PitButtchereit authored May 31, 2024
2 parents ebfd57a + afb7998 commit a9eb6f2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
Binary file modified tracex_project/db.sqlite3
Binary file not shown.
15 changes: 3 additions & 12 deletions tracex_project/patient_journey_generator/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,8 @@ def get_date(start="01/01/2020", end="01/09/2023"):

def get_life_circumstances(sex):
"""Generate life circumstances by using the OpenAI API."""
message = [
{
"role": "user",
"content": f"Please give me a short description of the life circumstances of an imaginary {sex} "
+ "person in form of continuous text."
+ """Please give me a short description of the life circumstances of an imaginary person in form
of continuous text. Write the text from a second-person perspective. Something like "You are a
51-year-old Teacher" and so forth. Include the age, the job and the family status. Please do not
include more than 50 words.""",
}
]
life_circumstances = u.query_gpt(messages=message, max_tokens=100, temperature=1)
messages = Prompt.objects.get(name="CREATE_PATIENT_JOURNEY_LIFE_CIRCUMSTANCES").text
messages[0]["content"] = messages[0]["content"].replace("<SEX>", sex)
life_circumstances = u.query_gpt(messages=messages, max_tokens=100, temperature=1)

return life_circumstances

0 comments on commit a9eb6f2

Please sign in to comment.