open-webui / pipelines

Pipelines: Versatile, UI-Agnostic OpenAI-Compatible Plugin Framework
MIT License
1.01k stars 319 forks source link

anthropic_manifold_pipeline.py sseclient Failed to parse: <Response [200]> #313

Closed oscarriddle closed 4 weeks ago

oscarriddle commented 4 weeks ago

Hi, thanks for providing the pipeline for anthropic. However, after successfully updated available models, it failed with exception as below. Seems something wrong with sseclient initialization.

[ENV] Python3.10 sseclient-py 1.8.0

Traceback (most recent call last): File "/data/application/pipelines/venv/lib/python3.10/site-packages/uvicorn/protocols/http/httptools_impl.py", line 435, in run_asgi result = await app( # type: ignore[func-returns-value] File "/data/application/pipelines/venv/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in call return await self.app(scope, receive, send) File "/data/application/pipelines/venv/lib/python3.10/site-packages/fastapi/applications.py", line 1054, in call await super().call(scope, receive, send) File "/data/application/pipelines/venv/lib/python3.10/site-packages/starlette/applications.py", line 123, in call await self.middleware_stack(scope, receive, send) File "/data/application/pipelines/venv/lib/python3.10/site-packages/starlette/middleware/errors.py", line 186, in call raise exc File "/data/application/pipelines/venv/lib/python3.10/site-packages/starlette/middleware/errors.py", line 164, in call await self.app(scope, receive, _send) File "/data/application/pipelines/venv/lib/python3.10/site-packages/starlette/middleware/base.py", line 189, in call with collapse_excgroups(): File "/usr/local/python3/lib/python3.10/contextlib.py", line 153, in exit self.gen.throw(typ, value, traceback) File "/data/application/pipelines/venv/lib/python3.10/site-packages/starlette/_utils.py", line 93, in collapse_excgroups raise exc File "/data/application/pipelines/venv/lib/python3.10/site-packages/starlette/responses.py", line 261, in wrap await func() File "/data/application/pipelines/venv/lib/python3.10/site-packages/starlette/responses.py", line 250, in stream_response async for chunk in self.body_iterator: File "/data/application/pipelines/venv/lib/python3.10/site-packages/starlette/concurrency.py", line 65, in iterate_in_threadpool yield await anyio.to_thread.run_sync(_next, as_iterator) File "/data/application/pipelines/venv/lib/python3.10/site-packages/anyio/to_thread.py", line 56, in run_sync return await get_async_backend().run_sync_in_worker_thread( File "/data/application/pipelines/venv/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 2177, in run_sync_in_worker_thread return await future File "/data/application/pipelines/venv/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 859, in run result = context.run(func, args) File "/data/application/pipelines/venv/lib/python3.10/site-packages/starlette/concurrency.py", line 54, in _next return next(iterator) File "/data/application/pipelines/main.py", line 665, in stream_content for line in res: File "/data/application/pipelines/./pipelines/anthropic_manifold_pipeline.py", line 150, in stream_response client = sseclient.SSEClient(response) File "/data/application/pipelines/venv/lib/python3.10/site-packages/sseclient.py", line 48, in init File "/data/application/pipelines/venv/lib/python3.10/site-packages/sseclient.py", line 56, in _connect File "/data/application/pipelines/venv/lib/python3.10/site-packages/requests/api.py", line 73, in get return request("get", url, params=params, kwargs) File "/data/application/pipelines/venv/lib/python3.10/site-packages/requests/api.py", line 59, in request return session.request(method=method, url=url, kwargs) File "/data/application/pipelines/venv/lib/python3.10/site-packages/requests/sessions.py", line 575, in request prep = self.prepare_request(req) File "/data/application/pipelines/venv/lib/python3.10/site-packages/requests/sessions.py", line 484, in prepare_request p.prepare( File "/data/application/pipelines/venv/lib/python3.10/site-packages/requests/models.py", line 367, in prepare self.prepare_url(url, params) File "/data/application/pipelines/venv/lib/python3.10/site-packages/requests/models.py", line 435, in prepare_url raise InvalidURL(e.args) requests.exceptions.InvalidURL: Failed to parse: <Response [200]>

oscarriddle commented 4 weeks ago

change to official api client, works well