mirror of
https://github.com/xtekky/gpt4free.git
synced 2026-01-01 06:41:09 -08:00
~
minor changes
This commit is contained in:
parent
0ddfe57431
commit
dad69d24ce
4 changed files with 9 additions and 4 deletions
|
|
@ -41,11 +41,14 @@ class RetryProvider(AsyncProvider):
|
||||||
try:
|
try:
|
||||||
if self.logging:
|
if self.logging:
|
||||||
print(f"Using {provider.__name__} provider")
|
print(f"Using {provider.__name__} provider")
|
||||||
|
|
||||||
for token in provider.create_completion(model, messages, stream, **kwargs):
|
for token in provider.create_completion(model, messages, stream, **kwargs):
|
||||||
yield token
|
yield token
|
||||||
started = True
|
started = True
|
||||||
|
|
||||||
if started:
|
if started:
|
||||||
return
|
return
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.exceptions[provider.__name__] = e
|
self.exceptions[provider.__name__] = e
|
||||||
if self.logging:
|
if self.logging:
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import g4f
|
import g4f; g4f.logging = True
|
||||||
import time
|
import time
|
||||||
import json
|
import json
|
||||||
import random
|
import random
|
||||||
|
|
|
||||||
|
|
@ -2,4 +2,5 @@ import g4f
|
||||||
import g4f.api
|
import g4f.api
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
print(f'Starting server... [g4f v-{g4f.version}]')
|
||||||
g4f.api.Api(g4f).run('localhost:1337', 8)
|
g4f.api.Api(g4f).run('localhost:1337', 8)
|
||||||
|
|
@ -11,6 +11,7 @@ from .Provider import (
|
||||||
ChatgptAi,
|
ChatgptAi,
|
||||||
GptChatly,
|
GptChatly,
|
||||||
Liaobots,
|
Liaobots,
|
||||||
|
ChatgptX,
|
||||||
Yqcloud,
|
Yqcloud,
|
||||||
GeekGpt,
|
GeekGpt,
|
||||||
Myshell,
|
Myshell,
|
||||||
|
|
@ -69,9 +70,9 @@ gpt_35_long = Model(
|
||||||
gpt_35_turbo = Model(
|
gpt_35_turbo = Model(
|
||||||
name = 'gpt-3.5-turbo',
|
name = 'gpt-3.5-turbo',
|
||||||
base_provider = 'openai',
|
base_provider = 'openai',
|
||||||
best_provider = RetryProvider([
|
best_provider=RetryProvider([
|
||||||
Aichat, ChatgptDemo, AiAsk, ChatForAi, GPTalk,
|
ChatgptX, ChatgptDemo, GptGo, You,
|
||||||
GptGo, You, GptForLove, ChatBase
|
NoowAi, GPTalk, GptForLove, Phind, ChatBase
|
||||||
])
|
])
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue