Skip to content

Commit c11fc28

Browse files
committed
docs: refactor examples
1 parent 0631985 commit c11fc28

File tree

5 files changed

+8
-12
lines changed

5 files changed

+8
-12
lines changed

examples/openai/custom_graph_openai.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
fetch_node = FetchNode(
4141
input="url | local_dir",
4242
output=["doc"],
43+
node_config={"headless": True, "verbose": True}
4344
)
4445
parse_node = ParseNode(
4546
input="doc",

examples/openai/scrape_plain_text_openai.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,3 @@
5252

5353
graph_exec_info = smart_scraper_graph.get_execution_info()
5454
print(prettify_exec_info(graph_exec_info))
55-
56-
57-
# ************************************************
58-
# Get graph execution info
59-
# ************************************************
60-
61-
graph_exec_info = smart_scraper_graph.get_execution_info()
62-
print(prettify_exec_info(graph_exec_info))

examples/openai/script_generator_openai.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"api_key": openai_key,
2121
"model": "gpt-3.5-turbo",
2222
},
23-
"library": "beautifoulsoup"
23+
"library": "beautifulsoup"
2424
}
2525

2626
# ************************************************

examples/openai/xml_scraper_openai.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,14 @@
2323
# Define the configuration for the graph
2424
# ************************************************
2525

26-
gemini_key = os.getenv("GOOGLE_APIKEY")
26+
openai_key = os.getenv("OPENAI_APIKEY")
2727

2828
graph_config = {
2929
"llm": {
30-
"api_key": gemini_key,
30+
"api_key": openai_key,
3131
"model": "gpt-3.5-turbo",
3232
},
33+
"verbose":False,
3334
}
3435

3536
# ************************************************

scrapegraphai/graphs/script_creator_graph.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,12 @@ class ScriptCreatorGraph(AbstractGraph):
4242
"""
4343

4444
def __init__(self, prompt: str, source: str, config: dict):
45+
46+
self.library = config['library']
47+
4548
super().__init__(prompt, config, source)
4649

4750
self.input_key = "url" if source.startswith("http") else "local_dir"
48-
self.library = config['library']
4951

5052
def _create_graph(self) -> BaseGraph:
5153
"""

0 commit comments

Comments
 (0)