g4f 6.9.9__tar.gz → 7.0.0__tar.gz

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.
Files changed (222) hide show
  1. {g4f-6.9.9/g4f.egg-info → g4f-7.0.0}/PKG-INFO +4 -2
  2. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/PollinationsAI.py +3 -1
  3. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/Yupp.py +215 -73
  4. {g4f-6.9.9 → g4f-7.0.0}/g4f/errors.py +1 -1
  5. {g4f-6.9.9 → g4f-7.0.0}/g4f/gui/server/backend_api.py +1 -1
  6. {g4f-6.9.9 → g4f-7.0.0}/g4f/mcp/server.py +112 -0
  7. {g4f-6.9.9 → g4f-7.0.0}/g4f/mcp/tools.py +1 -2
  8. {g4f-6.9.9 → g4f-7.0.0}/g4f/providers/asyncio.py +2 -2
  9. {g4f-6.9.9 → g4f-7.0.0/g4f.egg-info}/PKG-INFO +4 -2
  10. {g4f-6.9.9 → g4f-7.0.0}/g4f.egg-info/requires.txt +3 -1
  11. {g4f-6.9.9 → g4f-7.0.0}/setup.py +5 -3
  12. {g4f-6.9.9 → g4f-7.0.0}/LICENSE +0 -0
  13. {g4f-6.9.9 → g4f-7.0.0}/MANIFEST.in +0 -0
  14. {g4f-6.9.9 → g4f-7.0.0}/README.md +0 -0
  15. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/ApiAirforce.py +0 -0
  16. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/Chatai.py +0 -0
  17. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/Cloudflare.py +0 -0
  18. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/Copilot.py +0 -0
  19. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/CopilotSession.py +0 -0
  20. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/DeepInfra.py +0 -0
  21. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/EasyChat.py +0 -0
  22. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/GLM.py +0 -0
  23. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/GradientNetwork.py +0 -0
  24. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/ItalyGPT.py +0 -0
  25. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/LambdaChat.py +0 -0
  26. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/Mintlify.py +0 -0
  27. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/OIVSCodeSer.py +0 -0
  28. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/OperaAria.py +0 -0
  29. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/Perplexity.py +0 -0
  30. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/PollinationsImage.py +0 -0
  31. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/Qwen.py +0 -0
  32. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/TeachAnything.py +0 -0
  33. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/WeWordle.py +0 -0
  34. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/Yqcloud.py +0 -0
  35. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/__init__.py +0 -0
  36. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/audio/EdgeTTS.py +0 -0
  37. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/audio/MarkItDown.py +0 -0
  38. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/audio/OpenAIFM.py +0 -0
  39. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/audio/__init__.py +0 -0
  40. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/audio/gTTS.py +0 -0
  41. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/base_provider.py +0 -0
  42. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/helper.py +0 -0
  43. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/hf_space/BAAI_Ling.py +0 -0
  44. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/hf_space/BlackForestLabs_Flux1Dev.py +0 -0
  45. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/hf_space/BlackForestLabs_Flux1KontextDev.py +0 -0
  46. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/hf_space/CohereForAI_C4AI_Command.py +0 -0
  47. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/hf_space/DeepseekAI_JanusPro7b.py +0 -0
  48. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/hf_space/Microsoft_Phi_4_Multimodal.py +0 -0
  49. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/hf_space/Qwen_Qwen_2_5.py +0 -0
  50. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/hf_space/Qwen_Qwen_2_5M.py +0 -0
  51. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/hf_space/Qwen_Qwen_2_5_Max.py +0 -0
  52. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/hf_space/Qwen_Qwen_2_72B.py +0 -0
  53. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/hf_space/Qwen_Qwen_3.py +0 -0
  54. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/hf_space/StabilityAI_SD35Large.py +0 -0
  55. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/hf_space/__init__.py +0 -0
  56. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/hf_space/raise_for_status.py +0 -0
  57. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/local/Local.py +0 -0
  58. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/local/Ollama.py +0 -0
  59. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/local/__init__.py +0 -0
  60. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/needs_auth/AIBadgr.py +0 -0
  61. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/needs_auth/Anthropic.py +0 -0
  62. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/needs_auth/Azure.py +0 -0
  63. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/needs_auth/BingCreateImages.py +0 -0
  64. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/needs_auth/BlackboxPro.py +0 -0
  65. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/needs_auth/CablyAI.py +0 -0
  66. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/needs_auth/Cerebras.py +0 -0
  67. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/needs_auth/Claude.py +0 -0
  68. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/needs_auth/Cohere.py +0 -0
  69. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/needs_auth/CopilotAccount.py +0 -0
  70. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/needs_auth/Custom.py +0 -0
  71. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/needs_auth/DeepSeek.py +0 -0
  72. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/needs_auth/DeepSeekAPI.py +0 -0
  73. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/needs_auth/FenayAI.py +0 -0
  74. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/needs_auth/Gemini.py +0 -0
  75. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/needs_auth/GeminiCLI.py +0 -0
  76. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/needs_auth/GeminiPro.py +0 -0
  77. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/needs_auth/GigaChat.py +0 -0
  78. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/needs_auth/GithubCopilot.py +0 -0
  79. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/needs_auth/GithubCopilotAPI.py +0 -0
  80. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/needs_auth/GlhfChat.py +0 -0
  81. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/needs_auth/Grok.py +0 -0
  82. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/needs_auth/Groq.py +0 -0
  83. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/needs_auth/LMArena.py +0 -0
  84. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/needs_auth/MetaAI.py +0 -0
  85. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/needs_auth/MetaAIAccount.py +0 -0
  86. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/needs_auth/MicrosoftDesigner.py +0 -0
  87. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/needs_auth/Nvidia.py +0 -0
  88. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/needs_auth/OpenRouter.py +0 -0
  89. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/needs_auth/OpenaiAPI.py +0 -0
  90. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/needs_auth/OpenaiAccount.py +0 -0
  91. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/needs_auth/OpenaiChat.py +0 -0
  92. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/needs_auth/PerplexityApi.py +0 -0
  93. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/needs_auth/Pi.py +0 -0
  94. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/needs_auth/PuterJS.py +0 -0
  95. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/needs_auth/Reka.py +0 -0
  96. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/needs_auth/Replicate.py +0 -0
  97. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/needs_auth/ThebApi.py +0 -0
  98. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/needs_auth/Together.py +0 -0
  99. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/needs_auth/Video.py +0 -0
  100. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/needs_auth/WhiteRabbitNeo.py +0 -0
  101. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/needs_auth/You.py +0 -0
  102. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/needs_auth/__init__.py +0 -0
  103. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/needs_auth/bing/__init__.py +0 -0
  104. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/needs_auth/bing/create_images.py +0 -0
  105. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/needs_auth/hf/HuggingChat.py +0 -0
  106. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/needs_auth/hf/HuggingFaceAPI.py +0 -0
  107. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/needs_auth/hf/HuggingFaceInference.py +0 -0
  108. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/needs_auth/hf/HuggingFaceMedia.py +0 -0
  109. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/needs_auth/hf/__init__.py +0 -0
  110. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/needs_auth/hf/models.py +0 -0
  111. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/needs_auth/mini_max/HailuoAI.py +0 -0
  112. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/needs_auth/mini_max/MiniMax.py +0 -0
  113. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/needs_auth/mini_max/__init__.py +0 -0
  114. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/needs_auth/mini_max/crypt.py +0 -0
  115. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/needs_auth/xAI.py +0 -0
  116. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/openai/__init__.py +0 -0
  117. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/openai/crypt.py +0 -0
  118. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/openai/har_file.py +0 -0
  119. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/openai/models.py +0 -0
  120. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/openai/new.py +0 -0
  121. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/openai/proofofwork.py +0 -0
  122. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/qwen/QwenCode.py +0 -0
  123. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/qwen/__init__.py +0 -0
  124. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/qwen/cookie_generator.py +0 -0
  125. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/qwen/fingerprint.py +0 -0
  126. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/qwen/generate_ua.py +0 -0
  127. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/qwen/oauthFlow.py +0 -0
  128. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/qwen/qwenContentGenerator.py +0 -0
  129. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/qwen/qwenOAuth2.py +0 -0
  130. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/qwen/sharedTokenManager.py +0 -0
  131. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/qwen/stubs.py +0 -0
  132. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/search/CachedSearch.py +0 -0
  133. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/search/DDGS.py +0 -0
  134. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/search/GoogleSearch.py +0 -0
  135. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/search/SearXNG.py +0 -0
  136. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/search/YouTube.py +0 -0
  137. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/search/__init__.py +0 -0
  138. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/template/BackendApi.py +0 -0
  139. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/template/OpenaiTemplate.py +0 -0
  140. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/template/__init__.py +0 -0
  141. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/yupp/__init__.py +0 -0
  142. {g4f-6.9.9 → g4f-7.0.0}/g4f/Provider/yupp/models.py +0 -0
  143. {g4f-6.9.9 → g4f-7.0.0}/g4f/__init__.py +0 -0
  144. {g4f-6.9.9 → g4f-7.0.0}/g4f/__main__.py +0 -0
  145. {g4f-6.9.9 → g4f-7.0.0}/g4f/api/__init__.py +0 -0
  146. {g4f-6.9.9 → g4f-7.0.0}/g4f/api/_logging.py +0 -0
  147. {g4f-6.9.9 → g4f-7.0.0}/g4f/api/_tokenizer.py +0 -0
  148. {g4f-6.9.9 → g4f-7.0.0}/g4f/api/run.py +0 -0
  149. {g4f-6.9.9 → g4f-7.0.0}/g4f/api/stubs.py +0 -0
  150. {g4f-6.9.9 → g4f-7.0.0}/g4f/cli/__init__.py +0 -0
  151. {g4f-6.9.9 → g4f-7.0.0}/g4f/cli/__main__.py +0 -0
  152. {g4f-6.9.9 → g4f-7.0.0}/g4f/cli/client.py +0 -0
  153. {g4f-6.9.9 → g4f-7.0.0}/g4f/client/__init__.py +0 -0
  154. {g4f-6.9.9 → g4f-7.0.0}/g4f/client/helper.py +0 -0
  155. {g4f-6.9.9 → g4f-7.0.0}/g4f/client/models.py +0 -0
  156. {g4f-6.9.9 → g4f-7.0.0}/g4f/client/service.py +0 -0
  157. {g4f-6.9.9 → g4f-7.0.0}/g4f/client/stubs.py +0 -0
  158. {g4f-6.9.9 → g4f-7.0.0}/g4f/client/types.py +0 -0
  159. {g4f-6.9.9 → g4f-7.0.0}/g4f/config.py +0 -0
  160. {g4f-6.9.9 → g4f-7.0.0}/g4f/cookies.py +0 -0
  161. {g4f-6.9.9 → g4f-7.0.0}/g4f/debug.py +0 -0
  162. {g4f-6.9.9 → g4f-7.0.0}/g4f/files.py +0 -0
  163. {g4f-6.9.9 → g4f-7.0.0}/g4f/gui/__init__.py +0 -0
  164. {g4f-6.9.9 → g4f-7.0.0}/g4f/gui/gui_parser.py +0 -0
  165. {g4f-6.9.9 → g4f-7.0.0}/g4f/gui/run.py +0 -0
  166. {g4f-6.9.9 → g4f-7.0.0}/g4f/gui/server/__init__.py +0 -0
  167. {g4f-6.9.9 → g4f-7.0.0}/g4f/gui/server/api.py +0 -0
  168. {g4f-6.9.9 → g4f-7.0.0}/g4f/gui/server/app.py +0 -0
  169. {g4f-6.9.9 → g4f-7.0.0}/g4f/gui/server/config.py +0 -0
  170. {g4f-6.9.9 → g4f-7.0.0}/g4f/gui/server/crypto.py +0 -0
  171. {g4f-6.9.9 → g4f-7.0.0}/g4f/gui/server/internet.py +0 -0
  172. {g4f-6.9.9 → g4f-7.0.0}/g4f/gui/server/js_api.py +0 -0
  173. {g4f-6.9.9 → g4f-7.0.0}/g4f/gui/server/website.py +0 -0
  174. {g4f-6.9.9 → g4f-7.0.0}/g4f/gui/webview.py +0 -0
  175. {g4f-6.9.9 → g4f-7.0.0}/g4f/image/__init__.py +0 -0
  176. {g4f-6.9.9 → g4f-7.0.0}/g4f/image/copy_images.py +0 -0
  177. {g4f-6.9.9 → g4f-7.0.0}/g4f/integration/__init__.py +0 -0
  178. {g4f-6.9.9 → g4f-7.0.0}/g4f/integration/langchain.py +0 -0
  179. {g4f-6.9.9 → g4f-7.0.0}/g4f/integration/markitdown/__init__.py +0 -0
  180. {g4f-6.9.9 → g4f-7.0.0}/g4f/integration/markitdown/_audio_converter.py +0 -0
  181. {g4f-6.9.9 → g4f-7.0.0}/g4f/integration/markitdown/_base_converter.py +0 -0
  182. {g4f-6.9.9 → g4f-7.0.0}/g4f/integration/markitdown/_image_converter.py +0 -0
  183. {g4f-6.9.9 → g4f-7.0.0}/g4f/integration/markitdown/_llm_caption.py +0 -0
  184. {g4f-6.9.9 → g4f-7.0.0}/g4f/integration/markitdown/_transcribe_audio.py +0 -0
  185. {g4f-6.9.9 → g4f-7.0.0}/g4f/integration/markitdown/_youtube_converter.py +0 -0
  186. {g4f-6.9.9 → g4f-7.0.0}/g4f/integration/pydantic_ai.py +0 -0
  187. {g4f-6.9.9 → g4f-7.0.0}/g4f/local/__init__.py +0 -0
  188. {g4f-6.9.9 → g4f-7.0.0}/g4f/locals/__init__.py +0 -0
  189. {g4f-6.9.9 → g4f-7.0.0}/g4f/locals/models.py +0 -0
  190. {g4f-6.9.9 → g4f-7.0.0}/g4f/locals/provider.py +0 -0
  191. {g4f-6.9.9 → g4f-7.0.0}/g4f/mcp/__init__.py +0 -0
  192. {g4f-6.9.9 → g4f-7.0.0}/g4f/mcp/__main__.py +0 -0
  193. {g4f-6.9.9 → g4f-7.0.0}/g4f/models.py +0 -0
  194. {g4f-6.9.9 → g4f-7.0.0}/g4f/providers/__init__.py +0 -0
  195. {g4f-6.9.9 → g4f-7.0.0}/g4f/providers/any_model_map.py +0 -0
  196. {g4f-6.9.9 → g4f-7.0.0}/g4f/providers/any_provider.py +0 -0
  197. {g4f-6.9.9 → g4f-7.0.0}/g4f/providers/base_provider.py +0 -0
  198. {g4f-6.9.9 → g4f-7.0.0}/g4f/providers/create_images.py +0 -0
  199. {g4f-6.9.9 → g4f-7.0.0}/g4f/providers/helper.py +0 -0
  200. {g4f-6.9.9 → g4f-7.0.0}/g4f/providers/response.py +0 -0
  201. {g4f-6.9.9 → g4f-7.0.0}/g4f/providers/retry_provider.py +0 -0
  202. {g4f-6.9.9 → g4f-7.0.0}/g4f/providers/tool_support.py +0 -0
  203. {g4f-6.9.9 → g4f-7.0.0}/g4f/providers/types.py +0 -0
  204. {g4f-6.9.9 → g4f-7.0.0}/g4f/requests/__init__.py +0 -0
  205. {g4f-6.9.9 → g4f-7.0.0}/g4f/requests/aiohttp.py +0 -0
  206. {g4f-6.9.9 → g4f-7.0.0}/g4f/requests/curl_cffi.py +0 -0
  207. {g4f-6.9.9 → g4f-7.0.0}/g4f/requests/defaults.py +0 -0
  208. {g4f-6.9.9 → g4f-7.0.0}/g4f/requests/raise_for_status.py +0 -0
  209. {g4f-6.9.9 → g4f-7.0.0}/g4f/tools/__init__.py +0 -0
  210. {g4f-6.9.9 → g4f-7.0.0}/g4f/tools/auth.py +0 -0
  211. {g4f-6.9.9 → g4f-7.0.0}/g4f/tools/fetch_and_scrape.py +0 -0
  212. {g4f-6.9.9 → g4f-7.0.0}/g4f/tools/files.py +0 -0
  213. {g4f-6.9.9 → g4f-7.0.0}/g4f/tools/media.py +0 -0
  214. {g4f-6.9.9 → g4f-7.0.0}/g4f/tools/run_tools.py +0 -0
  215. {g4f-6.9.9 → g4f-7.0.0}/g4f/tools/web_search.py +0 -0
  216. {g4f-6.9.9 → g4f-7.0.0}/g4f/typing.py +0 -0
  217. {g4f-6.9.9 → g4f-7.0.0}/g4f/version.py +0 -0
  218. {g4f-6.9.9 → g4f-7.0.0}/g4f.egg-info/SOURCES.txt +0 -0
  219. {g4f-6.9.9 → g4f-7.0.0}/g4f.egg-info/dependency_links.txt +0 -0
  220. {g4f-6.9.9 → g4f-7.0.0}/g4f.egg-info/entry_points.txt +0 -0
  221. {g4f-6.9.9 → g4f-7.0.0}/g4f.egg-info/top_level.txt +0 -0
  222. {g4f-6.9.9 → g4f-7.0.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: g4f
3
- Version: 6.9.9
3
+ Version: 7.0.0
4
4
  Summary: The official gpt4free repository | various collection of powerful language models
5
5
  Home-page: https://github.com/xtekky/gpt4free
6
6
  Author: Tekky
@@ -20,7 +20,7 @@ Requires-Dist: requests
20
20
  Requires-Dist: aiohttp
21
21
  Requires-Dist: brotli
22
22
  Requires-Dist: pycryptodome
23
- Requires-Dist: nest_asyncio
23
+ Requires-Dist: nest-asyncio2
24
24
  Provides-Extra: all
25
25
  Requires-Dist: curl_cffi>=0.6.2; extra == "all"
26
26
  Requires-Dist: certifi; extra == "all"
@@ -42,6 +42,7 @@ Requires-Dist: setuptools; extra == "all"
42
42
  Requires-Dist: markitdown[all]; extra == "all"
43
43
  Requires-Dist: python-dotenv; extra == "all"
44
44
  Requires-Dist: aiofile; extra == "all"
45
+ Requires-Dist: cloudscraper; extra == "all"
45
46
  Provides-Extra: slim
46
47
  Requires-Dist: curl_cffi>=0.6.2; extra == "slim"
47
48
  Requires-Dist: certifi; extra == "slim"
@@ -61,6 +62,7 @@ Requires-Dist: pypdf2; extra == "slim"
61
62
  Requires-Dist: python-docx; extra == "slim"
62
63
  Requires-Dist: python-dotenv; extra == "slim"
63
64
  Requires-Dist: aiofile; extra == "slim"
65
+ Requires-Dist: cloudscraper; extra == "slim"
64
66
  Provides-Extra: image
65
67
  Requires-Dist: pillow; extra == "image"
66
68
  Requires-Dist: cairosvg; extra == "image"
@@ -263,6 +263,8 @@ class PollinationsAI(AsyncGeneratorProvider, ProviderModelMixin):
263
263
  has_audio = True
264
264
  break
265
265
  model = "openai-audio" if has_audio else cls.default_model
266
+ if not api_key:
267
+ api_key = AuthManager.load_api_key(cls)
266
268
  if cls.get_models(api_key=api_key, timeout=kwargs.get("timeout", 15)):
267
269
  if model in cls.model_aliases:
268
270
  model = cls.model_aliases[model]
@@ -379,7 +381,7 @@ class PollinationsAI(AsyncGeneratorProvider, ProviderModelMixin):
379
381
  return f"{url}&seed={seed}" if seed else url
380
382
 
381
383
  headers = None
382
- if api_key and api_key.startswith("g4f_") or api_key.startswith("gfs_"):
384
+ if api_key and (api_key.startswith("g4f_") or api_key.startswith("gfs_")):
383
385
  headers = {"authorization": f"Bearer {api_key}"}
384
386
  async with ClientSession(
385
387
  headers=DEFAULT_HEADERS,
@@ -6,12 +6,15 @@ import re
6
6
  import time
7
7
  import uuid
8
8
  from concurrent.futures import ThreadPoolExecutor
9
+ from typing import Optional, Dict, Any, List
9
10
 
10
11
  try:
11
12
  import cloudscraper
12
13
  from cloudscraper import CloudScraper
14
+ has_cloudscraper = True
13
15
  except ImportError:
14
16
  from typing import Type as CloudScraper
17
+ has_cloudscraper = False
15
18
 
16
19
  from .helper import get_last_user_message
17
20
  from .yupp.models import YuppModelManager
@@ -20,17 +23,27 @@ from ..debug import log
20
23
  from ..errors import RateLimitError, ProviderException, MissingAuthError, MissingRequirementsError
21
24
  from ..image import is_accepted_format, to_bytes
22
25
  from ..providers.base_provider import AsyncGeneratorProvider, ProviderModelMixin
23
- from ..providers.response import Reasoning, PlainTextResponse, PreviewResponse, JsonConversation, ImageResponse, \
24
- ProviderInfo, FinishReason, JsonResponse, VariantResponse
26
+ from ..providers.response import (
27
+ Reasoning,
28
+ PlainTextResponse,
29
+ PreviewResponse,
30
+ JsonConversation,
31
+ ImageResponse,
32
+ ProviderInfo,
33
+ FinishReason,
34
+ JsonResponse,
35
+ VariantResponse,
36
+ )
25
37
  from ..tools.auth import AuthManager
26
38
  from ..tools.media import merge_media
27
- from ..typing import AsyncResult, Messages, Optional, Dict, Any, List
39
+ from ..typing import AsyncResult, Messages
28
40
 
29
41
  YUPP_ACCOUNTS: List[Dict[str, Any]] = []
30
42
  account_rotation_lock = asyncio.Lock()
31
43
  ImagesCache: Dict[str, dict] = {}
32
44
  _accounts_loaded = False
33
- _executor = ThreadPoolExecutor(max_workers=10)
45
+ _executor = ThreadPoolExecutor(max_workers=32)
46
+ MAX_CACHE_SIZE = 1000
34
47
 
35
48
 
36
49
  def create_scraper():
@@ -87,10 +100,10 @@ async def get_best_yupp_account() -> Optional[Dict[str, Any]]:
87
100
  acc
88
101
  for acc in YUPP_ACCOUNTS
89
102
  if acc["is_valid"]
90
- and (
91
- acc["error_count"] < max_error_count
92
- or now - acc["last_used"] > error_cooldown
93
- )
103
+ and (
104
+ acc["error_count"] < max_error_count
105
+ or now - acc["last_used"] > error_cooldown
106
+ )
94
107
  ]
95
108
 
96
109
  if not valid_accounts:
@@ -98,8 +111,8 @@ async def get_best_yupp_account() -> Optional[Dict[str, Any]]:
98
111
 
99
112
  for acc in valid_accounts:
100
113
  if (
101
- acc["error_count"] >= max_error_count
102
- and now - acc["last_used"] > error_cooldown
114
+ acc["error_count"] >= max_error_count
115
+ and now - acc["last_used"] > error_cooldown
103
116
  ):
104
117
  acc["error_count"] = 0
105
118
 
@@ -109,11 +122,11 @@ async def get_best_yupp_account() -> Optional[Dict[str, Any]]:
109
122
  return account
110
123
 
111
124
 
112
- def sync_claim_yupp_reward(scraper: CloudScraper, account: Dict[str, Any], reward_id: str):
125
+ def sync_claim_yupp_reward(scraper: CloudScraper, account: Dict[str, Any], eval_id: str):
113
126
  try:
114
- log_debug(f"Claiming reward {reward_id}...")
127
+ log_debug(f"Claiming reward {eval_id}...")
115
128
  url = "https://yupp.ai/api/trpc/reward.claim?batch=1"
116
- payload = {"0": {"json": {"rewardId": reward_id}}}
129
+ payload = {"0": {"json": {"evalId": eval_id}}}
117
130
  scraper.cookies.set("__Secure-yupp.session-token", account['token'])
118
131
  response = scraper.post(url, json=payload)
119
132
  response.raise_for_status()
@@ -122,13 +135,104 @@ def sync_claim_yupp_reward(scraper: CloudScraper, account: Dict[str, Any], rewar
122
135
  log_debug(f"Reward claimed successfully. New balance: {balance}")
123
136
  return balance
124
137
  except Exception as e:
125
- log_debug(f"Failed to claim reward {reward_id}. Error: {e}")
138
+ log_debug(f"Failed to claim reward {eval_id}. Error: {e}")
139
+ return None
140
+
141
+
142
+ async def claim_yupp_reward(scraper: CloudScraper, account: Dict[str, Any], eval_id: str):
143
+ loop = asyncio.get_event_loop()
144
+ return await loop.run_in_executor(_executor, sync_claim_yupp_reward, scraper, account, eval_id)
145
+
146
+
147
+ def sync_record_model_feedback(
148
+ scraper: CloudScraper,
149
+ account: Dict[str, Any],
150
+ turn_id: str,
151
+ left_message_id: str,
152
+ right_message_id: str
153
+ ) -> Optional[str]:
154
+ try:
155
+ log_debug(f"Recording model feedback for turn {turn_id}...")
156
+ url = "https://yupp.ai/api/trpc/evals.recordModelFeedback?batch=1"
157
+ payload = {
158
+ "0": {
159
+ "json": {
160
+ "turnId": turn_id,
161
+ "evalType": "SELECTION",
162
+ "messageEvals": [
163
+ {
164
+ "messageId": right_message_id,
165
+ "rating": "GOOD",
166
+ "reasons": ["Fast"]
167
+ },
168
+ {
169
+ "messageId": left_message_id,
170
+ "rating": "BAD",
171
+ "reasons": []
172
+ }
173
+ ],
174
+ "comment": "",
175
+ "requireReveal": False
176
+ }
177
+ }
178
+ }
179
+ scraper.cookies.set("__Secure-yupp.session-token", account['token'])
180
+ response = scraper.post(url, json=payload)
181
+ response.raise_for_status()
182
+ data = response.json()
183
+
184
+ for result in data:
185
+ json_data = result.get("result", {}).get("data", {}).get("json", {})
186
+ eval_id = json_data.get("evalId")
187
+ final_reward = json_data.get("finalRewardAmount")
188
+ log_debug(f"Feedback recorded - evalId: {eval_id}, reward: {final_reward}")
189
+
190
+ if final_reward:
191
+ return eval_id
192
+ return None
193
+ except Exception as e:
194
+ log_debug(f"Failed to record model feedback. Error: {e}")
126
195
  return None
127
196
 
128
197
 
129
- async def claim_yupp_reward(scraper: CloudScraper, account: Dict[str, Any], reward_id: str):
198
+ async def record_model_feedback(
199
+ scraper: CloudScraper,
200
+ account: Dict[str, Any],
201
+ turn_id: str,
202
+ left_message_id: str,
203
+ right_message_id: str
204
+ ) -> Optional[str]:
205
+ loop = asyncio.get_event_loop()
206
+ return await loop.run_in_executor(
207
+ _executor, sync_record_model_feedback, scraper, account, turn_id, left_message_id, right_message_id
208
+ )
209
+
210
+
211
+ def sync_delete_chat(scraper: CloudScraper, account: Dict[str, Any], chat_id: str) -> bool:
212
+ try:
213
+ log_debug(f"Deleting chat {chat_id}...")
214
+ url = "https://yupp.ai/api/trpc/chat.deleteChat?batch=1"
215
+ payload = {"0": {"json": {"chatId": chat_id}}}
216
+ scraper.cookies.set("__Secure-yupp.session-token", account['token'])
217
+ response = scraper.post(url, json=payload)
218
+ response.raise_for_status()
219
+ data = response.json()
220
+ if (
221
+ isinstance(data, list) and len(data) > 0
222
+ and data[0].get("result", {}).get("data", {}).get("json") is None
223
+ ):
224
+ log_debug(f"Chat {chat_id} deleted successfully")
225
+ return True
226
+ log_debug(f"Unexpected response while deleting chat: {data}")
227
+ return False
228
+ except Exception as e:
229
+ log_debug(f"Failed to delete chat {chat_id}: {e}")
230
+ return False
231
+
232
+
233
+ async def delete_chat(scraper: CloudScraper, account: Dict[str, Any], chat_id: str) -> bool:
130
234
  loop = asyncio.get_event_loop()
131
- return await loop.run_in_executor(_executor, sync_claim_yupp_reward, scraper, account, reward_id)
235
+ return await loop.run_in_executor(_executor, sync_delete_chat, scraper, account, chat_id)
132
236
 
133
237
 
134
238
  def sync_make_chat_private(scraper: CloudScraper, account: Dict[str, Any], chat_id: str) -> bool:
@@ -148,8 +252,8 @@ def sync_make_chat_private(scraper: CloudScraper, account: Dict[str, Any], chat_
148
252
  response.raise_for_status()
149
253
  data = response.json()
150
254
  if (
151
- isinstance(data, list) and len(data) > 0
152
- and "json" in data[0].get("result", {}).get("data", {})
255
+ isinstance(data, list) and len(data) > 0
256
+ and "json" in data[0].get("result", {}).get("data", {})
153
257
  ):
154
258
  log_debug(f"Chat {chat_id} is now PRIVATE")
155
259
  return True
@@ -205,10 +309,18 @@ def format_messages_for_yupp(messages: Messages) -> str:
205
309
  return result
206
310
 
207
311
 
312
+ def evict_cache_if_needed():
313
+ global ImagesCache
314
+ if len(ImagesCache) > MAX_CACHE_SIZE:
315
+ keys_to_remove = list(ImagesCache.keys())[:len(ImagesCache) - MAX_CACHE_SIZE + 100]
316
+ for key in keys_to_remove:
317
+ del ImagesCache[key]
318
+
319
+
208
320
  class Yupp(AsyncGeneratorProvider, ProviderModelMixin):
209
321
  url = "https://yupp.ai"
210
322
  login_url = "https://discord.gg/qXA4Wf4Fsm"
211
- working = CloudScraper is not None
323
+ working = has_cloudscraper
212
324
  active_by_default = True
213
325
  supports_stream = True
214
326
  image_cache = True
@@ -228,8 +340,10 @@ class Yupp(AsyncGeneratorProvider, ProviderModelMixin):
228
340
  cls.models_tags = {model.get("name"): manager.processor.generate_tags(model) for model in models}
229
341
  cls.models = [model.get("name") for model in models]
230
342
  cls.image_models = [model.get("name") for model in models if model.get("isImageGeneration")]
231
- cls.vision_models = [model.get("name") for model in models if
232
- "image/*" in model.get("supportedAttachmentMimeTypes", [])]
343
+ cls.vision_models = [
344
+ model.get("name") for model in models
345
+ if "image/*" in model.get("supportedAttachmentMimeTypes", [])
346
+ ]
233
347
  return cls.models
234
348
 
235
349
  @classmethod
@@ -271,8 +385,15 @@ class Yupp(AsyncGeneratorProvider, ProviderModelMixin):
271
385
 
272
386
  attachment_resp = scraper.post(
273
387
  "https://yupp.ai/api/trpc/chat.createAttachmentForUploadedFile?batch=1",
274
- json={"0": {"json": {"fileName": name, "contentType": is_accepted_format(data),
275
- "fileId": upload_info["fileId"]}}},
388
+ json={
389
+ "0": {
390
+ "json": {
391
+ "fileName": name,
392
+ "contentType": is_accepted_format(data),
393
+ "fileId": upload_info["fileId"]
394
+ }
395
+ }
396
+ },
276
397
  cookies={"__Secure-yupp.session-token": account["token"]}
277
398
  )
278
399
  attachment_resp.raise_for_status()
@@ -283,6 +404,7 @@ class Yupp(AsyncGeneratorProvider, ProviderModelMixin):
283
404
  "attachmentId": attachment["attachment_id"],
284
405
  "chatMessageId": ""
285
406
  }
407
+ evict_cache_if_needed()
286
408
  ImagesCache[image_hash] = file_info
287
409
  files.append(file_info)
288
410
  return files
@@ -314,23 +436,26 @@ class Yupp(AsyncGeneratorProvider, ProviderModelMixin):
314
436
  return await loop.run_in_executor(_executor, cls.sync_get_signed_image, scraper, image_id)
315
437
 
316
438
  @classmethod
317
- def sync_stream_request(cls, scraper: CloudScraper, url: str, payload: list, headers: dict,
318
- timeout: int):
439
+ def sync_stream_request(cls, scraper: CloudScraper, url: str, payload: list, headers: dict, timeout: int):
319
440
  response = scraper.post(url, json=payload, headers=headers, stream=True, timeout=timeout)
320
441
  response.raise_for_status()
321
442
  return response
322
443
 
323
444
  @classmethod
324
445
  async def create_async_generator(
325
- cls,
326
- model: str,
327
- messages: Messages,
328
- proxy: str = None,
329
- **kwargs,
446
+ cls,
447
+ model: str,
448
+ messages: Messages,
449
+ proxy: str = None,
450
+ api_key: str = None,
451
+ **kwargs,
330
452
  ) -> AsyncResult:
331
- if CloudScraper is None:
332
- raise MissingRequirementsError("cloudscraper library is required for Yupp provider | install it via 'pip install cloudscraper'")
333
- api_key = kwargs.get("api_key")
453
+ if not has_cloudscraper:
454
+ raise MissingRequirementsError(
455
+ "cloudscraper library is required for Yupp provider | install it via 'pip install cloudscraper'"
456
+ )
457
+ if not api_key:
458
+ api_key = AuthManager.load_api_key(cls)
334
459
  if not api_key:
335
460
  api_key = get_cookies("yupp.ai", False).get("__Secure-yupp.session-token")
336
461
  if api_key:
@@ -351,7 +476,8 @@ class Yupp(AsyncGeneratorProvider, ProviderModelMixin):
351
476
  prompt = get_last_user_message(messages, prompt)
352
477
 
353
478
  log_debug(
354
- f"Use url_uuid: {url_uuid}, Formatted prompt length: {len(prompt)}, Is new conversation: {is_new_conversation}")
479
+ f"Use url_uuid: {url_uuid}, Formatted prompt length: {len(prompt)}, Is new conversation: {is_new_conversation}"
480
+ )
355
481
 
356
482
  max_attempts = len(YUPP_ACCOUNTS)
357
483
  for attempt in range(max_attempts):
@@ -437,10 +563,13 @@ class Yupp(AsyncGeneratorProvider, ProviderModelMixin):
437
563
  timeout
438
564
  )
