EF-AI-Co-Finder / simulator.py
Adr740's picture
Upload 6 files
d0a793d verified
raw
history blame
802 Bytes
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