MCPcopy
hub / github.com/ScrapeGraphAI/Scrapegraph-ai / run

Method run

scrapegraphai/graphs/speech_graph.py:103–120  ·  view source on GitHub ↗

Executes the scraping process and returns the answer to the prompt. Returns: str: The answer to the prompt.

(self)

Source from the content-addressed store, hash-verified

101 )
102
103 def run(self) -> str:
104 """
105 Executes the scraping process and returns the answer to the prompt.
106
107 Returns:
108 str: The answer to the prompt.
109 """
110
111 inputs = {"user_prompt": self.prompt, self.input_key: self.source}
112 self.final_state, self.execution_info = self.graph.execute(inputs)
113
114 audio = self.final_state.get("audio", None)
115 if not audio:
116 raise ValueError("No audio generated from the text.")
117 save_audio_from_bytes(audio, self.config.get("output_path", "output.mp3"))
118 logger.info("Audio saved to %s", self.config.get("output_path", "output.mp3"))
119
120 return self.final_state.get("answer", "No answer found.")

Callers 6

lazy_loadMethod · 0.45
browser_base_fetchFunction · 0.45
_fetch_urlMethod · 0.45
executeMethod · 0.45
executeMethod · 0.45
executeMethod · 0.45

Calls 4

save_audio_from_bytesFunction · 0.90
getMethod · 0.80
executeMethod · 0.45
infoMethod · 0.45

Tested by

no test coverage detected