439
565
 
440
- asyncio.create_task(make_chat_private(scraper, account, url_uuid))
441
-
442
- async for chunk in cls._process_stream_response(response, account, scraper, prompt, model):
443
- yield chunk
566
+ try:
567
+ async for chunk in cls._process_stream_response(response, account, scraper, prompt, model):
568
+ yield chunk
569
+ finally:
570
+ response.close()
571
+ if not kwargs.get("conversation"):
572
+ asyncio.create_task(delete_chat(scraper, account, url_uuid))
444
573
  return
445
574
 
446
575
  except RateLimitError:
@@ -462,7 +591,8 @@ class Yupp(AsyncGeneratorProvider, ProviderModelMixin):
462
591
  log_debug(f"Unexpected error with account ...{account['token'][-4:]}: {str(e)}")
463
592
  error_str = str(e).lower()
464
593
  if "500" in error_str or "internal server error" in error_str:
465
- account["is_valid"] = False
594
+ async with account_rotation_lock:
595
+ account["error_count"] += 1
466
596
  continue
467
597
  async with account_rotation_lock:
468
598
  account["error_count"] += 1
@@ -472,12 +602,12 @@ class Yupp(AsyncGeneratorProvider, ProviderModelMixin):
472
602
 
473
603
  @classmethod
474
604
  async def _process_stream_response(
475
- cls,
476
- response,
477
- account: Dict[str, Any],
478
- scraper: CloudScraper,
479
- prompt: str,
480
- model_id: str
605
+ cls,
606
+ response,
607
+ account: Dict[str, Any],
608
+ scraper: CloudScraper,
609
+ prompt: str,
610
+ model_id: str
481
611
  ) -> AsyncResult:
482
612
  line_pattern = re.compile(b"^([0-9a-fA-F]+):(.*)")
483
613
  target_stream_id = None
@@ -562,6 +692,7 @@ class Yupp(AsyncGeneratorProvider, ProviderModelMixin):
562
692
  is_started: bool = False
563
693
  variant_image: Optional[ImageResponse] = None
564
694
  reward_id = "a"
695
+ reward_kw = {}
565
696
  routing_id = "e"
566
697
  turn_id = None
567
698
  persisted_turn_id = None
@@ -642,7 +773,8 @@ class Yupp(AsyncGeneratorProvider, ProviderModelMixin):
642
773
  right_stream = data.get("rightStream", {})
643
774
  if data.get("quickResponse", {}) != "$undefined":
644
775
  quick_response_id = extract_ref_id(
645
- data.get("quickResponse", {}).get("stream", {}).get("next"))
776
+ data.get("quickResponse", {}).get("stream", {}).get("next")
777
+ )
646
778
 
