8000 Fix audio response format documentation in APIDOCS.md by mentatbot[bot] · Pull Request #1935 · pollinations/pollinations · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix audio response format documentation in APIDOCS.md #1935

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 10, 2025
Merged

Conversation

mentatbot[bot]
Copy link
Contributor
@mentatbot mentatbot bot commented May 10, 2025

Updated the documentation for the text-to-speech POST endpoint to correctly show that:

  • The response is a JSON structure containing base64-encoded audio data (not a raw audio file)
  • Added link to OpenAI audio documentation for detailed usage guidance
  • Fixed curl example to show how to extract audio data from the JSON response
  • Updated Python example to correctly parse the JSON response and extract base64-encoded audio
  • Updated JavaScript example to handle the JSON structure and convert base64 to playable audio

Closes #1934


🤖 See my steps and cost here

  • Wake on any new activity.

Updated the documentation for the text-to-speech POST endpoint to correctly show that:
- The response is a JSON structure containing base64-encoded audio data (not a raw audio file)
- Added link to OpenAI audio documentation for detailed usage guidance
- Fixed curl example to show how to extract audio data from the JSON response
- Updated Python example to correctly parse the JSON response and extract base64-encoded audio
- Updated JavaScript example to handle the JSON structure and convert base64 to playable audio

Closes # 1934

Mentat precommits failed. Log: https://mentat.ai/gh/pollinations/pollinations/log/c45cdf11-9045-487a-a935-18f9fb577524
Copy link
netlify bot commented May 10, 2025

Deploy Preview for pollinations canceled.

Name Link
🔨 Latest commit e1887e2
🔍 Latest deploy log https://app.netlify.com/sites/pollinations/deploys/681f6247fc4d860008fd6e37

Copy link
netlify bot commented May 10, 2025

Deploy Preview for pollinations-react-hooks-docs canceled.

Name Link
🔨 Latest commit e1887e2
🔍 Latest deploy log https://app.netlify.com/sites/pollinations-react-hooks-docs/deploys/681f624716e59e0008377717

Copy link
Contributor Author
mentatbot bot commented May 10, 2025

I've updated the documentation for the audio response format in the Text-to-Speech (POST) endpoint. The documentation previously incorrectly stated that the response would be a raw audio file, when it's actually a JSON structure containing base64-encoded audio data.

Changes made:

  • Updated the return format description to correctly describe the JSON response structure
  • Added a link to OpenAI's audio documentation for detailed usage guidance
  • Fixed the curl example to show how to extract audio from the JSON response
  • Updated the Python example to correctly parse the JSON and decode the base64 audio data
  • Updated the JavaScript example to handle the JSON structure and convert base64 to playable audio

These changes align with the actual behavior of the API and the OpenAI-compatible format described in the issue.

@voodoohop Please let me know if this looks good or if additional changes are needed!

@voodoohop
Copy link
Member

@MentatBot maybe we dont need to show a curl example for extracting the base64 - curl example for get in the audio part is enough. the other example can be python or js whatever we have there already

Removed the extraction steps from the curl example as requested in the PR feedback. The simplified example keeps the focus on the basic API request without the additional extraction steps.

The Python and JavaScript examples still contain detailed instructions for handling the JSON response and extracting the audio data.

Mentat precommits failed. Log: https://mentat.ai/gh/pollinations/pollinations/log/4a20cba5-3817-43e1-bd00-58f4865d9e47
Copy link
Contributor Author
mentatbot bot commented May 10, 2025

@voodoohop I've updated the documentation as you suggested. The curl example is now simplified by removing the extraction steps, focusing just on the basic API request. The Python and JavaScript examples still contain the detailed instructions for handling the JSON response and extracting the audio data.

Let me know if this looks good or if you'd like any additional changes!

@voodoohop voodoohop marked this pull request as ready for review May 10, 2025 16:15
@voodoohop voodoohop merged commit 8fce5ef into master May 10, 2025
9 checks passed
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.

[apidocs] audio response format for POST
1 participant
0