返回提交历史
Modified
g4f/Provider/PollinationsAI.py
+0
-1
Modified
g4f/Provider/template/OpenaiTemplate.py
+1
-1
XFEstudio/gpt4free
fix: remove redundant lookup for "audio" voice in PollinationsAI.py and fix key reference in OpenaiTemplate.py
- Removed the line retrieving "voice" from "audio" key inside the PollinationsAI.py file - Changed the condition in OpenaiTemplate.py from checking "choices" in data to "choices" in data before accessing data["choices"][0] in OpenaiTemplate.py
989d3b86
代码差异
2 个文件
+1
-2
@@ -484,7 +484,6 @@ class PollinationsAI(AsyncGeneratorProvider, ProviderModelMixin):
484
484
if "modalities" not in extra_body:
485
485
extra_body["modalities"] = ["text", "audio"]
486
486
stream = False
487
voice = extra_body.get("audio", {}).get("voice")
488
487
data = filter_none(
489
488
messages=list(render_messages(messages, media)),
490
489
model=model,
@@ -131,7 +131,7 @@ class OpenaiTemplate(AsyncGeneratorProvider, ProviderModelMixin, RaiseErrorMixin
131
131
yield ProviderInfo(**cls.get_dict(), model=model)
132
132
if "usage" in data:
133
133
yield Usage(**data["usage"])
134
if "choices" in choice:
134
if "choices" in data:
135
135
choice = data["choices"][0]
136
136
if "content" in choice["message"] and choice["message"]["content"]:
137
137
yield choice["message"]["content"].strip()