647
779
  if data.get("turnId", {}) != "$undefined":
648
780
  turn_id = extract_ref_id(data.get("turnId", {}).get("next"))
@@ -693,20 +825,20 @@ class Yupp(AsyncGeneratorProvider, ProviderModelMixin):
693
825
  if ref_name in image_blocks:
694
826
  img_block_text = image_blocks[ref_name]
695
827
  async for chunk in process_content_chunk(
696
- img_block_text,
697
- ref_name,
698
- line_count,
699
- for_target=True
828
+ img_block_text,
829
+ ref_name,
830
+ line_count,
831
+ for_target=True
700
832
  ):
701
833
  stream["target"].append(chunk)
702
834
  is_started = True
703
835
  yield chunk
704
836
  else:
705
837
  async for chunk in process_content_chunk(
706
- content,
707
- chunk_id,
708
- line_count,
709
- for_target=True
838
+ content,
839
+ chunk_id,
840
+ line_count,
841
+ for_target=True
710
842
  ):
711
843
  stream["target"].append(chunk)
712
844
  is_started = True
@@ -719,10 +851,10 @@ class Yupp(AsyncGeneratorProvider, ProviderModelMixin):
719
851
  content = data.get("curr", "")
720
852
  if content:
721
853
  async for chunk in process_content_chunk(
722
- content,
723
- chunk_id,
724
- line_count,
725
- for_target=False
854
+ content,
855
+ chunk_id,
856
+ line_count,
857
+ for_target=False
726
858
  ):
