KeyLLM seems to use OpenAI parameters that are deprecated
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 4.2k
- Forks
- 385
- PR merge metrics
- No merged PRs in 30d
Description
First of all, this tool is amazing :-)
I'm trying to use keyLLM using OpenAI API, but when I import the OpenAI module from keybert, I cannot not noticed that the default parameters look having quite old defaults, something like "gpt-3.5-instruct".
The code is something like this:
```python
from keybert.llm import OpenAI
lc_chatgpt = OpenAI(model="gpt-3.5-turbo")
kw_model = KeyLLM(llm=lc_chatgpt)
[...]
keywords_abstracts = kw_model.extract_keywords(abstracts, embeddings=embeddings_abstracts, threshold=0.9)
```
When trying following your instructions I get a deprecation error:
```
openai.lib._old_api.APIRemovedInV1:
You tried to access openai.Completion, but this is no longer supported in openai>=1.0.0 - see the README at https://github.com/openai/openai-python for the API.
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`
A detailed migration guide is available here: https://github.com/openai/openai-python/discussions/742
```
here the libraries versions:
```
openai 1.3.3
keybert 0.8.3
```
Thank you in advance
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the keybert.llm.OpenAI entry point and reproduce the failure with openai 1.3.3 and KeyBERT 0.8.3. Compare the current OpenAI integration with the supported OpenAI 1.x interface, then verify that keyword extraction no longer raises APIRemovedInV1.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100