MaartenGr / MaartenGr/BERTopic
Enabling AsyncOpenai client
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 7.8k
- Forks
- 920
- Avg merge
- 22h 24m
- Merged PRs (30d)
- 5
Description
Hi @MaartenGr!
As far as I know, the package does not support the [async OpenAI client](https://github.com/openai/openai-python?tab=readme-ov-file#async-usage) for generating fine-tuned topic representations. Having the option to generate these representations concurrently would greatly speed up this part of the pipeline.
Implementation-wise, we could check whether the client is synchronous (`openai.OpenAI`) or asynchronous (`openai.AsyncOpenAI`) and then having slightly different subroutines for both clients. Main thing would be to run `asyncio.gather` for the async subroutine to allow concurrent requests.
What are your thoughts on this?
Contributor guide
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 by locating the code that generates fine-tuned topic representations and the current synchronous OpenAI client usage. Review the linked OpenAI async-usage documentation, then determine how both synchronous and asynchronous clients should be supported; done means asynchronous requests can run concurrently without removing synchronous support.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100