-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8cc04b0
commit c18d018
Showing
6 changed files
with
64 additions
and
28 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
pandas==2.0.3 | ||
scrapegraphai==0.0.6 | ||
scrapegraphai==0.0.7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
""" | ||
Basic example of scraping pipeline using SpeechSummaryGraph | ||
""" | ||
|
||
from scrapegraphai.graphs import SpeechSummaryGraph | ||
|
||
def text_to_speech(key:str, prompt:str, url:str): | ||
""" | ||
Given a text it reads after the prompt | ||
Args: | ||
- url (str): url to scrape | ||
- prompt(str): prompt to do | ||
- key(str) openaikey | ||
""" | ||
|
||
|
||
llm_config = { | ||
"api_key": key | ||
} | ||
|
||
# Save the audio to a file | ||
audio_file = "audio_result.mp3" | ||
speech_summary_graph = SpeechSummaryGraph(prompt, | ||
url, llm_config, | ||
audio_file) | ||
|
||
return speech_summary_graph.run() | ||
|