Closed vblagoje closed 9 months ago
@vblagoje do you think changing the file name will also be required as these functions are inside openai.py?
Hmm, good point @sahusiddharth - I'll consult internally with my colleagues but my guess is that since we export both classes in generators and generators.chat modules - I don't think it is necessary. Will confirm.
Summary
We propose renaming
GPTGenerator
andGPTChatGenerator
toCompletionGenerator
andChatCompletionGenerator
, respectively. This change aims to reflect the increasing adoption of the underlying format and chat completion openai library by various providers like deepinfra.com, together.ai, and anyscale, among others.Background
Our current implementation utilizes
GPTGenerator
for supporting non-chat OpenAI models andGPTChatGenerator
for chat-based models. However, the landscape of language models and their integrations has evolved significantly. Providers such as deepinfra, together.ai, and anyscale are deploying diverse models that utilize the same python library and message format originally popularized by OpenAI.The current naming of
GPTGenerator
andGPTChatGenerator
implicitly suggests that these components are exclusive to GPT models or OpenAI's platform. This naming convention could be misleading and restrictive as the components are now more universally applicable.Proposed Solution
We suggest renaming:
GPTGenerator
toCompletionGenerator
GPTChatGenerator
toChatCompletionGenerator
This renaming will more accurately represent the functionality of these components as they are now used to interface with a variety of models across different platforms. It will also enhance clarity and inclusivity for users who are working with models from providers other than OpenAI.
The change primarily involves renaming the components. Users will be able to leverage these renamed components (
CompletionGenerator
andChatCompletionGenerator
) to interact with different models by simply setting parameters likemodel_name
andapi_base_url
. This update ensures compatibility and extends the usability of our toolset across a broader range of platforms and models.Deprecation plan
We can maintain references to original class names, redirecting to the new CompletionGenerator and ChatCompletionGenerator classes, respectively. This transitional phase will ensure backward compatibility and minimize disruption for current users.