Skip to content

Commit ac10128

Browse files
committed
feat(burr): added burr integration in graphs and optional burr installation
1 parent 654a042 commit ac10128

File tree

9 files changed

+155
-202
lines changed

9 files changed

+155
-202
lines changed

examples/openai/search_graph_burr.py

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
"""
2+
Example of Search Graph
3+
"""
4+
5+
import os
6+
from dotenv import load_dotenv
7+
from scrapegraphai.graphs import SearchGraph
8+
from scrapegraphai.utils import convert_to_csv, convert_to_json, prettify_exec_info
9+
load_dotenv()
10+
11+
# ************************************************
12+
# Define the configuration for the graph
13+
# ************************************************
14+
15+
openai_key = os.getenv("OPENAI_APIKEY")
16+
17+
graph_config = {
18+
"llm": {
19+
"api_key": openai_key,
20+
"model": "gpt-3.5-turbo",
21+
},
22+
"max_results": 2,
23+
"verbose": True,
24+
"burr_kwargs": {
25+
"project_name": "search-graph-openai",
26+
}
27+
}
28+
29+
# ************************************************
30+
# Create the SearchGraph instance and run it
31+
# ************************************************
32+
33+
search_graph = SearchGraph(
34+
prompt="List me Chioggia's attractions.",
35+
config=graph_config
36+
)
37+
38+
result = search_graph.run()
39+
print(result)
40+
41+
# ************************************************
42+
# Get graph execution info
43+
# ************************************************
44+
45+
graph_exec_info = search_graph.get_execution_info()
46+
print(prettify_exec_info(graph_exec_info))
47+
48+
# Save to json and csv
49+
convert_to_csv(result, "result")
50+
convert_to_json(result, "result")

pyproject.toml

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,13 @@ dependencies = [
2929
"playwright==1.43.0",
3030
"google==3.0.0",
3131
"yahoo-search-py==0.3",
32-
"burr[start]==0.17.1"
3332
]
3433

3534
license = "MIT"
3635
readme = "README.md"
37-
homepage = "https://scrapegraph-ai.readthedocs.io/"
36+
homepage = "https://scrapegraphai.com/"
3837
repository = "https://github.com/VinciGit00/Scrapegraph-ai"
39-
documentation = "https://scrapegraph-doc.onrender.com/"
38+
documentation = "https://scrapegraph-ai.readthedocs.io/en/latest/"
4039
keywords = [
4140
"scrapegraph",
4241
"scrapegraphai",
@@ -64,6 +63,10 @@ classifiers = [
6463
]
6564
requires-python = ">= 3.9, < 3.12"
6665

66+
[project.optional-dependencies]
67+
burr = ["burr[start]==0.18.0"]
68+
docs = ["sphinx==4.3.0", "sphinx-rtd-theme==1.0.0"]
69+
6770
[build-system]
6871
requires = ["hatchling"]
6972
build-backend = "hatchling.build"
@@ -72,12 +75,7 @@ build-backend = "hatchling.build"
7275
managed = true
7376
dev-dependencies = [
7477
"pytest==8.0.0",
75-
"pytest-mock==3.14.0"
76-
]
77-
78-
[tool.rye.group.docs]
79-
optional = true
80-
81-
[tool.rye.group.docs.dependencies]
82-
sphinx = "7.1.2"
83-
sphinx-rtd-theme = "2.0.0"
78+
"pytest-mock==3.14.0",
79+
"-e file:.[burr]",
80+
"-e file:.[docs]",
81+
]

requirements-dev.lock

Lines changed: 55 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
# features: []
77
# all-features: false
88
# with-sources: false
9-
# generate-hashes: false
109

