Hello!
I don´t know if I’m posting in the correct comunity, but I’m taking the AI practice and I’m stucked at the 4th task. The task description is the following:
The xfusion AI Development Team is now exploring how artificial intelligence can assist in making smarter, data-driven decisions for cloud optimization.
Continuing this journey, you are tasked to build a Python-based AI module that compares chipset used between two major iPhone models.Inside compare.py, create an OpenAI client using the provided api_key and base_url under /root/.bash_profile.
Then, define a function named compare(item1: str, item2: str) → str that constructs a parameterized prompt asking the AI to compare the two given iPhone models (item1 and item2) in terms of only the chip used, ensuring the response is given in one word only.
Use the following items for comparison:
iphone 13
iphone 17After defining the function, send the constructed prompt to the OpenAI chat model using:
model: openai/gpt-4.1-mini
messages: user → prompt
max_tokens: 100
temperature: 0.5Store the result in a variable named response, and print the one-word comparison output to the console.
Finally, run your compare.py file to perform the chip comparison.
Notes: Function should accept two parameters: item1 and item2. Use the provided OpenAI api_key and base_url under /root/.bash_profile.
File compare.py must be inside /root/openaiproject.
Use hardcoded values for api_key and base_url when initializing the OpenAI client or read them from environment variables via os.environ.get(‘XXXXX’).
Before running the script run the following python commands to set up the environment and to install the openai:
You are allowed a maximum of 10 requests. After this, you may encounter a rate limiter error, so use your calls wisely.
No matter how I construct the prompt and, following the instructions, printing out a one word response, I’m getting the following task failuer message: “Output should include details for ‘iPhone 13’.”
No matter how I interpret this message, I ssee a conflict between the original instruction “one word only” and the checker feedback “output should include details for iPhone 13.”
Did anyone else faced this issue?
Thanks!