Skip to content

Commit

Permalink
Update OpenAI API response (#213)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucafirefox authored Mar 21, 2024
1 parent f9e0e4a commit c886ee6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion keybert/llm/_openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,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)

Expand Down

0 comments on commit c886ee6

Please sign in to comment.