项目地址https://github.com/ScrapeGraphAI/Scrapegraph-ai
from scrapegraphai.graphs import SpeechGraph
graph_config = {
"llm": {
"api_key": "OPENAI_API_KEY",
"model": "openai/gpt-3.5-turbo",
},
"tts_model": {
"api_key": "OPENAI_API_KEY",
"model": "tts-1",
"voice": "alloy"
},
"output_path": "audio_summary.mp3",
}
# ************************************************
# 创建 SpeechGraph 实例并运行
# ************************************************
speech_graph = SpeechGraph(
prompt="列出所有项目和其描述",
source="https://perinim.github.io/projects",
config=graph_config,
)
result = speech_graph.run()
print(result)