mirror of
https://github.com/xtekky/gpt4free.git
synced 2025-12-06 02:30:41 -08:00
Refactor LMArena to use UUID version 7 for message IDs and add a new uuid.py module for UUID generation
This commit is contained in:
parent
bbf3c8e427
commit
84105bd033
2 changed files with 1014 additions and 4 deletions
|
|
@ -1,6 +1,5 @@
|
|||
from __future__ import annotations
|
||||
|
||||
import time
|
||||
import uuid
|
||||
import json
|
||||
import asyncio
|
||||
|
|
@ -27,6 +26,7 @@ from ...requests import StreamSession, get_args_from_nodriver, raise_for_status,
|
|||
from ...errors import ModelNotFoundError, CloudflareError, MissingAuthError, MissingRequirementsError
|
||||
from ...providers.response import FinishReason, Usage, JsonConversation, ImageResponse, Reasoning, PlainTextResponse, JsonRequest
|
||||
from ...tools.media import merge_media
|
||||
from ...integration import uuid
|
||||
from ..base_provider import AsyncGeneratorProvider, ProviderModelMixin, AuthFileMixin
|
||||
from ..helper import get_last_user_message
|
||||
from ... import debug
|
||||
|
|
@ -630,9 +630,9 @@ class LMArena(AsyncGeneratorProvider, ProviderModelMixin, AuthFileMixin):
|
|||
else:
|
||||
raise ModelNotFoundError(f"Model '{model}' is not supported by LMArena Beta.")
|
||||
|
||||
userMessageId = str(uuid.uuid4())
|
||||
modelAMessageId = str(uuid.uuid4())
|
||||
evaluationSessionId = str(uuid.uuid4())
|
||||
userMessageId = str(uuid.uuid7())
|
||||
modelAMessageId = str(uuid.uuid7())
|
||||
evaluationSessionId = str(uuid.uuid7())
|
||||
data = {
|
||||
"id": evaluationSessionId,
|
||||
"mode": "direct",
|
||||
|
|
|
|||
1010
g4f/integration/uuid.py
Normal file
1010
g4f/integration/uuid.py
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue