Hi,
I am getting the below error and not getting the expected output:
1 prompt = f"“”
2 Your task is to help a marketing team create a
3 description for a retail website of a product based
4 on a technical fact sheet.
5
6 Write a product description based on the information
7 provided in the technical specifications delimited by
8 triple backticks.
9
10 Use at most 50 words.
11
—> 12 Technical specifications: {fact_sheet_chair}
13 “”"
14 response = get_completion(prompt)
15 print(response)
NameError: name ‘fact_sheet_chair’ is not defined
when trying the below prompt for the fact_sheet_chair product description:
prompt = f"“”
Your task is to help a marketing team create a
description for a retail website of a product based
on a technical fact sheet.
Write a product description based on the information
provided in the technical specifications delimited by
triple backticks.
Use at most 50 words.
Technical specifications: {fact_sheet_chair}
“”"
response = get_completion(prompt)
print(response)
Getting the below error too:
Cell In[7], line 12
1 prompt = f"“”
2 Your task is to help a marketing team create a
3 description for a retail website of a product based
(…)
10 Technical specifications: {fact_sheet_chair}
11 “”"
—> 12 response = get_completion(prompt)
13 print(response)
Cell In[2], line 3, in get_completion(prompt, model)
1 def get_completion(prompt, model=“gpt-3.5-turbo”):
2 messages = [{“role”: “user”, “content”: prompt}]
----> 3 response = openai.ChatCompletion.create(
4 model=model,
5 messages=messages,
6 temperature=0, # this is the degree of randomness of the model’s output
7 )
8 return response.choices[0].message[“content”]
File ~\AppData\Local\Programs\Python\Python312\Lib\site-packages\openai\lib_old_api.py:39, in APIRemovedInV1Proxy.call(self, *_args, **_kwargs)
38 def call(self, *_args: Any, **_kwargs: Any) → Any:
—> 39 raise APIRemovedInV1(symbol=self._symbol)
APIRemovedInV1:
You tried to access openai.ChatCompletion, but this is no longer supported in openai>=1.0.0 -
You can run openai migrate
to automatically upgrade your codebase to use the 1.0.0 interface.
Alternatively, you can pin your installation to the old version, e.g. pip install openai==0.28