Merge pull request #1245 from AndPim4912/main

Fix ignored providers in api
This commit is contained in:
Tekky 2023-11-13 16:37:15 +00:00 committed by GitHub
commit 746588814c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -82,7 +82,11 @@ class Api:
messages = item_data.get('messages')
try:
response = g4f.ChatCompletion.create(model=model, stream=stream, messages=messages)
response = g4f.ChatCompletion.create(
model=model,
stream=stream,
messages=messages,
list_ignored_providers=self.list_ignored_providers)
except Exception as e:
logging.exception(e)
return Response(content=json.dumps({"error": "An error occurred while generating the response."}, indent=4), media_type="application/json")