|
8 | 8 | [](https://discord.gg/gkxQDAjfeX) |
9 | 9 |
|
10 | 10 |
|
11 | | -ScrapeGraphAI is a *web scraping* python library that uses LLM and direct graph logic to create scraping pipelines for websites, documents and XML files. |
| 11 | +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.). |
| 12 | + |
12 | 13 | Just say which information you want to extract and the library will do it for you! |
13 | 14 |
|
14 | 15 | <p align="center"> |
@@ -136,26 +137,34 @@ The output will be a list of recipes like the following: |
136 | 137 | You just need to pass the OpenAI API key and the model name. |
137 | 138 |
|
138 | 139 | ```python |
139 | | -from scrapegraphai.graphs import SmartScraperGraph |
| 140 | +from scrapegraphai.graphs import SpeechGraph |
140 | 141 |
|
141 | | -# Define the configuration for the graph |
142 | 142 | graph_config = { |
143 | 143 | "llm": { |
144 | 144 | "api_key": "OPENAI_API_KEY", |
145 | 145 | "model": "gpt-3.5-turbo", |
146 | 146 | }, |
| 147 | + "tts_model": { |
| 148 | + "api_key": "OPENAI_API_KEY", |
| 149 | + "model": "tts-1", |
| 150 | + "voice": "alloy" |
| 151 | + }, |
| 152 | + "output_path": "audio_summary.mp3", |
147 | 153 | } |
148 | 154 |
|
149 | | -# Create the SmartScraperGraph instance |
150 | | -smart_scraper_graph = SmartScraperGraph( |
151 | | - prompt="Make a detailed audio summary of the projects on this page", |
152 | | - source="https://perinim.github.io/projects", |
153 | | - config=graph_config |
| 155 | +# ************************************************ |
| 156 | +# Create the SpeechGraph instance and run it |
| 157 | +# ************************************************ |
| 158 | + |
| 159 | +speech_graph = SpeechGraph( |
| 160 | + prompt="Make a detailed audio summary of the projects.", |
| 161 | + source="https://perinim.github.io/projects/", |
| 162 | + config=graph_config, |
154 | 163 | ) |
155 | 164 |
|
156 | | -# Run the graph |
157 | | -result = smart_scraper_graph.run() |
| 165 | +result = speech_graph.run() |
158 | 166 | print(result) |
| 167 | + |
159 | 168 | ``` |
160 | 169 |
|
161 | 170 | The output will be an audio file with the summary of the projects on the page. |
|
0 commit comments