Skip to content

Conversation

@wangyuelucky
Copy link

@wangyuelucky wangyuelucky commented Nov 6, 2025

add tts toos to veADK, provides users with the ability to convert text to speech.

sample:
envs are required, you can get parameter values in the Volcano Engine Console
image

def ve_tts():
    os.environ["TOOL_TTS_API_KEY"] = ""
    os.environ["TOOL_TTS_APP_ID"] = ""
    os.environ["TOOL_TTS_SPEAKER"] = ""

    from veadk.tools.builtin_tools.tts import tts

    app_name = "veadk_playground_app"
    user_id = "veadk_playground_user"

    agent = Agent(tools=[tts])

    runner = Runner(
        agent=agent, app_name=app_name, user_id=user_id
    )

    response = await runner.run(messages="你好,我是一名 Agent 开发者,请用语音回答我。", session_id=session_id)

    print(response)

}


def tts(text: str, tool_context: ToolContext) -> bool:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

text_to_speech may be more clearer

success = True

app_id = getenv("TOOL_TTS_APP_ID")
api_key = getenv("TOOL_TTS_API_KEY")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this api_key can be fetched according to Volcengine ak/sk?


app_id = getenv("TOOL_TTS_APP_ID")
api_key = getenv("TOOL_TTS_API_KEY")
speaker = getenv("TOOL_TTS_SPEAKER") # e.g. zh_female_vv_mars_bigtts
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For better user experiences, a default value should be given

}


def tts(text: str, tool_context: ToolContext) -> bool:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May be return a string rather than bool? (a string for file path or fail reason?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants