mirror of
https://github.com/open-webui/open-webui.git
synced 2026-08-24 14:23:59 -05:00
[PR #23657] [CLOSED] fix: handle string vs dict entries for custom tts endpoint voices #27304
Reference in New Issue
Block a user
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/23657
Author: @silentoplayz
Created: 4/13/2026
Status: ❌ Closed
Base:
dev← Head:fix/audio-custom-voices-type-error📝 Commits (3)
1893b14fix(audio): handle string vs dict entries for custom tts endpoint voices83acc52fix(audio): handle string vs dict entries for custom tts endpoint voicesbd2bc5bMerge branch 'fix/audio-custom-voices-type-error' of https://github.com/silentoplayz/open-webui into fix/audio-custom-voices-type-error📊 Changes
1 file changed (+19 additions, -2 deletions)
View changed files
📝
backend/open_webui/routers/audio.py(+19 -2)📄 Description
Pull Request Checklist
Note to first-time contributors: Please open a discussion post in Discussions to discuss your idea/fix with the community before creating a pull request, and describe your changes before submitting a pull request.
This is to ensure large feature PRs are discussed with the community first, before starting work on it. If the community does not want this feature or it is not relevant for Open WebUI as a project, it can be identified in the discussion before working on the feature and submitting the PR.
Before submitting, make sure you've checked the following:
devbranch. PRs targetingmainwill be immediately closed.devto ensure no unrelated commits (e.g. frommain) are included. Push updates to the existing PR branch instead of closing and reopening.Changelog Entry
Description
get_available_voicesdue toTypeError: string indices must be integers, not 'str'. Made the parsing logic far more forgiving, able to handle responses where the endpoint returns the data directly as a list or wrapped in dictionaries, and automatically iterating over voice keys safely regardless of their exact nested type.Fixed
audio.pyfor/audio/voicesAPI compatibility.Audiotab in the user settings:Screenshots
Before:
After:
Additional Information
TypeErrorinto the system console when accessing theAudioWebUI settings pane.voiceskey and extracts the dictionaryidandnameattributes seamlessly. The new behavior only kicks in as a fallback to gracefully catch unexpected endpoint formats (like flat string arrays or endpoints returning data nested inside adatakey) instead of crashing.Contributor License Agreement
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.