1110
-e file:.
1211
aiofiles==23.2.1
@@ -16,11 +15,13 @@ aiohttp==3.9.5
1615
# via langchain-community
1716
aiosignal==1.3.1
1817
# via aiohttp
18+
alabaster==0.7.16
19+
# via sphinx
1920
altair==5.3.0
2021
# via streamlit
21-
annotated-types==0.6.0
22+
annotated-types==0.7.0
2223
# via pydantic
23-
anthropic==0.25.9
24+
anthropic==0.26.1
2425
# via langchain-anthropic
2526
anyio==4.3.0
2627
# via anthropic
@@ -36,17 +37,20 @@ attrs==23.2.0
3637
# via aiohttp
3738
# via jsonschema
3839
# via referencing
40+
babel==2.15.0
41+
# via sphinx
3942
beautifulsoup4==4.12.3
4043
# via google
4144
# via scrapegraphai
4245
blinker==1.8.2
4346
# via streamlit
44-
boto3==1.34.105
47+
boto3==1.34.110
4548
# via langchain-aws
46-
botocore==1.34.105
49+
botocore==1.34.110
4750
# via boto3
4851
# via s3transfer
49-
burr==0.17.1
52+
burr==0.18.0
53+
# via burr
5054
# via scrapegraphai
5155
cachetools==5.3.3
5256
# via google-auth
@@ -66,6 +70,7 @@ colorama==0.4.6
6670
# via click
6771
# via loguru
6872
# via pytest
73+
# via sphinx
6974
# via tqdm
7075
# via uvicorn
7176
contourpy==1.2.1
@@ -83,6 +88,9 @@ distro==1.9.0
8388
# via openai
8489
dnspython==2.6.1
8590
# via email-validator
91+
docutils==0.17.1
92+
# via sphinx
93+
# via sphinx-rtd-theme
8694
email-validator==2.1.1
8795
# via fastapi
8896
exceptiongroup==1.2.1
@@ -106,15 +114,15 @@ free-proxy==1.1.1
106114
frozenlist==1.4.1
107115
# via aiohttp
108116
# via aiosignal
109-
fsspec==2024.3.1
117+
fsspec==2024.5.0
110118
# via huggingface-hub
111119
gitdb==4.0.11
112120
# via gitpython
113121
gitpython==3.1.43
114122
# via streamlit
115123
google==3.0.0
116124
# via scrapegraphai
117-
google-ai-generativelanguage==0.6.3
125+
google-ai-generativelanguage==0.6.4
118126
# via google-generativeai
119127
google-api-core==2.19.0
120128
# via google-ai-generativelanguage
@@ -130,7 +138,7 @@ google-auth==2.29.0
130138
# via google-generativeai
131139
google-auth-httplib2==0.2.0
132140
# via google-api-python-client
133-
google-generativeai==0.5.3
141+
google-generativeai==0.5.4
134142
# via langchain-google-genai
135143
googleapis-common-protos==1.63.0
136144
# via google-api-core
@@ -141,9 +149,9 @@ graphviz==0.20.3
141149
greenlet==3.0.3
142150
# via playwright
143151
# via sqlalchemy
144-
groq==0.5.0
152+
groq==0.7.0
145153
# via langchain-groq
146-
grpcio==1.63.0
154+
grpcio==1.64.0
147155
# via google-api-core
148156
# via grpcio-status
149157
grpcio-status==1.62.2
@@ -166,21 +174,26 @@ httpx==0.27.0
166174
# via groq
167175
# via openai
168176
# via yahoo-search-py
169-
huggingface-hub==0.23.0
177+
huggingface-hub==0.23.1
170178
# via tokenizers
171179
idna==3.7
172180
# via anyio
173181
# via email-validator
174182
# via httpx
175183
# via requests
176184
# via yarl
185+
imagesize==1.4.1
186+
# via sphinx
177187
iniconfig==2.0.0
178188
# via pytest
179189
jinja2==3.1.4
180190
# via altair
181191
# via burr
182192
# via fastapi
183193
# via pydeck
194+
# via sphinx
195+
jiter==0.1.0
196+
# via anthropic
184197
jmespath==1.0.1
185198
# via boto3
186199
# via botocore
@@ -218,9 +231,9 @@ langchain-groq==0.1.3
218231
# via scrapegraphai
219232
langchain-openai==0.1.6
220233
# via scrapegraphai
221-
langchain-text-splitters==0.0.1
234+
langchain-text-splitters==0.0.2
222235
# via langchain
223-
langsmith==0.1.57
236+
langsmith==0.1.60
224237
# via langchain
225238
# via langchain-community
226239
# via langchain-core
@@ -271,6 +284,7 @@ packaging==23.2
271284
# via marshmallow
272285
# via matplotlib
273286
# via pytest
287+
# via sphinx
274288
# via streamlit
275289
pandas==2.2.2
276290
# via altair
@@ -322,6 +336,7 @@ pyee==11.1.0
322336
# via playwright
323337
pygments==2.18.0
324338
# via rich
339+
# via sphinx
325340
pyparsing==3.1.2
326341
# via httplib2
327342
# via matplotlib
@@ -348,16 +363,17 @@ pyyaml==6.0.1
348363
referencing==0.35.1
349364
# via jsonschema
350365
# via jsonschema-specifications
351-
regex==2024.5.10
366+
regex==2024.5.15
352367
# via tiktoken
353-
requests==2.31.0
368+
requests==2.32.2
354369
# via burr
355370
# via free-proxy
356371
# via google-api-core
357372
# via huggingface-hub
358373
# via langchain
359374
# via langchain-community
360375
# via langsmith
376+
# via sphinx
361377
# via streamlit
362378
# via tiktoken
363379
rich==13.7.1
@@ -372,7 +388,7 @@ s3transfer==0.10.1
372388
# via boto3
373389
selectolax==0.3.21
374390
# via yahoo-search-py
375-
sf-hamilton==1.62.0
391+
sf-hamilton==1.63.0
376392
# via burr
377393
shellingham==1.5.4
378394
# via typer
@@ -386,8 +402,27 @@ sniffio==1.3.1
386402
# via groq
387403
# via httpx
388404
# via openai
405+
snowballstemmer==2.2.0
406+
# via sphinx
389407
soupsieve==2.5
390408
# via beautifulsoup4
409+
sphinx==4.3.0
410+
# via scrapegraphai
411+
# via sphinx-rtd-theme
412+
sphinx-rtd-theme==1.0.0
413+
# via scrapegraphai
414+
sphinxcontrib-applehelp==1.0.8
415+
# via sphinx
416+
sphinxcontrib-devhelp==1.0.6
417+
# via sphinx
418+
sphinxcontrib-htmlhelp==2.0.5
419+
# via sphinx
420+
sphinxcontrib-jsmath==1.0.1
421+
# via sphinx
422+
sphinxcontrib-qthelp==1.0.7
423+
# via sphinx
424+
sphinxcontrib-serializinghtml==1.1.10
425+
# via sphinx
391426
sqlalchemy==2.0.30
392427
# via langchain
393428
# via langchain-community
@@ -448,7 +483,7 @@ ujson==5.10.0
448483
# via fastapi
449484
uritemplate==4.1.1
450485
# via google-api-python-client
451-
urllib3==1.26.18
486+
urllib3==2.2.1
452487
# via botocore
453488
# via requests
454489
# via yahoo-search-py
@@ -467,3 +502,5 @@ yahoo-search-py==0.3
467502
# via scrapegraphai
468503
yarl==1.9.4
469504
# via aiohttp
505+
setuptools==70.0.0
506+
# via sphinx

0 commit comments

Comments
 (0)