727
859
  stream["variant"].append(chunk)
728
860
  if isinstance(chunk, ImageResponse):
@@ -738,32 +870,35 @@ class Yupp(AsyncGeneratorProvider, ProviderModelMixin):
738
870
  content = data.get("curr", "")
739
871
  if content:
740
872
  async for chunk in process_content_chunk(
741
- content,
742
- chunk_id,
743
- line_count,
744
- for_target=False
873
+ content,
874
+ chunk_id,
875
+ line_count,
876
+ for_target=False
745
877
  ):
746
878
  stream["quick"].append(chunk)
747
879
  quick_content += content
748
880
  yield PreviewResponse(content)
749
881
 
750
- elif chunk_id in [turn_id, persisted_turn_id]:
882
+ elif chunk_id == turn_id:
883
+ reward_kw["turn_id"] = data.get("curr", "")
884
+
885
+ elif chunk_id == persisted_turn_id:
751
886
  pass
752
887
 
753
888
  elif chunk_id == right_message_id:
754
- pass
889
+ reward_kw["right_message_id"] = data.get("curr", "")
755
890
 
756
891
  elif chunk_id == left_message_id:
757
- pass
892
+ reward_kw["left_message_id"] = data.get("curr", "")
758
893
 
759
894
  elif isinstance(data, dict) and "curr" in data:
760
895
  content = data.get("curr", "")
761
896
  if content:
762
897
  async for chunk in process_content_chunk(
763
- content,
764
- chunk_id,
765
- line_count,
766
- for_target=False
898
+ content,
899
+ chunk_id,
900
+ line_count,
901
+ for_target=False
767
902
  ):
768
903
  stream["extra"].append(chunk)
769
904
  if isinstance(chunk, str) and "<streaming stopped unexpectedly" in chunk:
@@ -779,7 +914,14 @@ class Yupp(AsyncGeneratorProvider, ProviderModelMixin):
779
914
  log_debug(f"Finished processing {line_count} lines")
780
915
 
781
916
  finally:
782
- if reward_info and "unclaimedRewardInfo" in reward_info:
783
- rid = reward_info["unclaimedRewardInfo"].get("rewardId")
784
- if rid:
785
- await claim_yupp_reward(scraper, account, rid)
917
+ log_debug(f"Get Reward: {reward_kw}")
918
+ if reward_kw.get("turn_id") and reward_kw.get("left_message_id") and reward_kw.get("right_message_id"):
919
+ eval_id = await record_model_feedback(
920
+ scraper,
921
+ account,
922
+ reward_kw["turn_id"],
923
+ reward_kw["left_message_id"],
924
+ reward_kw["right_message_id"]
925
+ )
926
+ if eval_id:
927
+ await claim_yupp_reward(scraper, account, eval_id)
@@ -49,7 +49,7 @@ class MissingRequirementsError(G4FError):
49
49
 
50
50
 
51
51
  class NestAsyncioError(MissingRequirementsError):
52
- """Raised when 'nest_asyncio' is missing."""
52
+ """Raised when 'nest_asyncio2' is missing."""
53
53
  pass
54
54
 
55
55
 
@@ -331,7 +331,7 @@ class Backend_Api(Api):
331
331
  for chunk in response:
332
332
  if isinstance(chunk, FinishReason):
333
333
  yield f"[{chunk.reason}]" if chunk.reason != "stop" else ""
334
- elif not isinstance(chunk, Exception):
334
+ elif not isinstance(chunk, (Exception, JsonResponse)):
335
335
  chunk = str(chunk)
336
336
  if chunk:
337
337
  yield chunk