mirror of
https://github.com/xtekky/gpt4free.git
synced 2025-12-06 02:30:41 -08:00
fix: resolve model duplication and improve provider handling
- Fixed duplicate model entries in Blackbox provider model_aliases - Added meta-llama- to llama- name cleaning in Cloudflare provider - Enhanced PollinationsAI provider with improved vision model detection - Added reasoning support to PollinationsAI provider - Fixed HuggingChat authentication to include headers and impersonate - Removed unused max_inputs_length parameter from HuggingFaceAPI - Renamed extra_data to extra_body for consistency across providers - Added Puter provider with grouped model support - Enhanced AnyProvider with grouped model display and better model organization - Fixed model cleaning in AnyProvider to handle more model name variations - Added api_key handling for HuggingFace providers in AnyProvider - Added see_stream helper function to parse event streams - Updated GUI server to handle JsonConversation properly - Fixed aspect ratio handling in image generation functions - Added ResponsesConfig and ClientResponse for new API endpoint - Updated requirements to include markitdown
This commit is contained in:
parent
8132cf6abc
commit
93986d15f6
31 changed files with 614 additions and 191 deletions
|
|
@ -3,8 +3,9 @@ from __future__ import annotations
|
|||
import os
|
||||
import time
|
||||
import random
|
||||
import json
|
||||
from urllib.parse import urlparse
|
||||
from typing import Iterator
|
||||
from typing import Iterator, AsyncIterator
|
||||
from http.cookies import Morsel
|
||||
from pathlib import Path
|
||||
import asyncio
|
||||
|
|
@ -198,4 +199,11 @@ async def get_nodriver(
|
|||
browser.stop()
|
||||
finally:
|
||||
lock_file.unlink(missing_ok=True)
|
||||
return browser, on_stop
|
||||
return browser, on_stop
|
||||
|
||||
async def see_stream(iter_lines: Iterator[bytes]) -> AsyncIterator[dict]:
|
||||
async for line in iter_lines:
|
||||
if line.startswith(b"data: "):
|
||||
if line[6:].startswith(b"[DONE]"):
|
||||
break
|
||||
yield json.loads(line[6:])
|
||||
Loading…
Add table
Add a link
Reference in a new issue