feat: enable ppt_composer.zh_CN.md with request.locale (#694)

* feat: enable ppt_composer.zh_CN.md with request.locale

* fix: GeneratePPTRequest miss locale field

---------

Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
This commit is contained in:
pizzahan
2025-11-22 16:56:18 +08:00
committed by GitHub
parent 2d1a0997eb
commit 1bfcf9f429
4 changed files with 6 additions and 3 deletions

View File

@@ -21,7 +21,7 @@ def ppt_composer_node(state: PPTState):
model = get_llm_by_type(AGENT_LLM_MAP["ppt_composer"])
ppt_content = model.invoke(
[
SystemMessage(content=get_prompt_template("ppt/ppt_composer")),
SystemMessage(content=get_prompt_template("ppt/ppt_composer", locale=state.get("locale", "en-US"))),
HumanMessage(content=state["input"]),
],
)

View File

@@ -10,7 +10,7 @@ class PPTState(MessagesState):
# Input
input: str = ""
locale: str = ""
# Output
generated_file_path: str = ""

View File

@@ -751,7 +751,7 @@ async def generate_ppt(request: GeneratePPTRequest):
report_content = request.content
print(report_content)
workflow = build_ppt_graph()
final_state = workflow.invoke({"input": report_content})
final_state = workflow.invoke({"input": report_content, "locale": request.locale})
generated_file_path = final_state["generated_file_path"]
with open(generated_file_path, "rb") as f:
ppt_bytes = f.read()

View File

@@ -104,6 +104,9 @@ class GeneratePodcastRequest(BaseModel):
class GeneratePPTRequest(BaseModel):
content: str = Field(..., description="The content of the ppt")
locale: str = Field(
"en-US", description="Language locale for the conversation (e.g., en-US, zh-CN)"
)
class GenerateProseRequest(BaseModel):