g4f 6.9.1__py3-none-any.whl → 6.9.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- g4f/Provider/Yupp.py +9 -10
- g4f/Provider/needs_auth/AIBadgr.py +1 -0
- g4f/Provider/yupp/models.py +9 -6
- {g4f-6.9.1.dist-info → g4f-6.9.3.dist-info}/METADATA +1 -1
- {g4f-6.9.1.dist-info → g4f-6.9.3.dist-info}/RECORD +9 -9
- {g4f-6.9.1.dist-info → g4f-6.9.3.dist-info}/WHEEL +0 -0
- {g4f-6.9.1.dist-info → g4f-6.9.3.dist-info}/entry_points.txt +0 -0
- {g4f-6.9.1.dist-info → g4f-6.9.3.dist-info}/licenses/LICENSE +0 -0
- {g4f-6.9.1.dist-info → g4f-6.9.3.dist-info}/top_level.txt +0 -0
g4f/Provider/Yupp.py
CHANGED
|
@@ -223,7 +223,7 @@ class Yupp(AsyncGeneratorProvider, ProviderModelMixin):
|
|
|
223
223
|
api_key = get_cookies("yupp.ai", False).get("__Secure-yupp.session-token")
|
|
224
224
|
if not api_key:
|
|
225
225
|
raise MissingAuthError("No Yupp accounts configured. Set YUPP_API_KEY environment variable.")
|
|
226
|
-
manager = YuppModelManager(api_key=api_key)
|
|
226
|
+
manager = YuppModelManager(api_key=api_key, session=create_scraper())
|
|
227
227
|
models = manager.client.fetch_models()
|
|
228
228
|
if models:
|
|
229
229
|
cls.models_tags = {model.get("name"): manager.processor.generate_tags(model) for model in models}
|
|
@@ -610,15 +610,14 @@ class Yupp(AsyncGeneratorProvider, ProviderModelMixin):
|
|
|
610
610
|
else:
|
|
611
611
|
continue
|
|
612
612
|
|
|
613
|
-
if b"<think>" in line:
|
|
614
|
-
m = line_pattern.match(line)
|
|
615
|
-
if m:
|
|
616
|
-
capturing_ref_id = m.group(1).decode()
|
|
617
|
-
capturing_lines = [line]
|
|
618
|
-
continue
|
|
619
|
-
|
|
620
613
|
match = line_pattern.match(line)
|
|
621
614
|
if not match:
|
|
615
|
+
if b"<think>" in line:
|
|
616
|
+
m = line_pattern.match(line)
|
|
617
|
+
if m:
|
|
618
|
+
capturing_ref_id = m.group(1).decode()
|
|
619
|
+
capturing_lines = [line]
|
|
620
|
+
continue
|
|
622
621
|
continue
|
|
623
622
|
|
|
624
623
|
chunk_id, chunk_data = match.groups()
|
|
@@ -747,7 +746,7 @@ class Yupp(AsyncGeneratorProvider, ProviderModelMixin):
|
|
|
747
746
|
):
|
|
748
747
|
stream["quick"].append(chunk)
|
|
749
748
|
quick_content += content
|
|
750
|
-
yield
|
|
749
|
+
yield PreviewResponse(content)
|
|
751
750
|
|
|
752
751
|
elif chunk_id in [turn_id, persisted_turn_id]:
|
|
753
752
|
pass
|
|
@@ -776,7 +775,7 @@ class Yupp(AsyncGeneratorProvider, ProviderModelMixin):
|
|
|
776
775
|
if variant_image is not None:
|
|
777
776
|
yield variant_image
|
|
778
777
|
elif variant_text:
|
|
779
|
-
yield
|
|
778
|
+
yield VariantResponse(variant_text)
|
|
780
779
|
yield JsonResponse(**stream)
|
|
781
780
|
log_debug(f"Finished processing {line_count} lines")
|
|
782
781
|
|
g4f/Provider/yupp/models.py
CHANGED
|
@@ -17,16 +17,19 @@ class ModelConfig:
|
|
|
17
17
|
class YuppAPIClient:
|
|
18
18
|
"""Yupp API client for fetching model data"""
|
|
19
19
|
|
|
20
|
-
def __init__(self, config: ModelConfig = None, api_key: str = None):
|
|
20
|
+
def __init__(self, config: ModelConfig = None, api_key: str = None, session=None):
|
|
21
21
|
self.config = config or ModelConfig()
|
|
22
|
-
self.session = requests.Session()
|
|
23
22
|
self.api_key = api_key
|
|
24
|
-
|
|
23
|
+
if session is None:
|
|
24
|
+
self.session = requests.Session()
|
|
25
|
+
self._setup_session()
|
|
26
|
+
else:
|
|
27
|
+
self.session = session
|
|
28
|
+
self._set_cookies()
|
|
25
29
|
|
|
26
30
|
def _setup_session(self) -> None:
|
|
27
31
|
"""Setup session with headers and cookies"""
|
|
28
32
|
self.session.headers.update(self._get_headers())
|
|
29
|
-
self._set_cookies()
|
|
30
33
|
|
|
31
34
|
def _get_headers(self) -> Dict[str, str]:
|
|
32
35
|
"""Get request headers"""
|
|
@@ -224,9 +227,9 @@ class DataManager:
|
|
|
224
227
|
class YuppModelManager:
|
|
225
228
|
"""Main manager class for Yupp model operations"""
|
|
226
229
|
|
|
227
|
-
def __init__(self, config: ModelConfig = None, api_key: str = None):
|
|
230
|
+
def __init__(self, config: ModelConfig = None, api_key: str = None, session=None):
|
|
228
231
|
self.config = config or ModelConfig()
|
|
229
|
-
self.client = YuppAPIClient(config, api_key)
|
|
232
|
+
self.client = YuppAPIClient(config, api_key, session)
|
|
230
233
|
self.processor = ModelProcessor()
|
|
231
234
|
self.data_manager = DataManager()
|
|
232
235
|
|
|
@@ -31,7 +31,7 @@ g4f/Provider/StringableInference.py,sha256=ZohMZrVAn6G82zrYpLTvELkzfds4nxu09lx7w
|
|
|
31
31
|
g4f/Provider/TeachAnything.py,sha256=ST87YdOdxtIc5JMaKzGdVy9J9wlhdhYIchRtXBljIBU,2843
|
|
32
32
|
g4f/Provider/WeWordle.py,sha256=ocKEfMYBKWPzv2WoDntn-WC-DkrSg5b_ipL9VYhTgsw,7007
|
|
33
33
|
g4f/Provider/Yqcloud.py,sha256=xzX-G-Lv0pyOHTypSJdavmbm3GPxnL-wRoT3VmjzUIM,3213
|
|
34
|
-
g4f/Provider/Yupp.py,sha256=
|
|
34
|
+
g4f/Provider/Yupp.py,sha256=obj5AGZmWGG_ODRxN1YvVMYQLe4-kqX6uEkVNJDNjNs,32399
|
|
35
35
|
g4f/Provider/__init__.py,sha256=l6qxw1XlGgFqTTI2Q8YjlP-Yr17viOiPj1eaU8K9LEo,2782
|
|
36
36
|
g4f/Provider/base_provider.py,sha256=lAd80-2hO1kzs9n9TUKv6fR4zHjSdZBqVErpm_gna9o,199
|
|
37
37
|
g4f/Provider/helper.py,sha256=_4fO_b2U8BnpuF6kijUM4SaFbX2Pcz6mksxK9mVXhP4,111
|
|
@@ -57,7 +57,7 @@ g4f/Provider/hf_space/raise_for_status.py,sha256=xoVwrZSwJUvqQkSfeUAMUst8SyobpSK
|
|
|
57
57
|
g4f/Provider/local/Local.py,sha256=b6vSZcr5CfEXD5GMqNtwCfXNJtKyWKPg3jqBWJEZEwQ,1251
|
|
58
58
|
g4f/Provider/local/Ollama.py,sha256=uefFwppGhqkC4WdbbaxktatJKkHaY7_OEkwBY_VSnSU,3816
|
|
59
59
|
g4f/Provider/local/__init__.py,sha256=cEFsdfkq0bgVAIM__Sxc6WfIoGa3_Ymol26kQb6x14k,73
|
|
60
|
-
g4f/Provider/needs_auth/AIBadgr.py,sha256=
|
|
60
|
+
g4f/Provider/needs_auth/AIBadgr.py,sha256=Oc05Cs-x40sF7tcrAyUqyoZ-TbtmV4wnMIm5aEjQ0xw,420
|
|
61
61
|
g4f/Provider/needs_auth/Anthropic.py,sha256=-8hRSpSGaC3-AzhkuIsf1K1w8ZVKKb_T6Pwy3N8JPak,10200
|
|
62
62
|
g4f/Provider/needs_auth/Azure.py,sha256=NMQyNvPN4qwP6bDFDGfXTaW0pvUCQUJGT7M6Yv25miQ,6152
|
|
63
63
|
g4f/Provider/needs_auth/BingCreateImages.py,sha256=_GrPx7KuttKrQ4IKX0fFwDPVsiCW9xTLycULNClZ6KQ,2066
|
|
@@ -139,7 +139,7 @@ g4f/Provider/template/BackendApi.py,sha256=XzzK-Eodit5h__EfJKwak7UDr_WUR3SXif6oR
|
|
|
139
139
|
g4f/Provider/template/OpenaiTemplate.py,sha256=qjuIORIXyWHE4DRpDNt8MUDtlbGFpPfK17E9g7Msy6U,12393
|
|
140
140
|
g4f/Provider/template/__init__.py,sha256=FmQdc8a8YLN5kW0mos2owDekq01rU0lv7bdmiAW-f5A,77
|
|
141
141
|
g4f/Provider/yupp/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
142
|
-
g4f/Provider/yupp/models.py,sha256=
|
|
142
|
+
g4f/Provider/yupp/models.py,sha256=oXMyfnDYievE1q92arOVxrhy_QpsBzICtoZesJUY-Po,10225
|
|
143
143
|
g4f/api/__init__.py,sha256=n482iWw4NSLUnCnOOxGJ_SIN6WpPXhRKJCNFZYnQe1Y,41358
|
|
144
144
|
g4f/api/_logging.py,sha256=7fh8hjDzp6NeMUbuNJ30UnWFu86KA2FEI0EsaIhw1Kc,910
|
|
145
145
|
g4f/api/_tokenizer.py,sha256=0Kbd6sM_8jQ3ph-1jM4JZeBCOAWsAv4iaxzHtdwHqto,286
|
|
@@ -210,9 +210,9 @@ g4f/tools/files.py,sha256=bUTbeNp8ujTZQiW3GLTtFcgl3-1AnH3cDyIKHfh6Mjc,23397
|
|
|
210
210
|
g4f/tools/media.py,sha256=AE9hGVRxQBVZzQ_Ylzeoo2TJUGXSBXO5RbLwj1I2ZTE,4701
|
|
211
211
|
g4f/tools/run_tools.py,sha256=Yb0osWdDt4wUnkvwln4R6qcLapdddC3n2giZMPXWkzM,16662
|
|
212
212
|
g4f/tools/web_search.py,sha256=vAZJD-qy15llsgAbkXzoEltqdFB6TlKLbqDJ1DS-6vs,2086
|
|
213
|
-
g4f-6.9.
|
|
214
|
-
g4f-6.9.
|
|
215
|
-
g4f-6.9.
|
|
216
|
-
g4f-6.9.
|
|
217
|
-
g4f-6.9.
|
|
218
|
-
g4f-6.9.
|
|
213
|
+
g4f-6.9.3.dist-info/licenses/LICENSE,sha256=ixuiBLtpoK3iv89l7ylKkg9rs2GzF9ukPH7ynZYzK5s,35148
|
|
214
|
+
g4f-6.9.3.dist-info/METADATA,sha256=mEgwWwkW3kCL-p0A9h0aEUPWG3rKwWLFE7lts4-VZZw,23255
|
|
215
|
+
g4f-6.9.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
216
|
+
g4f-6.9.3.dist-info/entry_points.txt,sha256=J7Usl6dNjXJlvuzGAUEm6cuDXWpVdGq7SfK-tPoiZSI,67
|
|
217
|
+
g4f-6.9.3.dist-info/top_level.txt,sha256=bMRlTupWYCcLWy80AnnKZkhpBsXsF8gI3BaMhSZSgRo,4
|
|
218
|
+
g4f-6.9.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|