-
Notifications
You must be signed in to change notification settings - Fork 21
docs: fix TTS model header — optional, default s2.1-pro, document fallback #110
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2472,10 +2472,10 @@ | |
| { | ||
| "in": "header", | ||
| "name": "model", | ||
| "description": "Specify which TTS model to use. Use `s2.1-pro-free` for the free developer tier.", | ||
| "required": true, | ||
| "description": "Specify which TTS model to use. Use `s2.1-pro-free` for the free developer tier. If omitted or set to an unrecognized value, the request falls back to `s2.1-pro`.", | ||
| "required": false, | ||
| "schema": { | ||
| "default": "s2.1-pro-free", | ||
| "default": "s2.1-pro", | ||
|
Comment on lines
+2475
to
+2478
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "Tracked OpenAPI files:"
git ls-files | rg '(^|/)openapi\.json$|api-reference/' || true
echo
echo "Relevant snippets:"
python3 - <<'PY'
from pathlib import Path
p=Path("api-reference/openapi.json")
if not p.exists():
print(f"{p} missing")
raise SystemExit
text=p.read_text(encoding="utf-8").splitlines()
for start,end in ((2475,2478),(2653,2656)):
print(f"\n--- {p}:{start}-{end} ---")
for i in range(start, end+1):
print(f"{i}: {text[i-1]}")
print("\nSearch for fallback wording and model enum occurrences:")
import re
matches=[]
for i,line in enumerate(text, start=1):
if "falls back" in line or "fall back" in line or "s2.1-pro-free" in line or "s2.1-pro" in line:
matches.append((i,line))
for i,line in matches[:80]:
print(f"{i}: {line}")
PY
echo
echo "Inspect surrounding schema definitions with Python JSON parsing:"
python3 - <<'PY'
import json
from pathlib import Path
p=Path("api-reference/openapi.json")
data=json.loads(p.read_text())
def find_paths(obj, key=None, path=()):
if isinstance(obj, dict):
for k,v in obj.items():
if k == key:
print(f"KEY {key} at {path}.{k}")
yield from find_paths(v, key, f"{path}.{k}")
for k,v in obj.items():
yield from find_paths(v, key, f"{path}.{k}")
elif isinstance(obj, list):
for idx,v in enumerate(obj):
yield from find_paths(v, key, path=f"{path}[{idx}]")
# Navigate likely paths around TTS endpoints
try:
paths=json.loads(p.read_text())[ "paths"]
for path in paths:
if "tts" in path.lower():
print(f"\nPATH {path}")
for method,params in paths[path].items():
print(f" {method.upper()}")
if "requestBody" in params:
print(json.dumps(params["requestBody"], indent=2)[:1200])
if "parameters" in params:
for par in params["parameters"]:
if "model" in par.get("name","").lower() or "model" in str(par.get("schema",{})).lower():
print(" parameter:", json.dumps(par, indent=2))
except Exception as e:
print("PATH traversal failed:", e)
print("\nAll enum arrays containing model values:")
def walk(o,path=""):
if isinstance(o, dict):
if o.get("enum") is not None:
v=o["enum"]
if any("s2" in str(x).lower() or "tts" in path.lower() or "model" in path.lower() for x in v):
print(f"{path}: {v}")
for k,v in o.items():
walk(v, f"{path}.{k}")
elif isinstance(o, list):
for i,v in enumerate(o):
walk(v, f"{path}[{i}]")
walk(data)
PYRepository: fishaudio/docs Length of output: 11456 Don’t promise unknown-model fallback while the schemas limit model values. Both TTS endpoint headers document that unrecognized model values fall back to 📍 Affects 1 file
🤖 Prompt for AI Agents |
||
| "enum": [ | ||
| "s1", | ||
| "s2-pro", | ||
|
|
@@ -2650,10 +2650,10 @@ | |
| { | ||
| "in": "header", | ||
| "name": "model", | ||
| "description": "Specify which TTS model to use. Use `s2.1-pro-free` for the free developer tier.", | ||
| "required": true, | ||
| "description": "Specify which TTS model to use. Use `s2.1-pro-free` for the free developer tier. If omitted or set to an unrecognized value, the request falls back to `s2.1-pro`.", | ||
| "required": false, | ||
| "schema": { | ||
| "default": "s2.1-pro-free", | ||
| "default": "s2.1-pro", | ||
| "enum": [ | ||
| "s1", | ||
| "s2-pro", | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
Update the feature documentation in the same change.
features/text-to-speech.mdx:268still states that themodelheader is required on every/v1/ttsrequest, contradicting this optional-header contract. Update that documentation or defer this OpenAPI change until both public descriptions agree.🤖 Prompt for AI Agents