summaryrefslogtreecommitdiffstats
path: root/g4f/gui/server/backend.py
diff options
context:
space:
mode:
authorCommenter123321 <36051603+Commenter123321@users.noreply.github.com>2023-10-10 15:11:17 +0200
committerCommenter123321 <36051603+Commenter123321@users.noreply.github.com>2023-10-10 15:11:17 +0200
commit9239c5720002f31b67bdd1ee805e2cd9b528d085 (patch)
treed48901a7bcce0cdac262f189b67fb5178542e4ce /g4f/gui/server/backend.py
parentfix provider thing in gui (diff)
downloadgpt4free-9239c5720002f31b67bdd1ee805e2cd9b528d085.tar
gpt4free-9239c5720002f31b67bdd1ee805e2cd9b528d085.tar.gz
gpt4free-9239c5720002f31b67bdd1ee805e2cd9b528d085.tar.bz2
gpt4free-9239c5720002f31b67bdd1ee805e2cd9b528d085.tar.lz
gpt4free-9239c5720002f31b67bdd1ee805e2cd9b528d085.tar.xz
gpt4free-9239c5720002f31b67bdd1ee805e2cd9b528d085.tar.zst
gpt4free-9239c5720002f31b67bdd1ee805e2cd9b528d085.zip
Diffstat (limited to 'g4f/gui/server/backend.py')
-rw-r--r--g4f/gui/server/backend.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/g4f/gui/server/backend.py b/g4f/gui/server/backend.py
index cf1f9428..a76ca12b 100644
--- a/g4f/gui/server/backend.py
+++ b/g4f/gui/server/backend.py
@@ -33,17 +33,17 @@ class Backend_Api:
conversation = request.json['meta']['content']['conversation']
prompt = request.json['meta']['content']['parts'][0]
model = request.json['model']
- provider = get_provider(request.json.get('provider'))
+ provider = request.json.get('provider').split("g4f.Provider.")[1]
messages = special_instructions[jailbreak] + conversation + search(internet_access, prompt) + [prompt]
def stream():
if provider:
answer = g4f.ChatCompletion.create(model=model,
- provider=g4f.Provider.ProviderUtils.convert.get(provider), messages=messages, stream=True)
+ provider=get_provider(provider), messages=messages, stream=True)
else:
answer = g4f.ChatCompletion.create(model=model,
- messages=messages, stream=True)
+ messages=messages, stream=True)
for token in answer:
yield token