Open
Description
- I have looked for existing issues (including closed) about this
Feature Request
- Split up openai into multiple modules
- Refactor openai to make reuse much simpler and easier for alternative clients
Motivation
- Some providers such as openai have grown fairly complex and should be split up into multiple files.
- Other providers which are based on openai have varying amount of code duplication which leads to bug duplication with replicating fixes and improvements, esp. to openai.
Note
- Perhaps openai can have provider traits?
- Reusing
Message
is usually the easiest amongst the openai compatible - Reusing
CompletionRequest
is the best but unreasonable for those who have excess data- Perhaps,
#[serde(flatten)]
can be used for superset?
- Perhaps,
- The base
completion
implementation needs to refer to some standard parsing structure for atleast the message handling- Helper method in
openai
module?
- Helper method in
- Consider multiple PRs: 1 for splitting up
openai
, another for each provider!