diff --git a/keybert/llm/_openai.py b/keybert/llm/_openai.py index 5c8c078c..f5c0bdc0 100644 --- a/keybert/llm/_openai.py +++ b/keybert/llm/_openai.py @@ -186,7 +186,7 @@ def extract_keywords(self, documents: List[str], candidate_keywords: List[List[s response = completions_with_backoff(self.client, model=self.model, prompt=prompt, **self.generator_kwargs) else: response = self.client.completions.create(model=self.model, prompt=prompt, **self.generator_kwargs) - keywords = response.choices[0].message.content.strip() + keywords = response.choices[0].text.strip() keywords = [keyword.strip() for keyword in keywords.split(",")] all_keywords.append(keywords)