Changelog
-
Created
LLM
class which serves as a wrapper for OpenAI's ChatGPT and Hugging Face's language models. -
Added optional parameters
openai_api_key
,hf_repo_id
,hf_api_token
, andmodel_kwargs
to theLLM
class. -
Introduced logic to switch between OpenAI's ChatGPT and Hugging Face's language models based on the provided optional parameters.
-
Improved error handling in the
LLM
class. The class now raises aValueError
if neitheropenai_api_key
norhf_repo_id
are provided. It also checks for the presence ofHUGGINGFACEHUB_API_TOKEN
in the environment variables. -
Improved modularity in the
LLM
class. Added the ability for the user to provide their own model parameters through themodel_kwargs
parameter. -
Updated
LLM
class to be shapeless, allowing users to provide their inputs in any shape they wish. -
Updated the error handling system to provide detailed error messages and log exceptions.
-
Created a comprehensive suite of unit tests for the
LLM
class to ensure robustness and reliability of the code. -
Tests cover initializations, proper usage of underlying models, error handling for missing parameters, and environment variable checks.
Please note that this changelog reflects the changes made during our interactions and your instructions. The versioning is arbitrary and for the purpose of this demonstration only. In a real-world scenario, versioning would likely be more granular and follow semantic versioning principles.