返回提交历史
Modified
g4f/Provider/needs_auth/Azure.py
+3
-2
XFEstudio/gpt4free
fix: add "flux.1-kontext-pro" to vision_models and define image_models
- Append "flux.1-kontext-pro" to the vision_models list in Azure.py - Introduce the image_models list containing "flux-1.1-pro" and "flux.1-kontext-pro" - Ensure api_endpoint is checked for null before searching for "/images/" - No other code modifications or logic changes in this
80deba16
代码差异
1 个文件
+3
-2
@@ -20,7 +20,8 @@ class Azure(OpenaiTemplate):
20
20
login_url = "https://discord.gg/qXA4Wf4Fsm"
21
21
routes: dict[str, str] = {}
22
22
audio_models = ["gpt-4o-mini-audio-preview"]
23
vision_models = ["gpt-4.1", "o4-mini", "model-router"]
23
vision_models = ["gpt-4.1", "o4-mini", "model-router", "flux.1-kontext-pro"]
24
image_models = ["flux-1.1-pro", "flux.1-kontext-pro"]
24
25
model_extra_body = {
25
26
"gpt-4o-mini-audio-preview": {
26
27
"audio": {
@@ -77,7 +78,7 @@ class Azure(OpenaiTemplate):
77
78
api_key = cls.api_keys.get(model, cls.api_keys.get("default"))
78
79
if not api_key:
79
80
raise ValueError(f"API key is required for Azure provider. Ask for API key in the {cls.login_url} Discord server.")
80
if "/images/" in api_endpoint:
81
if api_endpoint and "/images/" in api_endpoint:
81
82
prompt = format_media_prompt(messages, kwargs.get("prompt"))
82
83
width, height = get_width_height(kwargs.get("aspect_ratio", "1:1"), kwargs.get("width"), kwargs.get("height"))
83
84
output_format = kwargs.get("output_format", "webp")