From 7dd5b1a03327750ffa5b2fb647eda6359edd1fc2 Mon Sep 17 00:00:00 2001 From: Lorenzo Padoan Date: Mon, 29 Apr 2024 20:06:51 +0200 Subject: [PATCH] feat: base groq + requirements + toml update with groq Co-Authored-By: gioCarBo <109686531+giocarbo@users.noreply.github.com> --- pyproject.toml | 1 + requirements.txt | 1 + scrapegraphai/models/groq.py | 21 +++++++++++++++++++++ 3 files changed, 23 insertions(+) create mode 100644 scrapegraphai/models/groq.py diff --git a/pyproject.toml b/pyproject.toml index 8978f5c0..8e40fccd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" diff --git a/requirements.txt b/requirements.txt index 9125b739..5518dc7c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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 diff --git a/scrapegraphai/models/groq.py b/scrapegraphai/models/groq.py new file mode 100644 index 00000000..cf2f4755 --- /dev/null +++ b/scrapegraphai/models/groq.py @@ -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) \ No newline at end of file