返回提交历史
Modified
g4f/Provider/needs_auth/OpenaiChat.py
+7
-3
XFEstudio/gpt4free
fix(OpenaiChat): use gizmo_interaction conversation_mode for custom GPTs
When gizmo_id is passed, conversation_mode was hardcoded to primary_assistant in both request payload data dicts, causing the custom GPT's system instructions to be ignored and the base model to respond instead. Fixes #3427
2adec1bd
代码差异
1 个文件
+7
-3
@@ -451,7 +451,11 @@ class OpenaiChat(AsyncAuthedProvider, ProviderModelMixin):
451
451
conversation = copy(conversation)
452
452
453
453
if conversation_mode is None:
454
conversation_mode = {"kind": "primary_assistant"}
454
_gizmo_id = kwargs.get("gizmo_id")
455
if _gizmo_id:
456
conversation_mode = {"kind": "gizmo_interaction", "gizmo_id": _gizmo_id}
457
else:
458
conversation_mode = {"kind": "primary_assistant"}
455
459
456
460
if getattr(auth_result, "cookies", {}).get("oai-did") != getattr(conversation, "user_id", None):
457
461
conversation = Conversation(None, str(uuid.uuid4()))
@@ -475,7 +479,7 @@ class OpenaiChat(AsyncAuthedProvider, ProviderModelMixin):
475
479
"model": model,
476
480
"timezone_offset_min": -120,
477
481
"timezone": "Europe/Berlin",
478
"conversation_mode": {"kind": "primary_assistant"},
482
"conversation_mode": conversation_mode,
479
483
"system_hints": system_hints,
480
484
"supports_buffering": True,
481
485
"supported_encodings": ["v1"]
@@ -536,7 +540,7 @@ class OpenaiChat(AsyncAuthedProvider, ProviderModelMixin):
536
540
"model": model,
537
541
"timezone_offset_min": -120,
538
542
"timezone": "Europe/Berlin",
539
"conversation_mode": {"kind": "primary_assistant"},
543
"conversation_mode": conversation_mode,
540
544
"enable_message_followups": True,
541
545
"system_hints": system_hints,
542
546
"supports_buffering": True,