返回提交历史
Modified
g4f/client/__init__.py
+6
-6
XFEstudio/gpt4free
Rename createClient method to create_client for consistency in ClientFactory usage
6e8fb036
代码差异
1 个文件
+6
-6
@@ -806,13 +806,13 @@ class ClientFactory:
806
806
807
807
Example usage:
808
808
# Create client with a named provider
809
client = ClientFactory.createClient("PollinationsAI")
809
client = ClientFactory.create_client("PollinationsAI")
810
810
811
811
# Create client with multiple providers (fallback)
812
client = ClientFactory.createClient(["PollinationsAI", "DeepInfra"])
812
client = ClientFactory.create_client(["PollinationsAI", "DeepInfra"])
813
813
814
814
# Create client with custom provider
815
client = ClientFactory.createClient(
815
client = ClientFactory.create_client(
816
816
base_url="https://api.example.com/v1",
817
817
api_key="your-api-key"
818
818
)
@@ -908,13 +908,13 @@ class ClientFactory:
908
908
909
909
Example:
910
910
# Named provider
911
client = ClientFactory.createClient("PollinationsAI")
911
client = ClientFactory.create_client("PollinationsAI")
912
912
913
913
# Multiple providers (fallback)
914
client = ClientFactory.createClient(["PollinationsAI", "DeepInfra"])
914
client = ClientFactory.create_client(["PollinationsAI", "DeepInfra"])
915
915
916
916
# Custom provider
917
client = ClientFactory.createClient(
917
client = ClientFactory.create_client(
918
918
base_url="https://api.openai.com/v1",
919
919
api_key="sk-..."
920
920
)