mirror of
https://github.com/VinciGit00/Scrapegraph-ai.git
synced 2026-06-25 21:11:11 +08:00
docs: fixed speechgraphexample
This commit is contained in:
parent
ae5655fdde
commit
4bf90f32a8
29
README.md
29
README.md
@ -8,7 +8,8 @@
|
|||||||
[](https://discord.gg/gkxQDAjfeX)
|
[](https://discord.gg/gkxQDAjfeX)
|
||||||
|
|
||||||
|
|
||||||
ScrapeGraphAI is a *web scraping* python library that uses LLM and direct graph logic to create scraping pipelines for websites, documents and XML files.
|
ScrapeGraphAI is a *web scraping* python library that uses LLM and direct graph logic to create scraping pipelines for websites and local documents (XML, HTML, JSON, etc.).
|
||||||
|
|
||||||
Just say which information you want to extract and the library will do it for you!
|
Just say which information you want to extract and the library will do it for you!
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
@ -136,26 +137,34 @@ The output will be a list of recipes like the following:
|
|||||||
You just need to pass the OpenAI API key and the model name.
|
You just need to pass the OpenAI API key and the model name.
|
||||||
|
|
||||||
```python
|
```python
|
||||||
from scrapegraphai.graphs import SmartScraperGraph
|
from scrapegraphai.graphs import SpeechGraph
|
||||||
|
|
||||||
# Define the configuration for the graph
|
|
||||||
graph_config = {
|
graph_config = {
|
||||||
"llm": {
|
"llm": {
|
||||||
"api_key": "OPENAI_API_KEY",
|
"api_key": "OPENAI_API_KEY",
|
||||||
"model": "gpt-3.5-turbo",
|
"model": "gpt-3.5-turbo",
|
||||||
},
|
},
|
||||||
|
"tts_model": {
|
||||||
|
"api_key": "OPENAI_API_KEY",
|
||||||
|
"model": "tts-1",
|
||||||
|
"voice": "alloy"
|
||||||
|
},
|
||||||
|
"output_path": "audio_summary.mp3",
|
||||||
}
|
}
|
||||||
|
|
||||||
# Create the SmartScraperGraph instance
|
# ************************************************
|
||||||
smart_scraper_graph = SmartScraperGraph(
|
# Create the SpeechGraph instance and run it
|
||||||
prompt="Make a detailed audio summary of the projects on this page",
|
# ************************************************
|
||||||
source="https://perinim.github.io/projects",
|
|
||||||
config=graph_config
|
speech_graph = SpeechGraph(
|
||||||
|
prompt="Make a detailed audio summary of the projects.",
|
||||||
|
source="https://perinim.github.io/projects/",
|
||||||
|
config=graph_config,
|
||||||
)
|
)
|
||||||
|
|
||||||
# Run the graph
|
result = speech_graph.run()
|
||||||
result = smart_scraper_graph.run()
|
|
||||||
print(result)
|
print(result)
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
The output will be an audio file with the summary of the projects on the page.
|
The output will be an audio file with the summary of the projects on the page.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user