-
-
Notifications
You must be signed in to change notification settings - Fork 13.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provider updates and optimizations across multiple modules #2220
Conversation
…and improve readability
…ate_conversation URLs
…| Updated g4f/Provider/__init__.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How can I assist you today?
@@ -12,10 +12,8 @@ class AiChatOnline(AsyncGeneratorProvider, ProviderModelMixin): | |||
url = "https://aichatonlineorg.erweima.ai" | |||
api_endpoint = "/aichatonline/api/chat/gpt" | |||
working = True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider removing unnecessary attributes.
@@ -12,10 +12,8 @@ | |||
url = "https://aichatonlineorg.erweima.ai" | |||
api_endpoint = "/aichatonline/api/chat/gpt" | |||
working = True | |||
supports_gpt_35_turbo = True | |||
supports_gpt_4 = True | |||
default_model = 'gpt-4o-mini' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest removing unnecessary attribute.
@@ -10,7 +10,8 @@ | |||
from ..requests import raise_for_status | |||
|
|||
class Koala(AsyncGeneratorProvider, ProviderModelMixin): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider updating the variable name 'url' to be more specific now that it includes '/chat'.
@@ -10,7 +10,8 @@ | |||
from ..requests import raise_for_status | |||
|
|||
class Koala(AsyncGeneratorProvider, ProviderModelMixin): | |||
url = "https://koala.sh" | |||
url = "https://koala.sh/chat" | |||
api_endpoint = "https://koala.sh/api/gpt/" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The addition of 'api_endpoint' is good but ensure it aligns with the naming convention used in this module.
@@ -10,7 +10,8 @@ | |||
from ..requests import raise_for_status | |||
|
|||
class Koala(AsyncGeneratorProvider, ProviderModelMixin): | |||
url = "https://koala.sh" | |||
url = "https://koala.sh/chat" | |||
api_endpoint = "https://koala.sh/api/gpt/" | |||
working = True | |||
supports_message_history = True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since 'supports_message_history' attribute is no longer needed, consider removing it to avoid confusion.
else: | ||
url = "https://www.bing.com/turing/conversation/create?bundleVersion=1.1690.0" | ||
url = "https://www.bing.com/turing/conversation/create?bundleVersion=1.1809.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly, the Bing URL has been updated, but please verify that this change does not affect existing functionality.
@@ -90,4 +90,4 @@ | |||
response = await response.json() | |||
return response["result"]["value"] == "Success" | |||
except: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The exception handling is too broad. It would be better to specify the type of exceptions you expect to catch, which can help in debugging and maintaining the code.
@@ -1,4 +1,3 @@ | |||
from .AItianhuSpace import AItianhuSpace | |||
from .MyShell import MyShell |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding a brief comment explaining the purpose of importing MyShell.
@@ -2,3 +1,3 @@ | |||
from .MyShell import MyShell | |||
from .PerplexityAi import PerplexityAi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No improvements needed.
@@ -2,3 +1,3 @@ | |||
from .MyShell import MyShell | |||
from .PerplexityAi import PerplexityAi | |||
from .Phind import Phind |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No improvements needed.
Hey! after the last update my guys and I found a few more problems that can technically be fixed Support conversation DDG like: #2210 In GUI interface after use generating image we have error like: file not found (generated_image_123456ID) like. Blackbox Images sometimes work like chat not like Image Gen... its site problem.
Calling model error Feature request: |
More infos like testing Hugging providers Models and errors:
|
More info like Web Accessing Feature request: |
Add provider for use |
Request Image Provider: |
…pdate provider models and aliases
@kqlio67 Discard latest commits
CR+ model update need stay Log working:
Upd:
All other models a work correclty |
More user friendly testing: However, we have many alias models with a similar feature, but this can only be done for this provider, since it is made separately on the site for ease of separation.
If you call Mixtral-8x7b you always receive |
@kqlio67 You are best man! Thanks for you working! :) |
…rove image generation
Don't worry, I'm a beginner in coding too and not very proficient yet. I'm also learning and improving my skills with each project. I believe the best way to learn coding is through practice. This way we better understand how everything works and learn from our mistakes. Public contributions to various projects really help to improve coding skills. Thank you for your suggestions - they give me an opportunity to try something new, and I'm learning and developing as a coder through this as well. |
Prodia: line 27 and 28:
|
Excellent, I'll check this later today and merge it |
New providers added
g4f/Provider/Prodia.py
(Provider updates and optimizations across multiple modules #2220 (comment))Provider with support for models for generating images
3Guofeng3_v34.safetensors [50f420de]
,absolutereality_V16.safetensors [37db0fc3]
,absolutereality_v181.safetensors [3d9d4d2b]
,amIReal_V41.safetensors [0a8a2e61]
,analog-diffusion-1.0.ckpt [9ca13f02]
,aniverse_v30.safetensors [579e6f85]
,anythingv3_0-pruned.ckpt [2700c435]
,anything-v4.5-pruned.ckpt [65745d25]
,anythingV5_PrtRE.safetensors [893e49b9]
,AOM3A3_orangemixs.safetensors [9600da17]
,blazing_drive_v10g.safetensors [ca1c1eab]
,breakdomain_I2428.safetensors [43cc7d2f]
,breakdomain_M2150.safetensors [15f7afca]
,cetusMix_Version35.safetensors [de2f2560]
,childrensStories_v13D.safetensors [9dfaabcb]
,childrensStories_v1SemiReal.safetensors [a1c56dbb]
,childrensStories_v1ToonAnime.safetensors [2ec7b88b]
,Counterfeit_v30.safetensors [9e2a8f19]
,cuteyukimixAdorable_midchapter3.safetensors [04bdffe6]
,cyberrealistic_v33.safetensors [82b0d085]
,dalcefo_v4.safetensors [425952fe]
,deliberate_v2.safetensors [10ec4b29]
,deliberate_v3.safetensors [afd9d2d4]
,dreamlike-anime-1.0.safetensors [4520e090]
,dreamlike-diffusion-1.0.safetensors [5c9fd6e0]
,dreamlike-photoreal-2.0.safetensors [fdcf65e7]
,dreamshaper_6BakedVae.safetensors [114c8abb]
,dreamshaper_7.safetensors [5cf5ae06]
,dreamshaper_8.safetensors [9d40847d]
,edgeOfRealism_eorV20.safetensors [3ed5de15]
,EimisAnimeDiffusion_V1.ckpt [4f828a15]
,elldreths-vivid-mix.safetensors [342d9d26]
,epicphotogasm_xPlusPlus.safetensors [1a8f6d35]
,epicrealism_naturalSinRC1VAE.safetensors [90a4c676]
,epicrealism_pureEvolutionV3.safetensors [42c8440c]
,ICantBelieveItsNotPhotography_seco.safetensors [4e7a3dfd]
,indigoFurryMix_v75Hybrid.safetensors [91208cbb]
,juggernaut_aftermath.safetensors [5e20c455]
,lofi_v4.safetensors [ccc204d6]
,lyriel_v16.safetensors [68fceea2]
,majicmixRealistic_v4.safetensors [29d0de58]
,mechamix_v10.safetensors [ee685731]
,meinamix_meinaV9.safetensors [2ec66ab0]
,meinamix_meinaV11.safetensors [b56ce717]
,neverendingDream_v122.safetensors [f964ceeb]
,openjourney_V4.ckpt [ca2f377f]
,pastelMixStylizedAnime_pruned_fp16.safetensors [793a26e8]
,portraitplus_V1.0.safetensors [1400e684]
,protogenx34.safetensors [5896f8d5]
,Realistic_Vision_V1.4-pruned-fp16.safetensors [8d21810b]
,Realistic_Vision_V2.0.safetensors [79587710]
,Realistic_Vision_V4.0.safetensors [29a7afaa]
,Realistic_Vision_V5.0.safetensors [614d1063]
,Realistic_Vision_V5.1.safetensors [a0f13c83]
,redshift_diffusion-V10.safetensors [1400e684]
,revAnimated_v122.safetensors [3f4fefd9]
,rundiffusionFX25D_v10.safetensors [cd12b0ee]
,rundiffusionFX_v10.safetensors [cd4e694d]
,sdv1_4.ckpt [7460a6fa]
,v1-5-pruned-emaonly.safetensors [d7049739]
,v1-5-inpainting.safetensors [21c7ab71]
,shoninsBeautiful_v10.safetensors [25d8c546]
,theallys-mix-ii-churned.safetensors [5d9225a4]
,timeless-1.0.ckpt [7c4971d4]
,toonyou_beta6.safetensors [980f6b15]
Removed Providers
g4f/Provider/Llama.py
g4f/Provider/selenium/AItianhuSpace.py
Provider Updates and Improvements
g4f/Provider/Nexra.py
(AttributeError: 'BingCreateImages' #2181 (comment))g4f/Provider/ReplicateHome.py
g4f/Provider/AiChatOnline.py
supports_gpt_35_turbo
attributesupports_message_history
attributeg4f/Provider/bing/conversation.py
bundleVersion
from 1.1690.0 to 1.1809.0 increate_conversation
function for both Copilot and regular Bing URLsg4f/Provider/Koala.py
gpt-3.5-turbo
togpt-4o-mini
g4f/Provider/Snova.py
cookinai/DonutLM-v1
from models listdonutlm-v
' from model_aliasesignos/Mistral-T5-7B-v1
modelg4f/Provider/PerplexityLabs.py
llama-3.1-8b-instruct
tollama-3.1-70b-instruct
g4f/Provider/Bixin123.py
(Provider updates and optimizations across multiple modules #2220 (comment))g4f/Provider/HuggingFace.py
,g4f/Provider/HuggingChat.py
(Error "KeyError: 'conversationId'" when using CohereForAI/c4ai-command-r-plus model in HuggingChat #2221 | Provider updates and optimizations across multiple modules #2220 (comment))meta-llama/Meta-Llama-3.1-405B-Instruct-FP8
from models listCohereForAI/c4ai-command-r-plus
toc4ai-command-r-plus-08-2024
command-r-plus
01-ai/Yi-1.5-34B-Chat
from models listyi-1.5-34b
from model_aliasesg4f/Provider/Blackbox.py
(Provider updates and optimizations across multiple modules #2220 (comment))model_config
dictionaryImageGenerationLV45LJp
modelUnified the functionality of
g4f/Provider/Rocks.py
andg4f/Provider/FluxAirforce.py
classes into theg4f/Provider/Airforce.py
class for both text and image generation.g4f/Provider/Rocks.py
andg4f/Provider/FluxAirforce.py
APIs under a newg4f/Provider/Airforce.py
provider class.create_async_generator
to handle both text and image generation.generate_text
andgenerate_image
methods for specific API endpoints:generate_text
for the/chat/completions
endpoint.generate_image
for the/v1/imagine2
endpoint.format_prompt
utility function for text generation.