Skip to content

Pre/beta #982

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jun 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 27 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,39 @@
## [1.53.0](https://github.com/ScrapeGraphAI/Scrapegraph-ai/compare/v1.52.0...v1.53.0) (2025-06-04)
## [1.54.0-beta.1](https://github.com/ScrapeGraphAI/Scrapegraph-ai/compare/v1.53.0...v1.54.0-beta.1) (2025-06-06)


### Features

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

## [1.52.0](https://github.com/ScrapeGraphAI/Scrapegraph-ai/compare/v1.51.0...v1.52.0) (2025-05-23)

### Bug Fixes

* grok integration and add new grok models ([3f18272](https://github.com/ScrapeGraphAI/Scrapegraph-ai/commit/3f1827274c60a2729233577666d2fa446c48c4ba))


### chore

* enhanced a readme ([68bb34c](https://github.com/ScrapeGraphAI/Scrapegraph-ai/commit/68bb34cc5e63b8a1d5acc61b9b61f9ea716a2a51))


### CI

* **release:** 1.52.0-beta.1 [skip ci] ([7adb0f1](https://github.com/ScrapeGraphAI/Scrapegraph-ai/commit/7adb0f1df1efc4e6ada1134f6e53e4d6b072a608))
* **release:** 1.52.0-beta.2 [skip ci] ([386b46a](https://github.com/ScrapeGraphAI/Scrapegraph-ai/commit/386b46a8692c8c18000bb071fc8f312adc3ad05e))

## [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)


### Bug Fixes

* grok integration and add new grok models ([3f18272](https://github.com/ScrapeGraphAI/Scrapegraph-ai/commit/3f1827274c60a2729233577666d2fa446c48c4ba))

## [1.52.0-beta.1](https://github.com/ScrapeGraphAI/Scrapegraph-ai/compare/v1.51.0...v1.52.0-beta.1) (2025-05-30)


### Features

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


### CI
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[project]
name = "scrapegraphai"

version = "1.53.0"
version = "1.54.0b1"

description = "A web scraping library based on LangChain which uses LLM and direct graph logic to create scraping pipelines."
authors = [
Expand Down
7 changes: 6 additions & 1 deletion scrapegraphai/graphs/abstract_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from pydantic import BaseModel

from ..helpers import models_tokens
from ..models import CLoD, DeepSeek, OneApi
from ..models import CLoD, DeepSeek, OneApi, XAI
from ..utils.logging import set_verbosity_info, set_verbosity_warning


Expand Down Expand Up @@ -163,6 +163,7 @@ def _create_llm(self, llm_config: dict) -> object:
"fireworks",
"clod",
"togetherai",
"xai",
}

if "/" in llm_params["model"]:
Expand Down Expand Up @@ -217,6 +218,7 @@ def _create_llm(self, llm_config: dict) -> object:
"deepseek",
"togetherai",
"clod",
"xai",
}:
if llm_params["model_provider"] == "bedrock":
llm_params["model_kwargs"] = {
Expand All @@ -242,6 +244,9 @@ def _create_llm(self, llm_config: dict) -> object:
elif model_provider == "oneapi":
return OneApi(**llm_params)

elif model_provider == "xai":
return XAI(**llm_params)

elif model_provider == "togetherai":
try:
from langchain_together import ChatTogether
Expand Down
7 changes: 6 additions & 1 deletion scrapegraphai/helpers/models_tokens.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
"llama3-70b-8192": 8192,
"mixtral-8x7b-32768": 32768,
"gemma-7b-it": 8192,
"claude-3-haiku-20240307'": 8192,
"claude-3-haiku-20240307": 8192,
},
"toghetherai": {
"meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo": 128000,
Expand Down Expand Up @@ -306,4 +306,9 @@
"grok-2-latest": 128000,
},
"togetherai": {"Meta-Llama-3.1-70B-Instruct-Turbo": 128000},
"xai": {
"grok-1": 8192,
"grok-3": 128000,
"grok-3-mini": 128000,
},
}
3 changes: 2 additions & 1 deletion scrapegraphai/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
from .oneapi import OneApi
from .openai_itt import OpenAIImageToText
from .openai_tts import OpenAITextToSpeech
from .xai import XAI

__all__ = ["DeepSeek", "OneApi", "OpenAIImageToText", "OpenAITextToSpeech", "CLoD"]
__all__ = ["DeepSeek", "OneApi", "OpenAIImageToText", "OpenAITextToSpeech", "CLoD", "XAI"]
22 changes: 22 additions & 0 deletions scrapegraphai/models/xai.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
"""
xAI Grok Module
"""
from langchain_openai import ChatOpenAI


class XAI(ChatOpenAI):
"""
A wrapper for the ChatOpenAI class (xAI uses an OpenAI-compatible API) that
provides default configuration and could be extended with additional methods
if needed.

Args:
llm_config (dict): Configuration parameters for the language model.
"""

def __init__(self, **llm_config):
if "api_key" in llm_config:
llm_config["openai_api_key"] = llm_config.pop("api_key")
llm_config["openai_api_base"] = "https://api.x.ai/v1"

super().__init__(**llm_config)