Spaces:
Sleeping
Sleeping
File size: 802 Bytes
d0a793d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
from tech_stuff import api_key
from cohort_members import cohort_data
from openai import OpenAI
client = OpenAI(api_key=api_key)
def simulate(profile_selector_1, profile_selector_2, system_prompt_input):
profile_1 = profile_selector_1 + cohort_data[profile_selector_1]
profile_2 = profile_selector_2 + cohort_data[profile_selector_2]
response = client.chat.completions.create(
model="gpt-4",
messages=[
{
"role": "system",
"content": system_prompt_input},
{
"role": "user",
"content": f"Profile 1:\n\n{profile_1}\n\n-------------\n\nProfile 2:\n\n{profile_2}"
}
],
temperature=1,
max_tokens=3456,
top_p=1,
frequency_penalty=0,
presence_penalty=0
).choices[0].message.content
return response |