|
| 1 | +from tests.settings import ROOT_DIR |
| 2 | +from openai import OpenAI |
| 3 | + |
| 4 | + |
| 5 | +def test_response_shows_developer_names(): |
| 6 | + client = OpenAI() |
| 7 | + assert client is not None |
| 8 | + |
| 9 | + system_prompt = f""" |
| 10 | + You will get a description of a project, and your task is to tell me the best developers from the given list for the project |
| 11 | + based on their skills. |
| 12 | + Today's date is April 15th, 2025. |
| 13 | + Pick only developers who are available after the project start date. Pick people with higher skill levels first. |
| 14 | +
|
| 15 | + Here is the skills data: |
| 16 | + Sam Thomas - iOS, Swift, Objective-C |
| 17 | + Drew Anderson - iOS, Swift, Objective-C, on vacation June 1st - June 10th |
| 18 | + Joe Smith - Android |
| 19 | + Robert Sanders - React Native |
| 20 | + |
| 21 | + Do not show your thinking, just return the list of recommended developers. |
| 22 | + """ |
| 23 | + |
| 24 | + project_description = """ |
| 25 | + This is a mobile iOS project for a telecom company. The project starts June 3rd. |
| 26 | + It will find exciting moments from sports highlights videos. The app should only work on iPhone, not iPad. |
| 27 | + The tech stack is iOS Native. |
| 28 | + """ |
| 29 | + completion = client.chat.completions.create( |
| 30 | + model="gpt-4o", |
| 31 | + messages=[ |
| 32 | + {"role": "system", "content": system_prompt}, |
| 33 | + {"role": "user", "content": project_description}, |
| 34 | + ], |
| 35 | + ) |
| 36 | + response = completion.choices[0].message.content |
| 37 | + print(response) |
| 38 | + assert "Sam Thomas" in response |
| 39 | + for name in ["Drew Anderson", "Joe Smith", "Robert Sanders"]: |
| 40 | + assert name not in response |
0 commit comments