Skip to content

Revert "docs: update instructions to use with LocalAI" #206

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 1 commit into from
May 10, 2024
Merged
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
30 changes: 0 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,36 +239,6 @@ The output for all 3 the cases will be a dictionary with the extracted informati
}
```

### Case 7: Extract informations with LocalAI

For LocalAI, the OpenAI client can be used by specifing a "fake" `OPENAI_API_KEY` ( there is no need to specify a real OpenAI key ):

```python
from scrapegraphai.graphs import SmartScraperGraph

# Note: You can actually leave as-is
OPENAI_API_KEY = "YOUR_API_KEY"

graph_config = {
"llm": {
"api_key": OPENAI_API_KEY,
"model": "gpt-4",
"temperature": 0,
"base_url": "http://localhost:8080",
},
}

smart_scraper_graph = SmartScraperGraph(
prompt="List me all the articles",
# also accepts a string with the already downloaded HTML code
source="https://perinim.github.io/projects",
config=graph_config
)

result = smart_scraper_graph.run()
print(result)
```

## 🤝 Contributing

Feel free to contribute and join our Discord server to discuss with us improvements and give us suggestions!
Expand Down
Loading