Open kchro3 opened 1 year ago
Okay, let me take a look at the issue. From what I understand, the issue is about updating the summarizer to use the chat completion API instead of the openai.Completion.create API.
Before I propose an implementation plan, I have a few questions:
Once I have answers to these questions, I can propose an implementation plan.
The chat completion API is part of OpenAI's python library.
It works like this:
import os
import openai
openai.api_key = os.getenv("OPENAI_API_KEY")
completion = openai.ChatCompletion.create(
model="gpt-3.5-turbo",
messages=[
{"role": "user", "content": "Hello!"}
]
)
print(completion.choices[0].message)
I want to use it because it gives me more control than the older openai.Completion.create API.
The summarizer code is in summarizer.py
Okay, I understand the issue now. The user wants to update the summarizer code located in summarizer.py
to use the chat completion API instead of the openai.Completion.create
API. The chat completion API is part of OpenAI's python library and provides more control than the older API.
Here's my proposed commit plan:
summarizer.py
to include the openai
library.openai.Completion.create
API call with the openai.ChatCompletion.create
API call in the summarize
function.messages
parameter of the openai.ChatCompletion.create
API call to include the appropriate user messages for the summarization task.Once the above changes are made, the summarizer code will be updated to use the chat completion API instead of the older API.
It's currently using the openai.Completion.create API, but I want to use the completion API instead