mirror of
https://git.mirrors.martin98.com/https://github.com/bytedance/deer-flow
synced 2025-08-19 14:19:11 +08:00
refactor: refactor podcast genration stability (#11)
This commit is contained in:
parent
9213729ef5
commit
f8b718fcc1
@ -42,6 +42,7 @@ In this demo, we showcase how to use DeerFlow to:
|
||||
- [❓ FAQ](#faq)
|
||||
- [📜 License](#license)
|
||||
- [💖 Acknowledgments](#acknowledgments)
|
||||
- [⭐ Star History](#star-history)
|
||||
|
||||
|
||||
## Quick Start
|
||||
@ -465,3 +466,7 @@ A heartfelt thank you goes out to the core authors of `DeerFlow`, whose vision,
|
||||
- **[Henry Li](https://github.com/magiccube/)**
|
||||
|
||||
Your unwavering commitment and expertise have been the driving force behind DeerFlow's success. We are honored to have you at the helm of this journey.
|
||||
|
||||
## ⭐ Star History
|
||||
|
||||
[](https://star-history.com/#bytedance/deer-flow&Date)
|
||||
|
@ -16,9 +16,9 @@ def tts_node(state: PodcastState):
|
||||
tts_client = _create_tts_client()
|
||||
for line in state["script"].lines:
|
||||
tts_client.voice_type = (
|
||||
"BV033_streaming" if line.speaker == "male" else "BV034_streaming"
|
||||
"BV002_streaming" if line.speaker == "male" else "BV001_streaming"
|
||||
)
|
||||
result = tts_client.text_to_speech(line.text, speed_ratio=1.05)
|
||||
result = tts_client.text_to_speech(line.paragraph, speed_ratio=1.05)
|
||||
if result["success"]:
|
||||
audio_data = result["audio_data"]
|
||||
audio_chunk = base64.b64decode(audio_data)
|
||||
|
@ -8,7 +8,7 @@ from pydantic import BaseModel, Field
|
||||
|
||||
class ScriptLine(BaseModel):
|
||||
speaker: Literal["male", "female"] = Field(default="male")
|
||||
text: str = Field(default="")
|
||||
paragraph: str = Field(default="")
|
||||
|
||||
|
||||
class Script(BaseModel):
|
||||
|
@ -11,12 +11,12 @@ You are a professional podcast editor for a show called "Hello Deer." Transform
|
||||
|
||||
# Output Format
|
||||
|
||||
The output should be formatted as a valid, parseable JSON object of `Script` without "```json":
|
||||
The output should be formatted as a valid, parseable JSON object of `Script` without "```json". The `Script` interface is defined as follows:
|
||||
|
||||
```ts
|
||||
interface ScriptLine {
|
||||
speaker: 'male' | 'female';
|
||||
text: string; // only plain text, never Markdown
|
||||
paragraph: string; // only plain text, never Markdown
|
||||
}
|
||||
|
||||
interface Script {
|
||||
@ -25,51 +25,6 @@ interface Script {
|
||||
}
|
||||
```
|
||||
|
||||
# Examples
|
||||
|
||||
<example>
|
||||
{
|
||||
"locale": "en",
|
||||
"lines": [
|
||||
{
|
||||
"speaker": "male",
|
||||
"text": "Hey everyone, welcome to the podcast Hello Deer!"
|
||||
},
|
||||
{
|
||||
"speaker": "female",
|
||||
"text": "Hi there! Today, we’re diving into something super interesting."
|
||||
},
|
||||
{
|
||||
"speaker": "male",
|
||||
"text": "Yeah, we’re talking about [topic]. You know, I’ve been thinking about this a lot lately."
|
||||
},
|
||||
{
|
||||
"speaker": "female",
|
||||
"text": "Oh, me too! It’s such a fascinating subject. So, let’s start with [specific detail or question]."
|
||||
},
|
||||
{
|
||||
"speaker": "male",
|
||||
"text": "Sure! Did you know that [fact or insight]? It’s kind of mind-blowing, right?"
|
||||
},
|
||||
{
|
||||
"speaker": "female",
|
||||
"text": "Totally! And it makes me wonder, what about [related question or thought]?"
|
||||
},
|
||||
{
|
||||
"speaker": "male",
|
||||
"text": "Great point! Actually, [additional detail or answer]."
|
||||
},
|
||||
{
|
||||
"speaker": "female",
|
||||
"text": "Wow, that’s so cool. I didn’t know that! Okay, so what about [next topic or transition]?"
|
||||
},
|
||||
...
|
||||
]
|
||||
}
|
||||
</example>
|
||||
|
||||
> Real examples should be **MUCH MUCH LONGER** and more detailed, with placeholders replaced by actual content.
|
||||
|
||||
# Notes
|
||||
|
||||
- It should always start with "Hello Deer" podcast greetings and followed by topic introduction.
|
||||
|
Loading…
x
Reference in New Issue
Block a user