Skip to content
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

Api Problem #2702

Open
Screenmax1234 opened this issue Feb 8, 2025 · 8 comments
Open

Api Problem #2702

Screenmax1234 opened this issue Feb 8, 2025 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@Screenmax1234
Copy link

INFO: 192.168.1.197:26524 - "GET /api/models HTTP/1.1" 200 OK
INFO: 192.168.1.197:26524 - "GET /ollama/api/version HTTP/1.1" 200 OK
INFO: 192.168.1.197:26524 - "GET /static/favicon.png HTTP/1.1" 304 Not Modified
INFO: 192.168.1.197:26524 - "GET /static/favicon.png HTTP/1.1" 304 Not Modified
INFO: 192.168.1.197:26524 - "GET /api/v1/users/user/settings HTTP/1.1" 200 OK
INFO: 192.168.1.197:26533 - "POST /api/v1/chats/new HTTP/1.1" 200 OK
INFO: 192.168.1.197:26534 - "GET /static/favicon.png HTTP/1.1" 304 Not Modified
INFO: 192.168.1.197:26533 - "GET /api/v1/chats/?page=1 HTTP/1.1" 200 OK
INFO [open_webui.routers.openai] get_all_models()
INFO: 192.168.1.197:26536 - "GET /static/favicon.png HTTP/1.1" 304 Not Modified
INFO: 192.168.1.197:26533 - "POST /api/v1/chats/486f067c-cb70-417c-b59f-151e73e0086d HTTP/1.1" 200 OK
INFO: 192.168.1.197:26533 - "GET /api/v1/chats/?page=1 HTTP/1.1" 200 OK
INFO [open_webui.routers.openai] get_all_models()
ERROR [open_webui.routers.openai] 500, message='Attempt to decode JSON with unexpected mimetype: text/plain; charset=utf-8', url='https://chat.nelogroup.me/api/OIVSCode/chat/completions'
ERROR [open_webui.routers.openai] 500, message='Internal Server Error', url='https://chat.nelogroup.me/api/OIVSCode/chat/completions'
Traceback (most recent call last):
File "/app/backend/open_webui/routers/openai.py", line 696, in generate_chat_completion
r.raise_for_status()
File "/usr/local/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 1161, in raise_for_status
raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 500, message='Internal Server Error', url='https://chat.nelogroup.me/api/OIVSCode/chat/completions'
ERROR [open_webui.routers.tasks] Error generating chat completion: 500: Internal Server Error
INFO: 192.168.1.197:26534 - "POST /api/v1/tasks/auto/completions HTTP/1.1" 500 Internal Server Error
ERROR [open_webui.routers.openai] 500, message='Attempt to decode JSON with unexpected mimetype: text/plain; charset=utf-8', url='https://chat.nelogroup.me/api/OIVSCode/chat/completions'
ERROR [open_webui.routers.openai] 500, message='Internal Server Error', url='https://chat.nelogroup.me/api/OIVSCode/chat/completions'
Traceback (most recent call last):
File "/app/backend/open_webui/routers/openai.py", line 696, in generate_chat_completion
r.raise_for_status()
File "/usr/local/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 1161, in raise_for_status
raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 500, message='Internal Server Error', url='https://chat.nelogroup.me/api/OIVSCode/chat/completions'
INFO: 192.168.1.197:26533 - "POST /api/chat/completions HTTP/1.1" 400 Bad Request
INFO: 192.168.1.197:26533 - "GET /api/v1/chats/?page=1 HTTP/1.1" 200 OK

I have been getting this error the past couple of days

@Screenmax1234 Screenmax1234 added the bug Something isn't working label Feb 8, 2025
@Screenmax1234
Copy link
Author

@hlohaus What do you think?

@hlohaus
Copy link
Collaborator

hlohaus commented Feb 8, 2025

To assist you, @Screenmax1234 , please provide the G4F error message.

Your provider is OpenAI compatible; therefore, you can directly integrate the URL, api_base = "https://oi-vscode-server.onrender.com/v1", into your OpenWebUI settings.

@Screenmax1234
Copy link
Author

To assist you, @Screenmax1234 , please provide the G4F error message.

Your provider is OpenAI compatible; therefore, you can directly integrate the URL, api_base = "https://oi-vscode-server.onrender.com/v1", into your OpenWebUI settings.

This one yes but the other ones worked then now not.

@Screenmax1234
Copy link
Author

Will provide in a bit.

@Screenmax1234
Copy link
Author

To assist you, @Screenmax1234 , please provide the G4F error message.

Your provider is OpenAI compatible; therefore, you can directly integrate the URL, api_base = "https://oi-vscode-server.onrender.com/v1", into your OpenWebUI settings.

Here is the g4f error message File "/home/seluser/.local/lib/python3.12/site-packages/starlette/middleware/cors.py", line 85, in call
await self.app(scope, receive, send)
File "/home/seluser/.local/lib/python3.12/site-packages/starlette/middleware/exceptions.py", line 62, in call
await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
File "/home/seluser/.local/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
raise exc
File "/home/seluser/.local/lib/python3.12/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
await app(scope, receive, sender)
File "/home/seluser/.local/lib/python3.12/site-packages/starlette/routing.py", line 715, in call
await self.middleware_stack(scope, receive, send)
File "/home/seluser/.local/lib/python3.12/site-packages/starlette/routing.py", line 735, in app
await route.handle(scope, receive, send)
File "/home/seluser/.local/lib/python3.12/site-packages/starlette/routing.py", line 288, in handle
await self.app(scope, receive, send)
File "/home/seluser/.local/lib/python3.12/site-packages/starlette/routing.py", line 76, in app
await wrap_app_handling_exceptions(app, request)(scope, receive, send)
File "/home/seluser/.local/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
raise exc
File "/home/seluser/.local/lib/python3.12/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
await app(scope, receive, sender)
File "/home/seluser/.local/lib/python3.12/site-packages/starlette/routing.py", line 73, in app
response = await f(request)
^^^^^^^^^^^^^^^^
File "/home/seluser/.local/lib/python3.12/site-packages/fastapi/routing.py", line 301, in app
raw_response = await run_endpoint_function(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/seluser/.local/lib/python3.12/site-packages/fastapi/routing.py", line 212, in run_endpoint_function
return await dependant.call(**values)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/g4f/api/init.py", line 394, in provider_chat_completions
return await chat_completions(config, credentials, provider)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Api.register_routes..chat_completions() takes from 1 to 2 positional arguments but 3 were given

@Screenmax1234
Copy link
Author

@hlohaus

@hlohaus
Copy link
Collaborator

hlohaus commented Feb 11, 2025

Hey @Screenmax1234, there was a bug with the provider route, but I squashed it in the last release.

@Screenmax1234
Copy link
Author

Hey @Screenmax1234, there was a bug with the provider route, but I squashed it in the last release.

Thank you for your help due to school I am unable to test it right now but will definitely check it out when I have some free time. Your contribution is much appreciated 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants