Spaces:
Sleeping
Sleeping
Sandra Sanchez commited on
Commit ·
52ca5ab
1
Parent(s): a10b17f
Call adapt and translate functions correctly in app.py (with underscore)
Browse files
app.py
CHANGED
|
@@ -60,11 +60,11 @@ def show_selected(scenario_name):
|
|
| 60 |
# Direct tool calls (no async needed)
|
| 61 |
def call_adapt_tool(story, culture, age, gender, vibe, comfort_character):
|
| 62 |
print(f"\n[TOOL] Adapt story called with:\nCulture: {culture}, Age: {age}, Gender: {gender}, Vibe: {vibe}, Comfort Character: {comfort_character}\nStory:\n{story}\n")
|
| 63 |
-
return
|
| 64 |
|
| 65 |
def call_translate_tool(story, language, gender="female"):
|
| 66 |
print(f"\n[TOOL] Translate story called with:\nLanguage: {language}\nGender: {gender}\nStory:\n{story}\n")
|
| 67 |
-
return
|
| 68 |
|
| 69 |
def call_voice_tool(story, language):
|
| 70 |
print(f"\n[TOOL] Generate voice called with:\nLanguage: {language}\nStory:\n{story}\n")
|
|
@@ -135,7 +135,7 @@ def generate_image(scenario_name: str, culture: str = "default", age: str = "7",
|
|
| 135 |
# Translate story if needed
|
| 136 |
story_for_image = story_text
|
| 137 |
if language.lower() != "en" and story_text:
|
| 138 |
-
story_for_image =
|
| 139 |
|
| 140 |
# Create image prompt based on vibe
|
| 141 |
if vibe == "Comic":
|
|
|
|
| 60 |
# Direct tool calls (no async needed)
|
| 61 |
def call_adapt_tool(story, culture, age, gender, vibe, comfort_character):
|
| 62 |
print(f"\n[TOOL] Adapt story called with:\nCulture: {culture}, Age: {age}, Gender: {gender}, Vibe: {vibe}, Comfort Character: {comfort_character}\nStory:\n{story}\n")
|
| 63 |
+
return _adapt_story_impl(story, culture, age, gender, vibe, comfort_character)
|
| 64 |
|
| 65 |
def call_translate_tool(story, language, gender="female"):
|
| 66 |
print(f"\n[TOOL] Translate story called with:\nLanguage: {language}\nGender: {gender}\nStory:\n{story}\n")
|
| 67 |
+
return _translate_story_impl(story, language, gender)
|
| 68 |
|
| 69 |
def call_voice_tool(story, language):
|
| 70 |
print(f"\n[TOOL] Generate voice called with:\nLanguage: {language}\nStory:\n{story}\n")
|
|
|
|
| 135 |
# Translate story if needed
|
| 136 |
story_for_image = story_text
|
| 137 |
if language.lower() != "en" and story_text:
|
| 138 |
+
story_for_image = _translate_story_impl(story_text, language, gender)
|
| 139 |
|
| 140 |
# Create image prompt based on vibe
|
| 141 |
if vibe == "Comic":
|