feat: base groq + requirements + toml update with groq

Co-Authored-By: gioCarBo <109686531+giocarbo@users.noreply.github.com>
This commit is contained in:
Lorenzo Padoan 2024-04-29 20:06:51 +02:00
parent 0999708ff6
commit 7dd5b1a033
3 changed files with 23 additions and 0 deletions

View File

@ -38,6 +38,7 @@ graphviz = "0.20.1"
google = "3.0.0"
minify-html = "0.15.0"
free-proxy = "1.1.1"
langchain-groq = "0.1.3"
[tool.poetry.dev-dependencies]
pytest = "8.0.0"

View File

@ -11,3 +11,4 @@ python-dotenv==1.0.1
tiktoken>=0.5.2,<0.6.0
tqdm==4.66.1
minify-html==0.15.0
langchain-groq==0.1.3

View File

@ -0,0 +1,21 @@
"""
Groq module configuration
"""
from langchain_groq import ChatGroq
class Groq(ChatGroq):
"""Class for wrapping Groq module"""
def __init__(self, llm_config: dict):
"""
A wrapper for the Groq class that provides default configuration
and could be extended with additional methods if needed.
Args:
llm_config (dict): Configuration parameters for the language model.
such as model="llama3-70b-8192" and api_key
"""
# Initialize the superclass (ChatOpenAI) with provided config parameters
super().__init__(**llm_config)