mirror of
https://github.com/xtekky/gpt4free.git
synced 2026-04-22 15:47:11 +08:00
Merge pull request #3428 from vyguera/fix/openai-chat-gizmo-conversation-mode
fix(OpenaiChat): use gizmo_interaction conversation_mode for custom GPTs
This commit is contained in:
@@ -451,7 +451,11 @@ class OpenaiChat(AsyncAuthedProvider, ProviderModelMixin):
|
|||||||
conversation = copy(conversation)
|
conversation = copy(conversation)
|
||||||
|
|
||||||
if conversation_mode is None:
|
if conversation_mode is None:
|
||||||
conversation_mode = {"kind": "primary_assistant"}
|
_gizmo_id = kwargs.get("gizmo_id")
|
||||||
|
if _gizmo_id:
|
||||||
|
conversation_mode = {"kind": "gizmo_interaction", "gizmo_id": _gizmo_id}
|
||||||
|
else:
|
||||||
|
conversation_mode = {"kind": "primary_assistant"}
|
||||||
|
|
||||||
if getattr(auth_result, "cookies", {}).get("oai-did") != getattr(conversation, "user_id", None):
|
if getattr(auth_result, "cookies", {}).get("oai-did") != getattr(conversation, "user_id", None):
|
||||||
conversation = Conversation(None, str(uuid.uuid4()))
|
conversation = Conversation(None, str(uuid.uuid4()))
|
||||||
@@ -475,7 +479,7 @@ class OpenaiChat(AsyncAuthedProvider, ProviderModelMixin):
|
|||||||
"model": model,
|
"model": model,
|
||||||
"timezone_offset_min": -120,
|
"timezone_offset_min": -120,
|
||||||
"timezone": "Europe/Berlin",
|
"timezone": "Europe/Berlin",
|
||||||
"conversation_mode": {"kind": "primary_assistant"},
|
"conversation_mode": conversation_mode,
|
||||||
"system_hints": system_hints,
|
"system_hints": system_hints,
|
||||||
"supports_buffering": True,
|
"supports_buffering": True,
|
||||||
"supported_encodings": ["v1"]
|
"supported_encodings": ["v1"]
|
||||||
@@ -536,7 +540,7 @@ class OpenaiChat(AsyncAuthedProvider, ProviderModelMixin):
|
|||||||
"model": model,
|
"model": model,
|
||||||
"timezone_offset_min": -120,
|
"timezone_offset_min": -120,
|
||||||
"timezone": "Europe/Berlin",
|
"timezone": "Europe/Berlin",
|
||||||
"conversation_mode": {"kind": "primary_assistant"},
|
"conversation_mode": conversation_mode,
|
||||||
"enable_message_followups": True,
|
"enable_message_followups": True,
|
||||||
"system_hints": system_hints,
|
"system_hints": system_hints,
|
||||||
"supports_buffering": True,
|
"supports_buffering": True,
|
||||||
|
|||||||
Reference in New Issue
Block a user