Skip to content

Commit c1cead0

Browse files
authored
Merge pull request #982 from ScrapeGraphAI/pre/beta
Pre/beta
2 parents 68bb34c + 77d4432 commit c1cead0

File tree

6 files changed

+64
-8
lines changed

6 files changed

+64
-8
lines changed

CHANGELOG.md

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,39 @@
1-
## [1.53.0](https://github.com/ScrapeGraphAI/Scrapegraph-ai/compare/v1.52.0...v1.53.0) (2025-06-04)
1+
## [1.54.0-beta.1](https://github.com/ScrapeGraphAI/Scrapegraph-ai/compare/v1.53.0...v1.54.0-beta.1) (2025-06-06)
22

33

44
### Features
55

6-
* enhanced readme call to action ([c23e3b7](https://github.com/ScrapeGraphAI/Scrapegraph-ai/commit/c23e3b7abce03e1e02b41d0cbb7108a9a92768f2))
6+
* add grok integration ([0c476a4](https://github.com/ScrapeGraphAI/Scrapegraph-ai/commit/0c476a4a7bbbec3883f505cd47bcffdcd2d9e5fd))
77

8-
## [1.52.0](https://github.com/ScrapeGraphAI/Scrapegraph-ai/compare/v1.51.0...v1.52.0) (2025-05-23)
8+
9+
### Bug Fixes
10+
11+
* grok integration and add new grok models ([3f18272](https://github.com/ScrapeGraphAI/Scrapegraph-ai/commit/3f1827274c60a2729233577666d2fa446c48c4ba))
12+
13+
14+
### chore
15+
16+
* enhanced a readme ([68bb34c](https://github.com/ScrapeGraphAI/Scrapegraph-ai/commit/68bb34cc5e63b8a1d5acc61b9b61f9ea716a2a51))
17+
18+
19+
### CI
20+
21+
* **release:** 1.52.0-beta.1 [skip ci] ([7adb0f1](https://github.com/ScrapeGraphAI/Scrapegraph-ai/commit/7adb0f1df1efc4e6ada1134f6e53e4d6b072a608))
22+
* **release:** 1.52.0-beta.2 [skip ci] ([386b46a](https://github.com/ScrapeGraphAI/Scrapegraph-ai/commit/386b46a8692c8c18000bb071fc8f312adc3ad05e))
23+
24+
## [1.52.0-beta.2](https://github.com/ScrapeGraphAI/Scrapegraph-ai/compare/v1.52.0-beta.1...v1.52.0-beta.2) (2025-06-04)
25+
26+
27+
### Bug Fixes
28+
29+
* grok integration and add new grok models ([3f18272](https://github.com/ScrapeGraphAI/Scrapegraph-ai/commit/3f1827274c60a2729233577666d2fa446c48c4ba))
30+
31+
## [1.52.0-beta.1](https://github.com/ScrapeGraphAI/Scrapegraph-ai/compare/v1.51.0...v1.52.0-beta.1) (2025-05-30)
932

1033

1134
### Features
1235

13-
* add new models ([8e706d4](https://github.com/ScrapeGraphAI/Scrapegraph-ai/commit/8e706d43efb7d525dffc616731ee7448b1046db0))
36+
* add grok integration ([0c476a4](https://github.com/ScrapeGraphAI/Scrapegraph-ai/commit/0c476a4a7bbbec3883f505cd47bcffdcd2d9e5fd))
1437

1538

1639
### CI

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[project]
22
name = "scrapegraphai"
33

4-
version = "1.53.0"
4+
version = "1.54.0b1"
55

66
description = "A web scraping library based on LangChain which uses LLM and direct graph logic to create scraping pipelines."
77
authors = [

scrapegraphai/graphs/abstract_graph.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from pydantic import BaseModel
1414

1515
from ..helpers import models_tokens
16-
from ..models import CLoD, DeepSeek, OneApi
16+
from ..models import CLoD, DeepSeek, OneApi, XAI
1717
from ..utils.logging import set_verbosity_info, set_verbosity_warning
1818

1919

@@ -163,6 +163,7 @@ def _create_llm(self, llm_config: dict) -> object:
163163
"fireworks",
164164
"clod",
165165
"togetherai",
166+
"xai",
166167
}
167168

168169
if "/" in llm_params["model"]:
@@ -217,6 +218,7 @@ def _create_llm(self, llm_config: dict) -> object:
217218
"deepseek",
218219
"togetherai",
219220
"clod",
221+
"xai",
220222
}:
221223
if llm_params["model_provider"] == "bedrock":
222224
llm_params["model_kwargs"] = {
@@ -242,6 +244,9 @@ def _create_llm(self, llm_config: dict) -> object:
242244
elif model_provider == "oneapi":
243245
return OneApi(**llm_params)
244246

247+
elif model_provider == "xai":
248+
return XAI(**llm_params)
249+
245250
elif model_provider == "togetherai":
246251
try:
247252
from langchain_together import ChatTogether

scrapegraphai/helpers/models_tokens.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@
150150
"llama3-70b-8192": 8192,
151151
"mixtral-8x7b-32768": 32768,
152152
"gemma-7b-it": 8192,
153-
"claude-3-haiku-20240307'": 8192,
153+
"claude-3-haiku-20240307": 8192,
154154
},
155155
"toghetherai": {
156156
"meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo": 128000,
@@ -306,4 +306,9 @@
306306
"grok-2-latest": 128000,
307307
},
308308
"togetherai": {"Meta-Llama-3.1-70B-Instruct-Turbo": 128000},
309+
"xai": {
310+
"grok-1": 8192,
311+
"grok-3": 128000,
312+
"grok-3-mini": 128000,
313+
},
309314
}

scrapegraphai/models/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@
77
from .oneapi import OneApi
88
from .openai_itt import OpenAIImageToText
99
from .openai_tts import OpenAITextToSpeech
10+
from .xai import XAI
1011

11-
__all__ = ["DeepSeek", "OneApi", "OpenAIImageToText", "OpenAITextToSpeech", "CLoD"]
12+
__all__ = ["DeepSeek", "OneApi", "OpenAIImageToText", "OpenAITextToSpeech", "CLoD", "XAI"]

scrapegraphai/models/xai.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
"""
2+
xAI Grok Module
3+
"""
4+
from langchain_openai import ChatOpenAI
5+
6+
7+
class XAI(ChatOpenAI):
8+
"""
9+
A wrapper for the ChatOpenAI class (xAI uses an OpenAI-compatible API) that
10+
provides default configuration and could be extended with additional methods
11+
if needed.
12+
13+
Args:
14+
llm_config (dict): Configuration parameters for the language model.
15+
"""
16+
17+
def __init__(self, **llm_config):
18+
if "api_key" in llm_config:
19+
llm_config["openai_api_key"] = llm_config.pop("api_key")
20+
llm_config["openai_api_base"] = "https://api.x.ai/v1"
21+
22+
super().__init__(**llm_config)

0 commit comments

Comments
 (0)