You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For [LocalAI](https://localai.io), the OpenAI client can be used by specifing a "fake" `OPENAI_API_KEY` ( there is no need to specify a real OpenAI key ):
4
+
5
+
```python
6
+
"""
7
+
Basic example of scraping pipeline using SmartScraper from text
8
+
"""
9
+
from scrapegraphai.graphs import SmartScraperGraph
10
+
11
+
# Note: You can actually leave as-is
12
+
OPENAI_API_KEY="YOUR_API_KEY"
13
+
14
+
graph_config = {
15
+
"llm": {
16
+
"api_key": OPENAI_API_KEY,
17
+
"model": "gpt-4",
18
+
"temperature": 0,
19
+
"base_url": "http://localhost:8080",
20
+
},
21
+
}
22
+
23
+
smart_scraper_graph = SmartScraperGraph(
24
+
prompt="List me all the articles",
25
+
# also accepts a string with the already downloaded HTML code
0 commit comments