[GH-ISSUE #4791] Pipe not working issue since 0.3.14 : Unexpected token 'I', "Internal S"... is not valid JSON #13732

Closed
opened 2026-04-19 20:21:47 -05:00 by GiteaMirror · 7 comments
Owner

Originally created by @thiswillbeyourgithub on GitHub (Aug 21, 2024).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/4791

Bug Report

Installation Method

docker

Environment

  • Open WebUI Version: 0.3.14 (not present before)

  • Operating System: ubuntu 22

Confirmation:

  • [ X ] I have read and followed all the instructions provided in the README.md.
  • [ X ] I am on the latest version of both Open WebUI and Ollama.
  • [ X ] I have included the browser console logs.
  • [ X ] I have included the Docker container logs.
  • [ X ] I have provided the exact steps to reproduce the bug in the "Steps to Reproduce" section below.

Expected Behavior:

My pipe should work :)

Actual Behavior:

The message errors out.

Description

Bug Summary:
[Provide a brief but clear summary of the bug]

Reproduction Details

Steps to Reproduce:

  • I'm using openrouter via litellm
  • The model I'm using is openrouter/anthropic/claude-3.5-sonnet
  • The pipe I'm using is:
My pipe

"""
title: CostTrackingPipe
author: thiswillbeyourgithub
date: 2024-08-21
version: 3.0.0
license: MIT
description: A pipe function to track user costs and remove 'thinkin' blocks
"""

from typing import List, Union, Generator, Iterator, Callable, Any, Optional
from pydantic import BaseModel, Field
import requests
import os
import re
import json

DEFAULT_BASE_URL = "http://127.0.0.1:4000"
DEFAULT_CHAT_MODEL = "litellm_sonnet-3.5_beta"
DEFAULT_TITLE_CHAT_MODEL = "litellm_gpt-4o-mini"


class Pipe:

    class Valves(BaseModel):
        LITELLM_BASE_URL: str = DEFAULT_BASE_URL
        api_keys: Optional[str] = Field(
            default=None,
            description="Dict where keys are litellm users and values are their virtual api keys (a string that will be json loaded as a dict). Leave to None if you want to load from env 'COSTTRACKINGPIPE_API_KEYS'",
        )

    class UserValves(BaseModel):
        enabled: bool = Field(default=True, description="True to enable price counting")
        chat_model: str = Field(
            default=DEFAULT_CHAT_MODEL, description="Chat model to use"
        )
        title_chat_model: str = Field(
            default=DEFAULT_TITLE_CHAT_MODEL,
            description="Model to use to generate titles",
        )

        remove_thoughts: bool = Field(
            default=True, description="True to remove the thoughts block"
        )
        start_thoughts: str = Field(
            default="^``` ?thinking", description="Start of thought block"
        )
        stop_thoughts: str = Field(default="```", description="End of thought block")
        debug: bool = Field(
            default=False,
            description="Set to True to print more info to the docker logs, also to not remove the last emitter message.",
        )

    def __init__(self):
        # You can also set the pipelines that are available in this pipeline.
        # Set manifold to True if you want to use this pipeline as a manifold.
        # Manifold pipelines can have multiple pipelines.
        self.type = "manifold"

        # Optionally, you can set the id and name of the pipeline.
        # Best practice is to not specify the id so that it can be automatically inferred from the filename, so that users can install multiple versions of the same pipeline.
        # The identifier must be unique across all pipelines.
        # The identifier must be an alphanumeric string that can include underscores or hyphens. It cannot contain spaces, special characters, slashes, or backslashes.
        self.id = "cost_tracking_pipe"

        # Optionally, you can set the name of the manifold pipeline.
        self.name = "CostTrackingPipe"

        # Initialize rate limits
        self.valves = self.Valves()
        self.uvalves = self.UserValves()

        self.start_thought = re.compile(self.uvalves.start_thoughts)
        self.stop_thought = re.compile(self.uvalves.stop_thoughts)
        self.pattern = re.compile(
            self.uvalves.start_thoughts + "(.*)?" + self.uvalves.stop_thoughts,
            flags=re.DOTALL | re.MULTILINE,
        )

    async def on_valves_updated(self):
        """This function is called when the valves are updated."""

        # just checking the validity of the api_keys
        if self.valves.api_keys is None:
            assert (
                "COSTTRACKINGPIPE_API_KEYS" in os.environ
            ), "You left the valve api_keys to None but didn't set an env variable COSTTRACKINGPIPE_API_KEYS"
            api_keys = os.environ["COSTTRACKINGPIPE_API_KEYS"]
        else:
            api_keys = self.valves.api_keys
        assert isinstance(
            api_keys, str
        ), f"Expected api_keys to be a str at this point, not {type(api_keys)}"
        try:
            api_keys = json.loads(api_keys)
            assert isinstance(
                api_keys, dict
            ), f"Expected api_keys to be a dict at this point, not {type(api_keys)}"
        except Exception as err:
            raise Exception(f"Error when casting api_keys from str to dict: '{err}'")

        assert "default" in api_keys, f"No 'default' key found in dict: {api_keys}"

    async def pipe(
        self,
        body: dict,
        __user__: dict,
        __event_emitter__: Callable[[dict], Any] = None,
        # this is just to debug if there are breaking changes etc
        *args,
        **kwargs,
    ) -> Union[str, Generator, Iterator]:

        # load the api_keys as a dict
        if self.valves.api_keys is None:
            assert (
                "COSTTRACKINGPIPE_API_KEYS" in os.environ
            ), "You left the valve api_keys to None but didn't set an env variable COSTTRACKINGPIPE_API_KEYS"
            api_keys = os.environ["COSTTRACKINGPIPE_API_KEYS"]
        else:
            api_keys = self.valves.api_keys
        assert isinstance(
            api_keys, str
        ), f"Expected api_keys to be a str at this point, not {type(api_keys)}"
        try:
            api_keys = json.loads(api_keys)
            assert isinstance(
                api_keys, dict
            ), f"Expected api_keys to be a dict at this point, not {type(api_keys)}"
        except Exception as err:
            raise Exception(f"Error when casting api_keys from str to dict: '{err}'")

        assert "default" in api_keys, f"No 'default' key found in dict: {api_keys}"

        # prints and emitter to show progress
        def pprint(message: str) -> str:
            print(f"CostTrackingPipe of '{__user__['name']}': " + str(message))
            return message

        emitter = EventEmitter(__event_emitter__)

        async def prog(message: str) -> None:
            await emitter.progress_update(pprint(message))

        async def succ(message: str) -> None:
            await emitter.success_update(pprint(message))

        async def err(message: str) -> None:
            await emitter.error_update(pprint(message))

        # to know in the future if there are new arguments I could use
        if args or kwargs:
            if args:
                pprint("Received args:" + str(args))
            if kwargs:
                pprint("Received kwargs:" + str(kwargs))

        if self.uvalves.debug:
            pprint(body.keys())
            pprint(body)

        # match the api key
        headers = {}
        await prog("Start")
        if not self.uvalves.enabled:
            await prog("Disabled api key matching, will use the default key")
            apikey = api_keys["default"]
            headers["Authorization"] = f"Bearer {apikey}"

        else:
            username = __user__["name"]
            if username in api_keys:
                apikey = api_keys[username]
                await prog(f"Will use key for {username}")
                headers["Authorization"] = f"Bearer {apikey}"
            else:
                await err(f"Username {username} not found in litellm env keys")
                raise Exception(f"User not found: {username}")

        try:
            if body["stream"]:
                model = self.uvalves.chat_model
            else:
                # stream disabled is only used for the summary title creator AFAIK
                model = self.uvalves.title_chat_model
            payload = {**body, "model": model, "user": username}

            await prog("Waiting for response")
            r = requests.post(
                url=f"{self.valves.LITELLM_BASE_URL}/v1/chat/completions",
                json=payload,
                headers=headers,
                stream=True,
            )

            r.raise_for_status()
            assert r.status_code == 200, f"Invalid status code: {r.status_code}"

            if body["stream"]:
                await prog("Receiving response by chunk")
                if (not self.uvalves.remove_thoughts) or (not self.uvalves.enabled):
                    for line in r.iter_lines():
                        yield line
                    return
                buffer = ""
                thought_pattern = re.compile(r"``` ?thinking.*?```", re.DOTALL)
                thought_removed = False

                for line in r.iter_lines():
                    if line:
                        line = line.decode("utf-8")
                        if line.startswith("data: "):
                            line = line[6:]  # Remove "data: " prefix
                        if line.strip() == "[DONE]":
                            break
                        try:
                            parsed_line = json.loads(line)
                        except (json.JSONDecodeError, KeyError):
                            continue

                        content = parsed_line["choices"][0]["delta"].get("content", "")
                        if not content:
                            continue

                        if thought_removed:
                            yield content
                            continue
                        buffer += content
                        match = thought_pattern.search(buffer)
                        if match:
                            # Remove the thought block
                            buffer = buffer[: match.start()] + buffer[match.end() :]
                            yield buffer
                            buffer = ""
                            thought_removed = True
                            await succ("Removed thought block")

                if not thought_removed:
                    # model didn't produce a thought (for example can happen for the chat title)
                    await succ("Thought block never found")
                    yield buffer

                if buffer:  # Yield any remaining content with finish_reason "stop"
                    yield buffer

            else:  # return the whole text directly
                await prog("Returning directly")
                j = r.json()
                to_yield = j["choices"][0]["message"].get("content", "")
                yield to_yield

            if not self.uvalves.debug:
                await succ("")  # hides it
            return

        except Exception as e:
            await err(f"Error: {e}")
            raise


class EventEmitter:
    def __init__(self, event_emitter: Callable[[dict], Any] = None):
        self.event_emitter = event_emitter

    async def progress_update(self, description):
        await self.emit(description)

    async def error_update(self, description):
        await self.emit(description, "error", True)

    async def success_update(self, description):
        await self.emit(description, "success", True)

    async def emit(self, description="Unknown State", status="in_progress", done=False):
        if self.event_emitter:
            await self.event_emitter(
                {
                    "type": "status",
                    "data": {
                        "status": status,
                        "description": description,
                        "done": done,
                    },
                }
            )

  • Ask any kind of message to my model

Logs and Screenshots

Docker Container Logs:

Docker logs

INFO:     192.168.1.254:0 - "POST /api/chat/completions HTTP/1.1" 500 Internal Server Error
ERROR:    Exception in ASGI application
  + Exception Group Traceback (most recent call last):
  |   File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 87, in collapse_excgroups
  |     yield
  |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 190, in __call__
  |     async with anyio.create_task_group() as task_group:
  |   File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 680, in __aexit__
  |     raise BaseExceptionGroup(
  | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
  +-+---------------- 1 ----------------
    | Traceback (most recent call last):
    |   File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py", line 401, in run_asgi
    |     result = await app(  # type: ignore[func-returns-value]
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/usr/local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 70, in __call__
    |     return await self.app(scope, receive, send)
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/usr/local/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in __call__
    |     await super().__call__(scope, receive, send)
    |   File "/usr/local/lib/python3.11/site-packages/starlette/applications.py", line 123, in __call__
    |     await self.middleware_stack(scope, receive, send)
    |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 186, in __call__
    |     raise exc
    |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 164, in __call__
    |     await self.app(scope, receive, _send)
    |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__
    |     with collapse_excgroups():
    |   File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__
    |     self.gen.throw(typ, value, traceback)
    |   File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
    |     raise exc
    |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__
    |     response = await self.dispatch_func(request, call_next)
    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/app/backend/main.py", line 792, in update_embedding_function
    |     response = await call_next(request)
    |                ^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next
    |     raise app_exc
    |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro
    |     await self.app(scope, receive_or_disconnect, send_no_error)
    |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__
    |     with collapse_excgroups():
    |   File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__
    |     self.gen.throw(typ, value, traceback)
    |   File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
    |     raise exc
    |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__
    |     response = await self.dispatch_func(request, call_next)
    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/app/backend/main.py", line 783, in check_url
    |     response = await call_next(request)
    |                ^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next
    |     raise app_exc
    |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro
    |     await self.app(scope, receive_or_disconnect, send_no_error)
    |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__
    |     with collapse_excgroups():
    |   File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__
    |     self.gen.throw(typ, value, traceback)
    |   File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
    |     raise exc
    |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__
    |     response = await self.dispatch_func(request, call_next)
    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/app/backend/main.py", line 769, in commit_session_after_request
    |     response = await call_next(request)
    |                ^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next
    |     raise app_exc
    |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro
    |     await self.app(scope, receive_or_disconnect, send_no_error)
    |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/cors.py", line 93, in __call__
    |     await self.simple_response(scope, receive, send, request_headers=headers)
    |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/cors.py", line 148, in simple_response
    |     await self.app(scope, receive, send)
    |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__
    |     with collapse_excgroups():
    |   File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__
    |     self.gen.throw(typ, value, traceback)
    |   File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
    |     raise exc
    |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__
    |     response = await self.dispatch_func(request, call_next)
    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/app/backend/main.py", line 748, in dispatch
    |     response = await call_next(request)
    |                ^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next
    |     raise app_exc
    |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro
    |     await self.app(scope, receive_or_disconnect, send_no_error)
    |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__
    |     with collapse_excgroups():
    |   File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__
    |     self.gen.throw(typ, value, traceback)
    |   File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
    |     raise exc
    |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__
    |     response = await self.dispatch_func(request, call_next)
    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/app/backend/main.py", line 613, in dispatch
    |     response = await call_next(request)
    |                ^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next
    |     raise app_exc
    |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro
    |     await self.app(scope, receive_or_disconnect, send_no_error)
    |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 65, in __call__
    |     await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
    |   File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
    |     raise exc
    |   File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    |     await app(scope, receive, sender)
    |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 756, in __call__
    |     await self.middleware_stack(scope, receive, send)
    |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 776, in app
    |     await route.handle(scope, receive, send)
    |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 297, in handle
    |     await self.app(scope, receive, send)
    |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 77, in app
    |     await wrap_app_handling_exceptions(app, request)(scope, receive, send)
    |   File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
    |     raise exc
    |   File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    |     await app(scope, receive, sender)
    |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 72, in app
    |     response = await func(request)
    |                ^^^^^^^^^^^^^^^^^^^
    |   File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 278, in app
    |     raw_response = await run_endpoint_function(
    |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 191, in run_endpoint_function
    |     return await dependant.call(**values)
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/app/backend/main.py", line 993, in generate_chat_completions
    |     return await generate_function_chat_completion(form_data, user=user)
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/app/backend/apps/webui/main.py", line 304, in generate_function_chat_completion
    |     configured_tools = get_tools(app, tool_ids, user, tools_params)
    |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/app/backend/utils/tools.py", line 37, in get_tools
    |     for tool_id in tool_ids:
    | TypeError: 'NoneType' object is not iterable
    +------------------------------------

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py", line 401, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 70, in __call__
    return await self.app(scope, receive, send)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in __call__
    await super().__call__(scope, receive, send)
  File "/usr/local/lib/python3.11/site-packages/starlette/applications.py", line 123, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 186, in __call__
    raise exc
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 164, in __call__
    await self.app(scope, receive, _send)
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__
    with collapse_excgroups():
  File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__
    self.gen.throw(typ, value, traceback)
  File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
    raise exc
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__
    response = await self.dispatch_func(request, call_next)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/backend/main.py", line 792, in update_embedding_function
    response = await call_next(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next
    raise app_exc
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro
    await self.app(scope, receive_or_disconnect, send_no_error)
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__
    with collapse_excgroups():
  File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__
    self.gen.throw(typ, value, traceback)
  File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
    raise exc
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__
    response = await self.dispatch_func(request, call_next)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/backend/main.py", line 783, in check_url
    response = await call_next(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next
    raise app_exc
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro
    await self.app(scope, receive_or_disconnect, send_no_error)
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__
    with collapse_excgroups():
  File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__
    self.gen.throw(typ, value, traceback)
  File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
    raise exc
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__
    response = await self.dispatch_func(request, call_next)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/backend/main.py", line 769, in commit_session_after_request
    response = await call_next(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next
    raise app_exc
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro
    await self.app(scope, receive_or_disconnect, send_no_error)
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/cors.py", line 93, in __call__
    await self.simple_response(scope, receive, send, request_headers=headers)
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/cors.py", line 148, in simple_response
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__
    with collapse_excgroups():
  File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__
    self.gen.throw(typ, value, traceback)
  File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
    raise exc
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__
    response = await self.dispatch_func(request, call_next)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/backend/main.py", line 748, in dispatch
    response = await call_next(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next
    raise app_exc
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro
    await self.app(scope, receive_or_disconnect, send_no_error)
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__
    with collapse_excgroups():
  File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__
    self.gen.throw(typ, value, traceback)
  File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
    raise exc
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__
    response = await self.dispatch_func(request, call_next)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/backend/main.py", line 613, in dispatch
    response = await call_next(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next
    raise app_exc
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro
    await self.app(scope, receive_or_disconnect, send_no_error)
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 65, in __call__
    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
  File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
    raise exc
  File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    await app(scope, receive, sender)
  File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 756, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 776, in app
    await route.handle(scope, receive, send)
  File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 297, in handle
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 77, in app
    await wrap_app_handling_exceptions(app, request)(scope, receive, send)
  File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
    raise exc
  File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    await app(scope, receive, sender)
  File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 72, in app
    response = await func(request)
               ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 278, in app
    raw_response = await run_endpoint_function(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 191, in run_endpoint_function
    return await dependant.call(**values)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/backend/main.py", line 993, in generate_chat_completions
    return await generate_function_chat_completion(form_data, user=user)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/backend/apps/webui/main.py", line 304, in generate_function_chat_completion
    configured_tools = get_tools(app, tool_ids, user, tools_params)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/backend/utils/tools.py", line 37, in get_tools
    for tool_id in tool_ids:
TypeError: 'NoneType' object is not iterable

Along with the error:

Uh-oh! There was an issue connecting to ClaudeSonnet Beta.
Unexpected token 'I', "Internal S"... is not valid JSON

Screenshots/Screen Recordings (if applicable):
image##

Additional Information
Started happening as soon as I upgraded to 0.3.14

Originally created by @thiswillbeyourgithub on GitHub (Aug 21, 2024). Original GitHub issue: https://github.com/open-webui/open-webui/issues/4791 # Bug Report ## Installation Method docker ## Environment - **Open WebUI Version:** 0.3.14 (not present before) - **Operating System:** ubuntu 22 **Confirmation:** - [ X ] I have read and followed all the instructions provided in the README.md. - [ X ] I am on the latest version of both Open WebUI and Ollama. - [ X ] I have included the browser console logs. - [ X ] I have included the Docker container logs. - [ X ] I have provided the exact steps to reproduce the bug in the "Steps to Reproduce" section below. ## Expected Behavior: My pipe should work :) ## Actual Behavior: The message errors out. ## Description **Bug Summary:** [Provide a brief but clear summary of the bug] ## Reproduction Details **Steps to Reproduce:** - I'm using openrouter via litellm - The model I'm using is `openrouter/anthropic/claude-3.5-sonnet` - The pipe I'm using is: <details><summary>My pipe</summary> ``` python """ title: CostTrackingPipe author: thiswillbeyourgithub date: 2024-08-21 version: 3.0.0 license: MIT description: A pipe function to track user costs and remove 'thinkin' blocks """ from typing import List, Union, Generator, Iterator, Callable, Any, Optional from pydantic import BaseModel, Field import requests import os import re import json DEFAULT_BASE_URL = "http://127.0.0.1:4000" DEFAULT_CHAT_MODEL = "litellm_sonnet-3.5_beta" DEFAULT_TITLE_CHAT_MODEL = "litellm_gpt-4o-mini" class Pipe: class Valves(BaseModel): LITELLM_BASE_URL: str = DEFAULT_BASE_URL api_keys: Optional[str] = Field( default=None, description="Dict where keys are litellm users and values are their virtual api keys (a string that will be json loaded as a dict). Leave to None if you want to load from env 'COSTTRACKINGPIPE_API_KEYS'", ) class UserValves(BaseModel): enabled: bool = Field(default=True, description="True to enable price counting") chat_model: str = Field( default=DEFAULT_CHAT_MODEL, description="Chat model to use" ) title_chat_model: str = Field( default=DEFAULT_TITLE_CHAT_MODEL, description="Model to use to generate titles", ) remove_thoughts: bool = Field( default=True, description="True to remove the thoughts block" ) start_thoughts: str = Field( default="^``` ?thinking", description="Start of thought block" ) stop_thoughts: str = Field(default="```", description="End of thought block") debug: bool = Field( default=False, description="Set to True to print more info to the docker logs, also to not remove the last emitter message.", ) def __init__(self): # You can also set the pipelines that are available in this pipeline. # Set manifold to True if you want to use this pipeline as a manifold. # Manifold pipelines can have multiple pipelines. self.type = "manifold" # Optionally, you can set the id and name of the pipeline. # Best practice is to not specify the id so that it can be automatically inferred from the filename, so that users can install multiple versions of the same pipeline. # The identifier must be unique across all pipelines. # The identifier must be an alphanumeric string that can include underscores or hyphens. It cannot contain spaces, special characters, slashes, or backslashes. self.id = "cost_tracking_pipe" # Optionally, you can set the name of the manifold pipeline. self.name = "CostTrackingPipe" # Initialize rate limits self.valves = self.Valves() self.uvalves = self.UserValves() self.start_thought = re.compile(self.uvalves.start_thoughts) self.stop_thought = re.compile(self.uvalves.stop_thoughts) self.pattern = re.compile( self.uvalves.start_thoughts + "(.*)?" + self.uvalves.stop_thoughts, flags=re.DOTALL | re.MULTILINE, ) async def on_valves_updated(self): """This function is called when the valves are updated.""" # just checking the validity of the api_keys if self.valves.api_keys is None: assert ( "COSTTRACKINGPIPE_API_KEYS" in os.environ ), "You left the valve api_keys to None but didn't set an env variable COSTTRACKINGPIPE_API_KEYS" api_keys = os.environ["COSTTRACKINGPIPE_API_KEYS"] else: api_keys = self.valves.api_keys assert isinstance( api_keys, str ), f"Expected api_keys to be a str at this point, not {type(api_keys)}" try: api_keys = json.loads(api_keys) assert isinstance( api_keys, dict ), f"Expected api_keys to be a dict at this point, not {type(api_keys)}" except Exception as err: raise Exception(f"Error when casting api_keys from str to dict: '{err}'") assert "default" in api_keys, f"No 'default' key found in dict: {api_keys}" async def pipe( self, body: dict, __user__: dict, __event_emitter__: Callable[[dict], Any] = None, # this is just to debug if there are breaking changes etc *args, **kwargs, ) -> Union[str, Generator, Iterator]: # load the api_keys as a dict if self.valves.api_keys is None: assert ( "COSTTRACKINGPIPE_API_KEYS" in os.environ ), "You left the valve api_keys to None but didn't set an env variable COSTTRACKINGPIPE_API_KEYS" api_keys = os.environ["COSTTRACKINGPIPE_API_KEYS"] else: api_keys = self.valves.api_keys assert isinstance( api_keys, str ), f"Expected api_keys to be a str at this point, not {type(api_keys)}" try: api_keys = json.loads(api_keys) assert isinstance( api_keys, dict ), f"Expected api_keys to be a dict at this point, not {type(api_keys)}" except Exception as err: raise Exception(f"Error when casting api_keys from str to dict: '{err}'") assert "default" in api_keys, f"No 'default' key found in dict: {api_keys}" # prints and emitter to show progress def pprint(message: str) -> str: print(f"CostTrackingPipe of '{__user__['name']}': " + str(message)) return message emitter = EventEmitter(__event_emitter__) async def prog(message: str) -> None: await emitter.progress_update(pprint(message)) async def succ(message: str) -> None: await emitter.success_update(pprint(message)) async def err(message: str) -> None: await emitter.error_update(pprint(message)) # to know in the future if there are new arguments I could use if args or kwargs: if args: pprint("Received args:" + str(args)) if kwargs: pprint("Received kwargs:" + str(kwargs)) if self.uvalves.debug: pprint(body.keys()) pprint(body) # match the api key headers = {} await prog("Start") if not self.uvalves.enabled: await prog("Disabled api key matching, will use the default key") apikey = api_keys["default"] headers["Authorization"] = f"Bearer {apikey}" else: username = __user__["name"] if username in api_keys: apikey = api_keys[username] await prog(f"Will use key for {username}") headers["Authorization"] = f"Bearer {apikey}" else: await err(f"Username {username} not found in litellm env keys") raise Exception(f"User not found: {username}") try: if body["stream"]: model = self.uvalves.chat_model else: # stream disabled is only used for the summary title creator AFAIK model = self.uvalves.title_chat_model payload = {**body, "model": model, "user": username} await prog("Waiting for response") r = requests.post( url=f"{self.valves.LITELLM_BASE_URL}/v1/chat/completions", json=payload, headers=headers, stream=True, ) r.raise_for_status() assert r.status_code == 200, f"Invalid status code: {r.status_code}" if body["stream"]: await prog("Receiving response by chunk") if (not self.uvalves.remove_thoughts) or (not self.uvalves.enabled): for line in r.iter_lines(): yield line return buffer = "" thought_pattern = re.compile(r"``` ?thinking.*?```", re.DOTALL) thought_removed = False for line in r.iter_lines(): if line: line = line.decode("utf-8") if line.startswith("data: "): line = line[6:] # Remove "data: " prefix if line.strip() == "[DONE]": break try: parsed_line = json.loads(line) except (json.JSONDecodeError, KeyError): continue content = parsed_line["choices"][0]["delta"].get("content", "") if not content: continue if thought_removed: yield content continue buffer += content match = thought_pattern.search(buffer) if match: # Remove the thought block buffer = buffer[: match.start()] + buffer[match.end() :] yield buffer buffer = "" thought_removed = True await succ("Removed thought block") if not thought_removed: # model didn't produce a thought (for example can happen for the chat title) await succ("Thought block never found") yield buffer if buffer: # Yield any remaining content with finish_reason "stop" yield buffer else: # return the whole text directly await prog("Returning directly") j = r.json() to_yield = j["choices"][0]["message"].get("content", "") yield to_yield if not self.uvalves.debug: await succ("") # hides it return except Exception as e: await err(f"Error: {e}") raise class EventEmitter: def __init__(self, event_emitter: Callable[[dict], Any] = None): self.event_emitter = event_emitter async def progress_update(self, description): await self.emit(description) async def error_update(self, description): await self.emit(description, "error", True) async def success_update(self, description): await self.emit(description, "success", True) async def emit(self, description="Unknown State", status="in_progress", done=False): if self.event_emitter: await self.event_emitter( { "type": "status", "data": { "status": status, "description": description, "done": done, }, } ) ``` </details> - Ask any kind of message to my model ## Logs and Screenshots **Docker Container Logs:** <details> <summary>Docker logs</summary> ``` INFO: 192.168.1.254:0 - "POST /api/chat/completions HTTP/1.1" 500 Internal Server Error ERROR: Exception in ASGI application + Exception Group Traceback (most recent call last): | File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 87, in collapse_excgroups | yield | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 190, in __call__ | async with anyio.create_task_group() as task_group: | File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 680, in __aexit__ | raise BaseExceptionGroup( | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception) +-+---------------- 1 ---------------- | Traceback (most recent call last): | File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py", line 401, in run_asgi | result = await app( # type: ignore[func-returns-value] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/usr/local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 70, in __call__ | return await self.app(scope, receive, send) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/usr/local/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in __call__ | await super().__call__(scope, receive, send) | File "/usr/local/lib/python3.11/site-packages/starlette/applications.py", line 123, in __call__ | await self.middleware_stack(scope, receive, send) | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 186, in __call__ | raise exc | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 164, in __call__ | await self.app(scope, receive, _send) | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__ | with collapse_excgroups(): | File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__ | self.gen.throw(typ, value, traceback) | File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups | raise exc | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__ | response = await self.dispatch_func(request, call_next) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/app/backend/main.py", line 792, in update_embedding_function | response = await call_next(request) | ^^^^^^^^^^^^^^^^^^^^^^^^ | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next | raise app_exc | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro | await self.app(scope, receive_or_disconnect, send_no_error) | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__ | with collapse_excgroups(): | File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__ | self.gen.throw(typ, value, traceback) | File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups | raise exc | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__ | response = await self.dispatch_func(request, call_next) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/app/backend/main.py", line 783, in check_url | response = await call_next(request) | ^^^^^^^^^^^^^^^^^^^^^^^^ | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next | raise app_exc | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro | await self.app(scope, receive_or_disconnect, send_no_error) | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__ | with collapse_excgroups(): | File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__ | self.gen.throw(typ, value, traceback) | File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups | raise exc | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__ | response = await self.dispatch_func(request, call_next) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/app/backend/main.py", line 769, in commit_session_after_request | response = await call_next(request) | ^^^^^^^^^^^^^^^^^^^^^^^^ | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next | raise app_exc | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro | await self.app(scope, receive_or_disconnect, send_no_error) | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/cors.py", line 93, in __call__ | await self.simple_response(scope, receive, send, request_headers=headers) | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/cors.py", line 148, in simple_response | await self.app(scope, receive, send) | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__ | with collapse_excgroups(): | File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__ | self.gen.throw(typ, value, traceback) | File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups | raise exc | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__ | response = await self.dispatch_func(request, call_next) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/app/backend/main.py", line 748, in dispatch | response = await call_next(request) | ^^^^^^^^^^^^^^^^^^^^^^^^ | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next | raise app_exc | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro | await self.app(scope, receive_or_disconnect, send_no_error) | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__ | with collapse_excgroups(): | File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__ | self.gen.throw(typ, value, traceback) | File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups | raise exc | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__ | response = await self.dispatch_func(request, call_next) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/app/backend/main.py", line 613, in dispatch | response = await call_next(request) | ^^^^^^^^^^^^^^^^^^^^^^^^ | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next | raise app_exc | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro | await self.app(scope, receive_or_disconnect, send_no_error) | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 65, in __call__ | await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) | File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app | raise exc | File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app | await app(scope, receive, sender) | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 756, in __call__ | await self.middleware_stack(scope, receive, send) | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 776, in app | await route.handle(scope, receive, send) | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 297, in handle | await self.app(scope, receive, send) | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 77, in app | await wrap_app_handling_exceptions(app, request)(scope, receive, send) | File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app | raise exc | File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app | await app(scope, receive, sender) | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 72, in app | response = await func(request) | ^^^^^^^^^^^^^^^^^^^ | File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 278, in app | raw_response = await run_endpoint_function( | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 191, in run_endpoint_function | return await dependant.call(**values) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/app/backend/main.py", line 993, in generate_chat_completions | return await generate_function_chat_completion(form_data, user=user) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/app/backend/apps/webui/main.py", line 304, in generate_function_chat_completion | configured_tools = get_tools(app, tool_ids, user, tools_params) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/app/backend/utils/tools.py", line 37, in get_tools | for tool_id in tool_ids: | TypeError: 'NoneType' object is not iterable +------------------------------------ During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py", line 401, in run_asgi result = await app( # type: ignore[func-returns-value] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 70, in __call__ return await self.app(scope, receive, send) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in __call__ await super().__call__(scope, receive, send) File "/usr/local/lib/python3.11/site-packages/starlette/applications.py", line 123, in __call__ await self.middleware_stack(scope, receive, send) File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 186, in __call__ raise exc File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 164, in __call__ await self.app(scope, receive, _send) File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__ with collapse_excgroups(): File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__ self.gen.throw(typ, value, traceback) File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups raise exc File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__ response = await self.dispatch_func(request, call_next) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/backend/main.py", line 792, in update_embedding_function response = await call_next(request) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next raise app_exc File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro await self.app(scope, receive_or_disconnect, send_no_error) File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__ with collapse_excgroups(): File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__ self.gen.throw(typ, value, traceback) File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups raise exc File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__ response = await self.dispatch_func(request, call_next) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/backend/main.py", line 783, in check_url response = await call_next(request) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next raise app_exc File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro await self.app(scope, receive_or_disconnect, send_no_error) File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__ with collapse_excgroups(): File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__ self.gen.throw(typ, value, traceback) File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups raise exc File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__ response = await self.dispatch_func(request, call_next) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/backend/main.py", line 769, in commit_session_after_request response = await call_next(request) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next raise app_exc File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro await self.app(scope, receive_or_disconnect, send_no_error) File "/usr/local/lib/python3.11/site-packages/starlette/middleware/cors.py", line 93, in __call__ await self.simple_response(scope, receive, send, request_headers=headers) File "/usr/local/lib/python3.11/site-packages/starlette/middleware/cors.py", line 148, in simple_response await self.app(scope, receive, send) File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__ with collapse_excgroups(): File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__ self.gen.throw(typ, value, traceback) File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups raise exc File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__ response = await self.dispatch_func(request, call_next) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/backend/main.py", line 748, in dispatch response = await call_next(request) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next raise app_exc File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro await self.app(scope, receive_or_disconnect, send_no_error) File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__ with collapse_excgroups(): File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__ self.gen.throw(typ, value, traceback) File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups raise exc File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__ response = await self.dispatch_func(request, call_next) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/backend/main.py", line 613, in dispatch response = await call_next(request) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next raise app_exc File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro await self.app(scope, receive_or_disconnect, send_no_error) File "/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 65, in __call__ await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app raise exc File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app await app(scope, receive, sender) File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 756, in __call__ await self.middleware_stack(scope, receive, send) File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 776, in app await route.handle(scope, receive, send) File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 297, in handle await self.app(scope, receive, send) File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 77, in app await wrap_app_handling_exceptions(app, request)(scope, receive, send) File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app raise exc File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app await app(scope, receive, sender) File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 72, in app response = await func(request) ^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 278, in app raw_response = await run_endpoint_function( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 191, in run_endpoint_function return await dependant.call(**values) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/backend/main.py", line 993, in generate_chat_completions return await generate_function_chat_completion(form_data, user=user) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/backend/apps/webui/main.py", line 304, in generate_function_chat_completion configured_tools = get_tools(app, tool_ids, user, tools_params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/backend/utils/tools.py", line 37, in get_tools for tool_id in tool_ids: TypeError: 'NoneType' object is not iterable ``` </details> Along with the error: ``` Uh-oh! There was an issue connecting to ClaudeSonnet Beta. Unexpected token 'I', "Internal S"... is not valid JSON ``` **Screenshots/Screen Recordings (if applicable):** ![image](https://github.com/user-attachments/assets/5b99e5bf-d098-4baf-98a9-6318f8dbb4ed)## Additional Information Started happening as soon as I upgraded to 0.3.14
Author
Owner

@darkvertex commented on GitHub (Aug 21, 2024):

Same here with the Anthropic manifold pipe from the community:
https://openwebui.com/f/justinrahb/anthropic/

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py", line 401, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 70, in __call__
    return await self.app(scope, receive, send)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in __call__
    await super().__call__(scope, receive, send)
  File "/usr/local/lib/python3.11/site-packages/starlette/applications.py", line 123, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 186, in __call__
    raise exc
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 164, in __call__
    await self.app(scope, receive, _send)
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__
    with collapse_excgroups():
  File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__
    self.gen.throw(typ, value, traceback)
  File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
    raise exc
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__
    response = await self.dispatch_func(request, call_next)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/backend/main.py", line 792, in update_embedding_function
    response = await call_next(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next
    raise app_exc
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro
    await self.app(scope, receive_or_disconnect, send_no_error)
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__
    with collapse_excgroups():
  File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__
    self.gen.throw(typ, value, traceback)
  File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
    raise exc
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__
    response = await self.dispatch_func(request, call_next)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/backend/main.py", line 783, in check_url
    response = await call_next(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next
    raise app_exc
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro
    await self.app(scope, receive_or_disconnect, send_no_error)
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__
    with collapse_excgroups():
  File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__
    self.gen.throw(typ, value, traceback)
  File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
    raise exc
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__
    response = await self.dispatch_func(request, call_next)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/backend/main.py", line 769, in commit_session_after_request
    response = await call_next(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next
    raise app_exc
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro
    await self.app(scope, receive_or_disconnect, send_no_error)
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/cors.py", line 93, in __call__
    await self.simple_response(scope, receive, send, request_headers=headers)
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/cors.py", line 148, in simple_response
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__
    with collapse_excgroups():
  File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__
    self.gen.throw(typ, value, traceback)
  File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
    raise exc
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__
    response = await self.dispatch_func(request, call_next)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/backend/main.py", line 748, in dispatch
    response = await call_next(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next
    raise app_exc
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro
    await self.app(scope, receive_or_disconnect, send_no_error)
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__
    with collapse_excgroups():
  File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__
    self.gen.throw(typ, value, traceback)
  File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
    raise exc
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__
    response = await self.dispatch_func(request, call_next)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/backend/main.py", line 613, in dispatch
    response = await call_next(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next
    raise app_exc
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro
    await self.app(scope, receive_or_disconnect, send_no_error)
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 65, in __call__
    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
  File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
    raise exc
  File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    await app(scope, receive, sender)
  File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 756, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 776, in app
    await route.handle(scope, receive, send)
  File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 297, in handle
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 77, in app
    await wrap_app_handling_exceptions(app, request)(scope, receive, send)
  File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
    raise exc
  File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    await app(scope, receive, sender)
  File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 72, in app
    response = await func(request)
               ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 278, in app
    raw_response = await run_endpoint_function(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 191, in run_endpoint_function
    return await dependant.call(**values)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/backend/main.py", line 993, in generate_chat_completions
    return await generate_function_chat_completion(form_data, user=user)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/backend/apps/webui/main.py", line 304, in generate_function_chat_completion
    configured_tools = get_tools(app, tool_ids, user, tools_params)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/backend/utils/tools.py", line 37, in get_tools
    for tool_id in tool_ids:
TypeError: 'NoneType' object is not iterable
generate_title
anthropic.claude-3-5-sonnet-20240620
anthropic
anthropic
<!-- gh-comment-id:2302728062 --> @darkvertex commented on GitHub (Aug 21, 2024): Same here with the Anthropic manifold pipe from the community: https://openwebui.com/f/justinrahb/anthropic/ ``` Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py", line 401, in run_asgi result = await app( # type: ignore[func-returns-value] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 70, in __call__ return await self.app(scope, receive, send) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in __call__ await super().__call__(scope, receive, send) File "/usr/local/lib/python3.11/site-packages/starlette/applications.py", line 123, in __call__ await self.middleware_stack(scope, receive, send) File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 186, in __call__ raise exc File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 164, in __call__ await self.app(scope, receive, _send) File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__ with collapse_excgroups(): File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__ self.gen.throw(typ, value, traceback) File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups raise exc File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__ response = await self.dispatch_func(request, call_next) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/backend/main.py", line 792, in update_embedding_function response = await call_next(request) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next raise app_exc File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro await self.app(scope, receive_or_disconnect, send_no_error) File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__ with collapse_excgroups(): File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__ self.gen.throw(typ, value, traceback) File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups raise exc File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__ response = await self.dispatch_func(request, call_next) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/backend/main.py", line 783, in check_url response = await call_next(request) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next raise app_exc File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro await self.app(scope, receive_or_disconnect, send_no_error) File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__ with collapse_excgroups(): File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__ self.gen.throw(typ, value, traceback) File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups raise exc File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__ response = await self.dispatch_func(request, call_next) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/backend/main.py", line 769, in commit_session_after_request response = await call_next(request) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next raise app_exc File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro await self.app(scope, receive_or_disconnect, send_no_error) File "/usr/local/lib/python3.11/site-packages/starlette/middleware/cors.py", line 93, in __call__ await self.simple_response(scope, receive, send, request_headers=headers) File "/usr/local/lib/python3.11/site-packages/starlette/middleware/cors.py", line 148, in simple_response await self.app(scope, receive, send) File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__ with collapse_excgroups(): File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__ self.gen.throw(typ, value, traceback) File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups raise exc File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__ response = await self.dispatch_func(request, call_next) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/backend/main.py", line 748, in dispatch response = await call_next(request) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next raise app_exc File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro await self.app(scope, receive_or_disconnect, send_no_error) File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__ with collapse_excgroups(): File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__ self.gen.throw(typ, value, traceback) File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups raise exc File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__ response = await self.dispatch_func(request, call_next) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/backend/main.py", line 613, in dispatch response = await call_next(request) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next raise app_exc File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro await self.app(scope, receive_or_disconnect, send_no_error) File "/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 65, in __call__ await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app raise exc File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app await app(scope, receive, sender) File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 756, in __call__ await self.middleware_stack(scope, receive, send) File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 776, in app await route.handle(scope, receive, send) File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 297, in handle await self.app(scope, receive, send) File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 77, in app await wrap_app_handling_exceptions(app, request)(scope, receive, send) File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app raise exc File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app await app(scope, receive, sender) File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 72, in app response = await func(request) ^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 278, in app raw_response = await run_endpoint_function( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 191, in run_endpoint_function return await dependant.call(**values) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/backend/main.py", line 993, in generate_chat_completions return await generate_function_chat_completion(form_data, user=user) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/backend/apps/webui/main.py", line 304, in generate_function_chat_completion configured_tools = get_tools(app, tool_ids, user, tools_params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/backend/utils/tools.py", line 37, in get_tools for tool_id in tool_ids: TypeError: 'NoneType' object is not iterable generate_title anthropic.claude-3-5-sonnet-20240620 anthropic anthropic ```
Author
Owner

@justinh-rahb commented on GitHub (Aug 21, 2024):

Looking into it!

<!-- gh-comment-id:2302816537 --> @justinh-rahb commented on GitHub (Aug 21, 2024): Looking into it!
Author
Owner

@tjbck commented on GitHub (Aug 21, 2024):

Fixed on dev, 0.3.15 coming soon!

<!-- gh-comment-id:2303028739 --> @tjbck commented on GitHub (Aug 21, 2024): Fixed on dev, 0.3.15 coming soon!
Author
Owner

@darkvertex commented on GitHub (Aug 22, 2024):

Fixed on dev, 0.3.15 coming soon!

Fixed faster than Sonic makes scrambled eggs. Amazing! Thank you. 🙏

<!-- gh-comment-id:2303605604 --> @darkvertex commented on GitHub (Aug 22, 2024): > Fixed on dev, 0.3.15 coming soon! Fixed faster than Sonic makes scrambled eggs. Amazing! Thank you. 🙏
Author
Owner

@thiswillbeyourgithub commented on GitHub (Aug 22, 2024):

Confirmed fixed for me too, you people rock :)

<!-- gh-comment-id:2303948988 --> @thiswillbeyourgithub commented on GitHub (Aug 22, 2024): Confirmed fixed for me too, you people rock :)
Author
Owner

@MatthK commented on GitHub (Aug 23, 2024):

Unfortunately I still receive this error, although I just updated to version 0.3.15.

I'm running it in two docker containers, both Open-WebUI and Ollama. When I check the Ollama API in Settings, it says the connection works fine.

2024-08-23T08:34:46.810765650Z INFO:     192.168.7.10:0 - "GET /ws/socket.io/?EIO=4&transport=polling&t=P5-Nlyh&sid=Lkx7KhmXwJxnb1tCAAAY HTTP/1.1" 400 Bad Request
2024-08-23T08:34:46.825403347Z INFO:     192.168.7.10:0 - "POST /ws/socket.io/?EIO=4&transport=polling&t=P5-Nwy2&sid=Lkx7KhmXwJxnb1tCAAAY HTTP/1.1" 400 Bad Request
2024-08-23T08:34:48.754452352Z INFO:     192.168.7.10:0 - "GET /ws/socket.io/?EIO=4&transport=polling&t=P5-NxQC HTTP/1.1" 200 OK
2024-08-23T08:34:48.771937736Z INFO:     192.168.7.10:0 - "POST /ws/socket.io/?EIO=4&transport=polling&t=P5-NxQQ&sid=dFblD1DTr0tMYv-1AAAa HTTP/1.1" 200 OK
2024-08-23T08:34:48.773591426Z INFO:     192.168.7.10:0 - "GET /ws/socket.io/?EIO=4&transport=polling&t=P5-NxQR&sid=dFblD1DTr0tMYv-1AAAa HTTP/1.1" 200 OK
2024-08-23T08:34:49.146932524Z INFO:     58.152.62.48:0 - "GET /ws/socket.io/?EIO=4&transport=polling&t=P5-NrlC.0&sid=DTha41-p64s4RW73AAAI HTTP/1.1" 200 OK
2024-08-23T08:34:49.175557135Z INFO:     58.152.62.48:0 - "POST /ws/socket.io/?EIO=4&transport=polling&t=P5-NxsC&sid=DTha41-p64s4RW73AAAI HTTP/1.1" 200 OK
2024-08-23T08:35:13.755780691Z INFO:     192.168.7.10:0 - "GET /ws/socket.io/?EIO=4&transport=websocket&sid=dFblD1DTr0tMYv-1AAAa HTTP/1.1" 200 OK
2024-08-23T08:35:14.177095954Z INFO:     58.152.62.48:0 - "GET /ws/socket.io/?EIO=4&transport=polling&t=P5-NxsC.0&sid=DTha41-p64s4RW73AAAI HTTP/1.1" 200 OK
2024-08-23T08:35:14.206322534Z INFO:     58.152.62.48:0 - "POST /ws/socket.io/?EIO=4&transport=polling&t=P5-O1zJ&sid=DTha41-p64s4RW73AAAI HTTP/1.1" 200 OK
2024-08-23T08:35:26.472806608Z INFO:     58.152.62.48:0 - "POST /api/chat/completions HTTP/1.1" 500 Internal Server Error
2024-08-23T08:35:26.478708626Z ERROR:    Exception in ASGI application
2024-08-23T08:35:26.478718326Z   + Exception Group Traceback (most recent call last):
2024-08-23T08:35:26.478720860Z   |   File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 87, in collapse_excgroups
2024-08-23T08:35:26.478723409Z   |     yield
2024-08-23T08:35:26.478725371Z   |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 190, in __call__
2024-08-23T08:35:26.478727500Z   |     async with anyio.create_task_group() as task_group:
2024-08-23T08:35:26.478729562Z   |   File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 680, in __aexit__
2024-08-23T08:35:26.478731619Z   |     raise BaseExceptionGroup(
2024-08-23T08:35:26.478733833Z   | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
2024-08-23T08:35:26.478735904Z   +-+---------------- 1 ----------------
2024-08-23T08:35:26.478737805Z     | Traceback (most recent call last):
2024-08-23T08:35:26.478739746Z     |   File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py", line 401, in run_asgi
2024-08-23T08:35:26.478742026Z     |     result = await app(  # type: ignore[func-returns-value]
2024-08-23T08:35:26.478744059Z     |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-08-23T08:35:26.478758154Z     |   File "/usr/local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 70, in __call__
2024-08-23T08:35:26.478760540Z     |     return await self.app(scope, receive, send)
2024-08-23T08:35:26.478762715Z     |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-08-23T08:35:26.478764775Z     |   File "/usr/local/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in __call__
2024-08-23T08:35:26.478766849Z     |     await super().__call__(scope, receive, send)
2024-08-23T08:35:26.478768794Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/applications.py", line 123, in __call__
2024-08-23T08:35:26.478770845Z     |     await self.middleware_stack(scope, receive, send)
2024-08-23T08:35:26.478772716Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 186, in __call__
2024-08-23T08:35:26.478774782Z     |     raise exc
2024-08-23T08:35:26.478776701Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 164, in __call__
2024-08-23T08:35:26.478778761Z     |     await self.app(scope, receive, _send)
2024-08-23T08:35:26.478780633Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__
2024-08-23T08:35:26.478782681Z     |     with collapse_excgroups():
2024-08-23T08:35:26.478784530Z     |   File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__
2024-08-23T08:35:26.478786585Z     |     self.gen.throw(typ, value, traceback)
2024-08-23T08:35:26.478789043Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
2024-08-23T08:35:26.478791136Z     |     raise exc
2024-08-23T08:35:26.478792921Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__
2024-08-23T08:35:26.478794986Z     |     response = await self.dispatch_func(request, call_next)
2024-08-23T08:35:26.478796910Z     |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-08-23T08:35:26.478798890Z     |   File "/app/backend/main.py", line 798, in update_embedding_function
2024-08-23T08:35:26.478800932Z     |     response = await call_next(request)
2024-08-23T08:35:26.478802824Z     |                ^^^^^^^^^^^^^^^^^^^^^^^^
2024-08-23T08:35:26.478804689Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next
2024-08-23T08:35:26.478806718Z     |     raise app_exc
2024-08-23T08:35:26.478808573Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro
2024-08-23T08:35:26.478810639Z     |     await self.app(scope, receive_or_disconnect, send_no_error)
2024-08-23T08:35:26.478812520Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__
2024-08-23T08:35:26.478817124Z     |     with collapse_excgroups():
2024-08-23T08:35:26.478819003Z     |   File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__
2024-08-23T08:35:26.478821068Z     |     self.gen.throw(typ, value, traceback)
2024-08-23T08:35:26.478823004Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
2024-08-23T08:35:26.478825063Z     |     raise exc
2024-08-23T08:35:26.478826840Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__
2024-08-23T08:35:26.478829017Z     |     response = await self.dispatch_func(request, call_next)
2024-08-23T08:35:26.478830990Z     |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-08-23T08:35:26.478832918Z     |   File "/app/backend/main.py", line 789, in check_url
2024-08-23T08:35:26.478834895Z     |     response = await call_next(request)
2024-08-23T08:35:26.478836770Z     |                ^^^^^^^^^^^^^^^^^^^^^^^^
2024-08-23T08:35:26.478838628Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next
2024-08-23T08:35:26.478840657Z     |     raise app_exc
2024-08-23T08:35:26.478842477Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro
2024-08-23T08:35:26.478844524Z     |     await self.app(scope, receive_or_disconnect, send_no_error)
2024-08-23T08:35:26.478846538Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__
2024-08-23T08:35:26.478850010Z     |     with collapse_excgroups():
2024-08-23T08:35:26.478852173Z     |   File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__
2024-08-23T08:35:26.478854286Z     |     self.gen.throw(typ, value, traceback)
2024-08-23T08:35:26.478856154Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
2024-08-23T08:35:26.478858204Z     |     raise exc
2024-08-23T08:35:26.478859985Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__
2024-08-23T08:35:26.478862076Z     |     response = await self.dispatch_func(request, call_next)
2024-08-23T08:35:26.478864013Z     |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-08-23T08:35:26.478865928Z     |   File "/app/backend/main.py", line 775, in commit_session_after_request
2024-08-23T08:35:26.478867987Z     |     response = await call_next(request)
2024-08-23T08:35:26.478869909Z     |                ^^^^^^^^^^^^^^^^^^^^^^^^
2024-08-23T08:35:26.478871753Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next
2024-08-23T08:35:26.478873813Z     |     raise app_exc
2024-08-23T08:35:26.478875602Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro
2024-08-23T08:35:26.478879636Z     |     await self.app(scope, receive_or_disconnect, send_no_error)
2024-08-23T08:35:26.478881554Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/cors.py", line 93, in __call__
2024-08-23T08:35:26.478883585Z     |     await self.simple_response(scope, receive, send, request_headers=headers)
2024-08-23T08:35:26.478885489Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/cors.py", line 148, in simple_response
2024-08-23T08:35:26.478887555Z     |     await self.app(scope, receive, send)
2024-08-23T08:35:26.478889428Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__
2024-08-23T08:35:26.478891459Z     |     with collapse_excgroups():
2024-08-23T08:35:26.478893314Z     |   File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__
2024-08-23T08:35:26.478895345Z     |     self.gen.throw(typ, value, traceback)
2024-08-23T08:35:26.478897363Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
2024-08-23T08:35:26.478899419Z     |     raise exc
2024-08-23T08:35:26.478901218Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__
2024-08-23T08:35:26.478903301Z     |     response = await self.dispatch_func(request, call_next)
2024-08-23T08:35:26.478905236Z     |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-08-23T08:35:26.478907177Z     |   File "/app/backend/main.py", line 754, in dispatch
2024-08-23T08:35:26.478909488Z     |     response = await call_next(request)
2024-08-23T08:35:26.478911448Z     |                ^^^^^^^^^^^^^^^^^^^^^^^^
2024-08-23T08:35:26.478918340Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next
2024-08-23T08:35:26.478920408Z     |     raise app_exc
2024-08-23T08:35:26.478922210Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro
2024-08-23T08:35:26.478924247Z     |     await self.app(scope, receive_or_disconnect, send_no_error)
2024-08-23T08:35:26.478926217Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__
2024-08-23T08:35:26.478928255Z     |     with collapse_excgroups():
2024-08-23T08:35:26.478930161Z     |   File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__
2024-08-23T08:35:26.478932167Z     |     self.gen.throw(typ, value, traceback)
2024-08-23T08:35:26.478934003Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
2024-08-23T08:35:26.478936099Z     |     raise exc
2024-08-23T08:35:26.478937860Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__
2024-08-23T08:35:26.478939919Z     |     response = await self.dispatch_func(request, call_next)
2024-08-23T08:35:26.478943689Z     |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-08-23T08:35:26.478945614Z     |   File "/app/backend/main.py", line 619, in dispatch
2024-08-23T08:35:26.478947614Z     |     response = await call_next(request)
2024-08-23T08:35:26.478949518Z     |                ^^^^^^^^^^^^^^^^^^^^^^^^
2024-08-23T08:35:26.478951360Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next
2024-08-23T08:35:26.478953416Z     |     raise app_exc
2024-08-23T08:35:26.478955239Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro
2024-08-23T08:35:26.478957297Z     |     await self.app(scope, receive_or_disconnect, send_no_error)
2024-08-23T08:35:26.478959195Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 65, in __call__
2024-08-23T08:35:26.478961255Z     |     await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
2024-08-23T08:35:26.478963171Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
2024-08-23T08:35:26.478965277Z     |     raise exc
2024-08-23T08:35:26.478967064Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
2024-08-23T08:35:26.478969108Z     |     await app(scope, receive, sender)
2024-08-23T08:35:26.478971042Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 756, in __call__
2024-08-23T08:35:26.478973333Z     |     await self.middleware_stack(scope, receive, send)
2024-08-23T08:35:26.478975239Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 776, in app
2024-08-23T08:35:26.478977321Z     |     await route.handle(scope, receive, send)
2024-08-23T08:35:26.478979197Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 297, in handle
2024-08-23T08:35:26.478981248Z     |     await self.app(scope, receive, send)
2024-08-23T08:35:26.478983212Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 77, in app
2024-08-23T08:35:26.478985318Z     |     await wrap_app_handling_exceptions(app, request)(scope, receive, send)
2024-08-23T08:35:26.478987264Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
2024-08-23T08:35:26.478989328Z     |     raise exc
2024-08-23T08:35:26.478991128Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
2024-08-23T08:35:26.478993215Z     |     await app(scope, receive, sender)
2024-08-23T08:35:26.478995111Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 72, in app
2024-08-23T08:35:26.478997130Z     |     response = await func(request)
2024-08-23T08:35:26.479006708Z     |                ^^^^^^^^^^^^^^^^^^^
2024-08-23T08:35:26.479008603Z     |   File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 278, in app
2024-08-23T08:35:26.479010637Z     |     raw_response = await run_endpoint_function(
2024-08-23T08:35:26.479014281Z     |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-08-23T08:35:26.479017210Z     |   File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 191, in run_endpoint_function
2024-08-23T08:35:26.479019178Z     |     return await dependant.call(**values)
2024-08-23T08:35:26.479020911Z     |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-08-23T08:35:26.479022721Z     |   File "/app/backend/main.py", line 1003, in generate_chat_completions
2024-08-23T08:35:26.479024590Z     |     return await generate_openai_chat_completion(form_data, user=user)
2024-08-23T08:35:26.479026390Z     |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-08-23T08:35:26.479028177Z     |   File "/app/backend/apps/openai/main.py", line 378, in generate_chat_completion
2024-08-23T08:35:26.479030114Z     |     model = app.state.MODELS[payload.get("model")]
2024-08-23T08:35:26.479032006Z     |             ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
2024-08-23T08:35:26.479033766Z     | KeyError: 'dolphin'
2024-08-23T08:35:26.479035510Z     +------------------------------------
2024-08-23T08:35:26.479037293Z 
2024-08-23T08:35:26.479038998Z During handling of the above exception, another exception occurred:
2024-08-23T08:35:26.479040811Z 
2024-08-23T08:35:26.479042447Z Traceback (most recent call last):
2024-08-23T08:35:26.479044497Z   File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py", line 401, in run_asgi
2024-08-23T08:35:26.479046534Z     result = await app(  # type: ignore[func-returns-value]
2024-08-23T08:35:26.479048288Z              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-08-23T08:35:26.479050072Z   File "/usr/local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 70, in __call__
2024-08-23T08:35:26.479052016Z     return await self.app(scope, receive, send)
2024-08-23T08:35:26.479053764Z            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-08-23T08:35:26.479055515Z   File "/usr/local/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in __call__
2024-08-23T08:35:26.479057433Z     await super().__call__(scope, receive, send)
2024-08-23T08:35:26.479059179Z   File "/usr/local/lib/python3.11/site-packages/starlette/applications.py", line 123, in __call__
2024-08-23T08:35:26.479061055Z     await self.middleware_stack(scope, receive, send)
2024-08-23T08:35:26.479062858Z   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 186, in __call__
2024-08-23T08:35:26.479064750Z     raise exc
2024-08-23T08:35:26.479068265Z   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 164, in __call__
2024-08-23T08:35:26.479070163Z     await self.app(scope, receive, _send)
2024-08-23T08:35:26.479071885Z   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__
2024-08-23T08:35:26.479073746Z     with collapse_excgroups():
2024-08-23T08:35:26.479075563Z   File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__
2024-08-23T08:35:26.479077365Z     self.gen.throw(typ, value, traceback)
2024-08-23T08:35:26.479079106Z   File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
2024-08-23T08:35:26.479081024Z     raise exc
2024-08-23T08:35:26.479082733Z   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__
2024-08-23T08:35:26.479084607Z     response = await self.dispatch_func(request, call_next)
2024-08-23T08:35:26.479086349Z                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-08-23T08:35:26.479088129Z   File "/app/backend/main.py", line 798, in update_embedding_function
2024-08-23T08:35:26.479089937Z     response = await call_next(request)
2024-08-23T08:35:26.479091675Z                ^^^^^^^^^^^^^^^^^^^^^^^^
2024-08-23T08:35:26.479093395Z   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next
2024-08-23T08:35:26.479095287Z     raise app_exc
2024-08-23T08:35:26.479097027Z   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro
2024-08-23T08:35:26.479098863Z     await self.app(scope, receive_or_disconnect, send_no_error)
2024-08-23T08:35:26.479100633Z   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__
2024-08-23T08:35:26.479102703Z     with collapse_excgroups():
2024-08-23T08:35:26.479104471Z   File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__
2024-08-23T08:35:26.479106289Z     self.gen.throw(typ, value, traceback)
2024-08-23T08:35:26.479108016Z   File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
2024-08-23T08:35:26.479109925Z     raise exc
2024-08-23T08:35:26.479111619Z   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__
2024-08-23T08:35:26.479113566Z     response = await self.dispatch_func(request, call_next)
2024-08-23T08:35:26.479115332Z                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-08-23T08:35:26.479117066Z   File "/app/backend/main.py", line 789, in check_url
2024-08-23T08:35:26.479118932Z     response = await call_next(request)
2024-08-23T08:35:26.479120625Z                ^^^^^^^^^^^^^^^^^^^^^^^^
2024-08-23T08:35:26.479122366Z   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next
2024-08-23T08:35:26.479125944Z     raise app_exc
2024-08-23T08:35:26.479127613Z   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro
2024-08-23T08:35:26.479129469Z     await self.app(scope, receive_or_disconnect, send_no_error)
2024-08-23T08:35:26.479131217Z   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__
2024-08-23T08:35:26.479133117Z     with collapse_excgroups():
2024-08-23T08:35:26.479134879Z   File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__
2024-08-23T08:35:26.479136733Z     self.gen.throw(typ, value, traceback)
2024-08-23T08:35:26.479138475Z   File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
2024-08-23T08:35:26.479140397Z     raise exc
2024-08-23T08:35:26.479142060Z   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__
2024-08-23T08:35:26.479143968Z     response = await self.dispatch_func(request, call_next)
2024-08-23T08:35:26.479145710Z                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-08-23T08:35:26.479147496Z   File "/app/backend/main.py", line 775, in commit_session_after_request
2024-08-23T08:35:26.479149311Z     response = await call_next(request)
2024-08-23T08:35:26.479151038Z                ^^^^^^^^^^^^^^^^^^^^^^^^
2024-08-23T08:35:26.479152756Z   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next
2024-08-23T08:35:26.479154662Z     raise app_exc
2024-08-23T08:35:26.479156331Z   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro
2024-08-23T08:35:26.479158180Z     await self.app(scope, receive_or_disconnect, send_no_error)
2024-08-23T08:35:26.479159980Z   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/cors.py", line 93, in __call__
2024-08-23T08:35:26.479162129Z     await self.simple_response(scope, receive, send, request_headers=headers)
2024-08-23T08:35:26.479163986Z   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/cors.py", line 148, in simple_response
2024-08-23T08:35:26.479165858Z     await self.app(scope, receive, send)
2024-08-23T08:35:26.479167578Z   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__
2024-08-23T08:35:26.479169449Z     with collapse_excgroups():
2024-08-23T08:35:26.479171248Z   File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__
2024-08-23T08:35:26.479173054Z     self.gen.throw(typ, value, traceback)
2024-08-23T08:35:26.479174780Z   File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
2024-08-23T08:35:26.479176692Z     raise exc
2024-08-23T08:35:26.479178361Z   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__
2024-08-23T08:35:26.479181935Z     response = await self.dispatch_func(request, call_next)
2024-08-23T08:35:26.479183687Z                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-08-23T08:35:26.479185416Z   File "/app/backend/main.py", line 754, in dispatch
2024-08-23T08:35:26.479187248Z     response = await call_next(request)
2024-08-23T08:35:26.479188939Z                ^^^^^^^^^^^^^^^^^^^^^^^^
2024-08-23T08:35:26.479190679Z   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next
2024-08-23T08:35:26.479192640Z     raise app_exc
2024-08-23T08:35:26.479194397Z   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro
2024-08-23T08:35:26.479196279Z     await self.app(scope, receive_or_disconnect, send_no_error)
2024-08-23T08:35:26.479198031Z   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__
2024-08-23T08:35:26.479199884Z     with collapse_excgroups():
2024-08-23T08:35:26.479201639Z   File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__
2024-08-23T08:35:26.479203515Z     self.gen.throw(typ, value, traceback)
2024-08-23T08:35:26.479205264Z   File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
2024-08-23T08:35:26.479207163Z     raise exc
2024-08-23T08:35:26.479208830Z   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__
2024-08-23T08:35:26.479210737Z     response = await self.dispatch_func(request, call_next)
2024-08-23T08:35:26.479212485Z                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-08-23T08:35:26.479214252Z   File "/app/backend/main.py", line 619, in dispatch
2024-08-23T08:35:26.479216091Z     response = await call_next(request)
2024-08-23T08:35:26.479217787Z                ^^^^^^^^^^^^^^^^^^^^^^^^
2024-08-23T08:35:26.479219514Z   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next
2024-08-23T08:35:26.479221439Z     raise app_exc
2024-08-23T08:35:26.479223250Z   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro
2024-08-23T08:35:26.479225151Z     await self.app(scope, receive_or_disconnect, send_no_error)
2024-08-23T08:35:26.479226915Z   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 65, in __call__
2024-08-23T08:35:26.479228831Z     await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
2024-08-23T08:35:26.479230617Z   File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
2024-08-23T08:35:26.479232563Z     raise exc
2024-08-23T08:35:26.479234198Z   File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
2024-08-23T08:35:26.479237781Z     await app(scope, receive, sender)
2024-08-23T08:35:26.479239519Z   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 756, in __call__
2024-08-23T08:35:26.479241412Z     await self.middleware_stack(scope, receive, send)
2024-08-23T08:35:26.479243170Z   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 776, in app
2024-08-23T08:35:26.479245046Z     await route.handle(scope, receive, send)
2024-08-23T08:35:26.479246804Z   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 297, in handle
2024-08-23T08:35:26.479248671Z     await self.app(scope, receive, send)
2024-08-23T08:35:26.479250422Z   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 77, in app
2024-08-23T08:35:26.479252286Z     await wrap_app_handling_exceptions(app, request)(scope, receive, send)
2024-08-23T08:35:26.479254037Z   File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
2024-08-23T08:35:26.479255922Z     raise exc
2024-08-23T08:35:26.479257554Z   File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
2024-08-23T08:35:26.479259448Z     await app(scope, receive, sender)
2024-08-23T08:35:26.479261188Z   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 72, in app
2024-08-23T08:35:26.479263070Z     response = await func(request)
2024-08-23T08:35:26.479264821Z                ^^^^^^^^^^^^^^^^^^^
2024-08-23T08:35:26.479266550Z   File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 278, in app
2024-08-23T08:35:26.479268497Z     raw_response = await run_endpoint_function(
2024-08-23T08:35:26.479270217Z                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-08-23T08:35:26.479271970Z   File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 191, in run_endpoint_function
2024-08-23T08:35:26.479273944Z     return await dependant.call(**values)
2024-08-23T08:35:26.479275692Z            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-08-23T08:35:26.479277434Z   File "/app/backend/main.py", line 1003, in generate_chat_completions
2024-08-23T08:35:26.479279487Z     return await generate_openai_chat_completion(form_data, user=user)
2024-08-23T08:35:26.479281302Z            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-08-23T08:35:26.479283080Z   File "/app/backend/apps/openai/main.py", line 378, in generate_chat_completion
2024-08-23T08:35:26.479284985Z     model = app.state.MODELS[payload.get("model")]
2024-08-23T08:35:26.479286798Z             ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
2024-08-23T08:35:26.479288571Z KeyError: 'dolphin'
2024-08-23T08:35:26.516679689Z generate_title
2024-08-23T08:35:26.516715957Z ollama-hub/uaquax/chatgpt-4-uncensored:latest
2024-08-23T08:35:26.516742691Z INFO:     58.152.62.48:0 - "POST /api/task/title/completions HTTP/1.1" 500 Internal Server Error
2024-08-23T08:35:26.522945041Z ERROR:    Exception in ASGI application
2024-08-23T08:35:26.522984706Z   + Exception Group Traceback (most recent call last):
2024-08-23T08:35:26.522991203Z   |   File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 87, in collapse_excgroups
2024-08-23T08:35:26.522996320Z   |     yield
2024-08-23T08:35:26.523000687Z   |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 190, in __call__
2024-08-23T08:35:26.523005533Z   |     async with anyio.create_task_group() as task_group:
2024-08-23T08:35:26.523010179Z   |   File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 680, in __aexit__
2024-08-23T08:35:26.523015371Z   |     raise BaseExceptionGroup(
2024-08-23T08:35:26.523019878Z   | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
2024-08-23T08:35:26.523024310Z   +-+---------------- 1 ----------------
2024-08-23T08:35:26.523028376Z     | Traceback (most recent call last):
2024-08-23T08:35:26.523032595Z     |   File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py", line 401, in run_asgi
2024-08-23T08:35:26.523037176Z     |     result = await app(  # type: ignore[func-returns-value]
2024-08-23T08:35:26.523041726Z     |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-08-23T08:35:26.523045988Z     |   File "/usr/local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 70, in __call__
2024-08-23T08:35:26.523050917Z     |     return await self.app(scope, receive, send)
2024-08-23T08:35:26.523055804Z     |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-08-23T08:35:26.523060694Z     |   File "/usr/local/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in __call__
2024-08-23T08:35:26.523065908Z     |     await super().__call__(scope, receive, send)
2024-08-23T08:35:26.523070849Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/applications.py", line 123, in __call__
2024-08-23T08:35:26.523075944Z     |     await self.middleware_stack(scope, receive, send)
2024-08-23T08:35:26.523080901Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 186, in __call__
2024-08-23T08:35:26.523086149Z     |     raise exc
2024-08-23T08:35:26.523090937Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 164, in __call__
2024-08-23T08:35:26.523096123Z     |     await self.app(scope, receive, _send)
2024-08-23T08:35:26.523100927Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__
2024-08-23T08:35:26.523106104Z     |     with collapse_excgroups():
2024-08-23T08:35:26.523110960Z     |   File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__
2024-08-23T08:35:26.523137605Z     |     self.gen.throw(typ, value, traceback)
2024-08-23T08:35:26.523149374Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
2024-08-23T08:35:26.523155211Z     |     raise exc
2024-08-23T08:35:26.523168161Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__
2024-08-23T08:35:26.523173564Z     |     response = await self.dispatch_func(request, call_next)
2024-08-23T08:35:26.523178584Z     |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-08-23T08:35:26.523183477Z     |   File "/app/backend/main.py", line 798, in update_embedding_function
2024-08-23T08:35:26.523188555Z     |     response = await call_next(request)
2024-08-23T08:35:26.523193503Z     |                ^^^^^^^^^^^^^^^^^^^^^^^^
2024-08-23T08:35:26.523198281Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next
2024-08-23T08:35:26.523203328Z     |     raise app_exc
2024-08-23T08:35:26.523208177Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro
2024-08-23T08:35:26.523213359Z     |     await self.app(scope, receive_or_disconnect, send_no_error)
2024-08-23T08:35:26.523218393Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__
2024-08-23T08:35:26.523223517Z     |     with collapse_excgroups():
2024-08-23T08:35:26.523228324Z     |   File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__
2024-08-23T08:35:26.523233390Z     |     self.gen.throw(typ, value, traceback)
2024-08-23T08:35:26.523238304Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
2024-08-23T08:35:26.523243410Z     |     raise exc
2024-08-23T08:35:26.523248231Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__
2024-08-23T08:35:26.523253387Z     |     response = await self.dispatch_func(request, call_next)
2024-08-23T08:35:26.523258381Z     |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-08-23T08:35:26.523263286Z     |   File "/app/backend/main.py", line 789, in check_url
2024-08-23T08:35:26.523268535Z     |     response = await call_next(request)
2024-08-23T08:35:26.523273500Z     |                ^^^^^^^^^^^^^^^^^^^^^^^^
2024-08-23T08:35:26.523278361Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next
2024-08-23T08:35:26.523283471Z     |     raise app_exc
2024-08-23T08:35:26.523288207Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro
2024-08-23T08:35:26.523293351Z     |     await self.app(scope, receive_or_disconnect, send_no_error)
2024-08-23T08:35:26.523304478Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__
2024-08-23T08:35:26.523310113Z     |     with collapse_excgroups():
2024-08-23T08:35:26.523315611Z     |   File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__
2024-08-23T08:35:26.523320762Z     |     self.gen.throw(typ, value, traceback)
2024-08-23T08:35:26.523325581Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
2024-08-23T08:35:26.523330762Z     |     raise exc
2024-08-23T08:35:26.523335421Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__
2024-08-23T08:35:26.523340590Z     |     response = await self.dispatch_func(request, call_next)
2024-08-23T08:35:26.523345690Z     |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-08-23T08:35:26.523350668Z     |   File "/app/backend/main.py", line 775, in commit_session_after_request
2024-08-23T08:35:26.523355589Z     |     response = await call_next(request)
2024-08-23T08:35:26.523360513Z     |                ^^^^^^^^^^^^^^^^^^^^^^^^
2024-08-23T08:35:26.523365337Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next
2024-08-23T08:35:26.523370501Z     |     raise app_exc
2024-08-23T08:35:26.523375187Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro
2024-08-23T08:35:26.523380296Z     |     await self.app(scope, receive_or_disconnect, send_no_error)
2024-08-23T08:35:26.523385159Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/cors.py", line 93, in __call__
2024-08-23T08:35:26.523390260Z     |     await self.simple_response(scope, receive, send, request_headers=headers)
2024-08-23T08:35:26.523395288Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/cors.py", line 148, in simple_response
2024-08-23T08:35:26.523400534Z     |     await self.app(scope, receive, send)
2024-08-23T08:35:26.523405403Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__
2024-08-23T08:35:26.523410482Z     |     with collapse_excgroups():
2024-08-23T08:35:26.523415326Z     |   File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__
2024-08-23T08:35:26.523420460Z     |     self.gen.throw(typ, value, traceback)
2024-08-23T08:35:26.523425149Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
2024-08-23T08:35:26.523430297Z     |     raise exc
2024-08-23T08:35:26.523434950Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__
2024-08-23T08:35:26.523439999Z     |     response = await self.dispatch_func(request, call_next)
2024-08-23T08:35:26.523444833Z     |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-08-23T08:35:26.523455153Z     |   File "/app/backend/main.py", line 721, in dispatch
2024-08-23T08:35:26.523461372Z     |     return await call_next(request)
2024-08-23T08:35:26.523466397Z     |            ^^^^^^^^^^^^^^^^^^^^^^^^
2024-08-23T08:35:26.523471272Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next
2024-08-23T08:35:26.523476353Z     |     raise app_exc
2024-08-23T08:35:26.523480980Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro
2024-08-23T08:35:26.523486050Z     |     await self.app(scope, receive_or_disconnect, send_no_error)
2024-08-23T08:35:26.523491048Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__
2024-08-23T08:35:26.523496388Z     |     with collapse_excgroups():
2024-08-23T08:35:26.523501242Z     |   File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__
2024-08-23T08:35:26.523506291Z     |     self.gen.throw(typ, value, traceback)
2024-08-23T08:35:26.523511067Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
2024-08-23T08:35:26.523516192Z     |     raise exc
2024-08-23T08:35:26.523520850Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__
2024-08-23T08:35:26.523525955Z     |     response = await self.dispatch_func(request, call_next)
2024-08-23T08:35:26.523530812Z     |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-08-23T08:35:26.523535720Z     |   File "/app/backend/main.py", line 513, in dispatch
2024-08-23T08:35:26.523540754Z     |     return await call_next(request)
2024-08-23T08:35:26.523545596Z     |            ^^^^^^^^^^^^^^^^^^^^^^^^
2024-08-23T08:35:26.523550383Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next
2024-08-23T08:35:26.523555537Z     |     raise app_exc
2024-08-23T08:35:26.523560206Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro
2024-08-23T08:35:26.523565225Z     |     await self.app(scope, receive_or_disconnect, send_no_error)
2024-08-23T08:35:26.523570265Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 65, in __call__
2024-08-23T08:35:26.523575434Z     |     await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
2024-08-23T08:35:26.523580508Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
2024-08-23T08:35:26.523585798Z     |     raise exc
2024-08-23T08:35:26.523590446Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
2024-08-23T08:35:26.523595608Z     |     await app(scope, receive, sender)
2024-08-23T08:35:26.523606105Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 756, in __call__
2024-08-23T08:35:26.523612347Z     |     await self.middleware_stack(scope, receive, send)
2024-08-23T08:35:26.523617314Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 776, in app
2024-08-23T08:35:26.523622426Z     |     await route.handle(scope, receive, send)
2024-08-23T08:35:26.523627231Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 297, in handle
2024-08-23T08:35:26.523632358Z     |     await self.app(scope, receive, send)
2024-08-23T08:35:26.523637085Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 77, in app
2024-08-23T08:35:26.523642216Z     |     await wrap_app_handling_exceptions(app, request)(scope, receive, send)
2024-08-23T08:35:26.523647287Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
2024-08-23T08:35:26.523652493Z     |     raise exc
2024-08-23T08:35:26.523657214Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
2024-08-23T08:35:26.523662298Z     |     await app(scope, receive, sender)
2024-08-23T08:35:26.523667178Z     |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 72, in app
2024-08-23T08:35:26.523672332Z     |     response = await func(request)
2024-08-23T08:35:26.523677176Z     |                ^^^^^^^^^^^^^^^^^^^
2024-08-23T08:35:26.523682038Z     |   File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 278, in app
2024-08-23T08:35:26.523687179Z     |     raw_response = await run_endpoint_function(
2024-08-23T08:35:26.523692032Z     |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-08-23T08:35:26.523696956Z     |   File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 191, in run_endpoint_function
2024-08-23T08:35:26.523702126Z     |     return await dependant.call(**values)
2024-08-23T08:35:26.523706892Z     |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-08-23T08:35:26.523711814Z     |   File "/app/backend/main.py", line 1390, in generate_title
2024-08-23T08:35:26.523716813Z     |     return await generate_chat_completions(form_data=payload, user=user)
2024-08-23T08:35:26.523721835Z     |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-08-23T08:35:26.523726767Z     |   File "/app/backend/main.py", line 1003, in generate_chat_completions
2024-08-23T08:35:26.523731846Z     |     return await generate_openai_chat_completion(form_data, user=user)
2024-08-23T08:35:26.523736699Z     |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-08-23T08:35:26.523741627Z     |   File "/app/backend/apps/openai/main.py", line 378, in generate_chat_completion
2024-08-23T08:35:26.523746789Z     |     model = app.state.MODELS[payload.get("model")]
2024-08-23T08:35:26.523757355Z     |             ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
2024-08-23T08:35:26.523762674Z     | KeyError: 'dolphin'
2024-08-23T08:35:26.523768075Z     +------------------------------------
2024-08-23T08:35:26.523773031Z 
2024-08-23T08:35:26.523777658Z During handling of the above exception, another exception occurred:
2024-08-23T08:35:26.523782639Z 
2024-08-23T08:35:26.523787269Z Traceback (most recent call last):
2024-08-23T08:35:26.523792073Z   File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py", line 401, in run_asgi
2024-08-23T08:35:26.523797375Z     result = await app(  # type: ignore[func-returns-value]
2024-08-23T08:35:26.523802271Z              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-08-23T08:35:26.523807158Z   File "/usr/local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 70, in __call__
2024-08-23T08:35:26.523812337Z     return await self.app(scope, receive, send)
2024-08-23T08:35:26.523817145Z            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-08-23T08:35:26.523821965Z   File "/usr/local/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in __call__
2024-08-23T08:35:26.523827223Z     await super().__call__(scope, receive, send)
2024-08-23T08:35:26.523832185Z   File "/usr/local/lib/python3.11/site-packages/starlette/applications.py", line 123, in __call__
2024-08-23T08:35:26.523837347Z     await self.middleware_stack(scope, receive, send)
2024-08-23T08:35:26.523842248Z   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 186, in __call__
2024-08-23T08:35:26.523847380Z     raise exc
2024-08-23T08:35:26.523852052Z   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 164, in __call__
2024-08-23T08:35:26.523857167Z     await self.app(scope, receive, _send)
2024-08-23T08:35:26.523861948Z   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__
2024-08-23T08:35:26.523867028Z     with collapse_excgroups():
2024-08-23T08:35:26.523871865Z   File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__
2024-08-23T08:35:26.523876999Z     self.gen.throw(typ, value, traceback)
2024-08-23T08:35:26.523881739Z   File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
2024-08-23T08:35:26.523886890Z     raise exc
2024-08-23T08:35:26.523891489Z   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__
2024-08-23T08:35:26.523896650Z     response = await self.dispatch_func(request, call_next)
2024-08-23T08:35:26.523901496Z                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-08-23T08:35:26.523906331Z   File "/app/backend/main.py", line 798, in update_embedding_function
2024-08-23T08:35:26.523916215Z     response = await call_next(request)
2024-08-23T08:35:26.523921400Z                ^^^^^^^^^^^^^^^^^^^^^^^^
2024-08-23T08:35:26.523926299Z   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next
2024-08-23T08:35:26.523931512Z     raise app_exc
2024-08-23T08:35:26.523936719Z   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro
2024-08-23T08:35:26.523941812Z     await self.app(scope, receive_or_disconnect, send_no_error)
2024-08-23T08:35:26.523946404Z   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__
2024-08-23T08:35:26.523951217Z     with collapse_excgroups():
2024-08-23T08:35:26.523955742Z   File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__
2024-08-23T08:35:26.523960494Z     self.gen.throw(typ, value, traceback)
2024-08-23T08:35:26.523964983Z   File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
2024-08-23T08:35:26.523969755Z     raise exc
2024-08-23T08:35:26.523974150Z   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__
2024-08-23T08:35:26.523978948Z     response = await self.dispatch_func(request, call_next)
2024-08-23T08:35:26.523983537Z                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-08-23T08:35:26.523988115Z   File "/app/backend/main.py", line 789, in check_url
2024-08-23T08:35:26.523992778Z     response = await call_next(request)
2024-08-23T08:35:26.523997373Z                ^^^^^^^^^^^^^^^^^^^^^^^^
2024-08-23T08:35:26.524001891Z   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next
2024-08-23T08:35:26.524006693Z     raise app_exc
2024-08-23T08:35:26.524011116Z   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro
2024-08-23T08:35:26.524015910Z     await self.app(scope, receive_or_disconnect, send_no_error)
2024-08-23T08:35:26.524020528Z   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__
2024-08-23T08:35:26.524025348Z     with collapse_excgroups():
2024-08-23T08:35:26.524029819Z   File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__
2024-08-23T08:35:26.524034533Z     self.gen.throw(typ, value, traceback)
2024-08-23T08:35:26.524039060Z   File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
2024-08-23T08:35:26.524043861Z     raise exc
2024-08-23T08:35:26.524048242Z   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__
2024-08-23T08:35:26.524053014Z     response = await self.dispatch_func(request, call_next)
2024-08-23T08:35:26.524057495Z                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-08-23T08:35:26.524071588Z   File "/app/backend/main.py", line 775, in commit_session_after_request
2024-08-23T08:35:26.524076829Z     response = await call_next(request)
2024-08-23T08:35:26.524081346Z                ^^^^^^^^^^^^^^^^^^^^^^^^
2024-08-23T08:35:26.524085890Z   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next
2024-08-23T08:35:26.524090693Z     raise app_exc
2024-08-23T08:35:26.524095745Z   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro
2024-08-23T08:35:26.524100780Z     await self.app(scope, receive_or_disconnect, send_no_error)
2024-08-23T08:35:26.524105288Z   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/cors.py", line 93, in __call__
2024-08-23T08:35:26.524110008Z     await self.simple_response(scope, receive, send, request_headers=headers)
2024-08-23T08:35:26.524114793Z   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/cors.py", line 148, in simple_response
2024-08-23T08:35:26.524119586Z     await self.app(scope, receive, send)
2024-08-23T08:35:26.524124090Z   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__
2024-08-23T08:35:26.524128878Z     with collapse_excgroups():
2024-08-23T08:35:26.524133312Z   File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__
2024-08-23T08:35:26.524138034Z     self.gen.throw(typ, value, traceback)
2024-08-23T08:35:26.524142545Z   File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
2024-08-23T08:35:26.524147466Z     raise exc
2024-08-23T08:35:26.524151825Z   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__
2024-08-23T08:35:26.524156614Z     response = await self.dispatch_func(request, call_next)
2024-08-23T08:35:26.524161178Z                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-08-23T08:35:26.524165700Z   File "/app/backend/main.py", line 721, in dispatch
2024-08-23T08:35:26.524170416Z     return await call_next(request)
2024-08-23T08:35:26.524174962Z            ^^^^^^^^^^^^^^^^^^^^^^^^
2024-08-23T08:35:26.524179427Z   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next
2024-08-23T08:35:26.524184221Z     raise app_exc
2024-08-23T08:35:26.524188594Z   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro
2024-08-23T08:35:26.524193455Z     await self.app(scope, receive_or_disconnect, send_no_error)
2024-08-23T08:35:26.524198017Z   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__
2024-08-23T08:35:26.524202817Z     with collapse_excgroups():
2024-08-23T08:35:26.524207215Z   File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__
2024-08-23T08:35:26.524216709Z     self.gen.throw(typ, value, traceback)
2024-08-23T08:35:26.524221767Z   File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
2024-08-23T08:35:26.524226720Z     raise exc
2024-08-23T08:35:26.524231212Z   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__
2024-08-23T08:35:26.524236019Z     response = await self.dispatch_func(request, call_next)
2024-08-23T08:35:26.524240636Z                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-08-23T08:35:26.524245216Z   File "/app/backend/main.py", line 513, in dispatch
2024-08-23T08:35:26.524250316Z     return await call_next(request)
2024-08-23T08:35:26.524254811Z            ^^^^^^^^^^^^^^^^^^^^^^^^
2024-08-23T08:35:26.524259248Z   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next
2024-08-23T08:35:26.524264086Z     raise app_exc
2024-08-23T08:35:26.524268601Z   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro
2024-08-23T08:35:26.524273407Z     await self.app(scope, receive_or_disconnect, send_no_error)
2024-08-23T08:35:26.524277928Z   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 65, in __call__
2024-08-23T08:35:26.524282830Z     await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
2024-08-23T08:35:26.524287484Z   File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
2024-08-23T08:35:26.524292463Z     raise exc
2024-08-23T08:35:26.524296820Z   File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
2024-08-23T08:35:26.524301636Z     await app(scope, receive, sender)
2024-08-23T08:35:26.524306194Z   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 756, in __call__
2024-08-23T08:35:26.524310990Z     await self.middleware_stack(scope, receive, send)
2024-08-23T08:35:26.524315542Z   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 776, in app
2024-08-23T08:35:26.524320425Z     await route.handle(scope, receive, send)
2024-08-23T08:35:26.524324941Z   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 297, in handle
2024-08-23T08:35:26.524329692Z     await self.app(scope, receive, send)
2024-08-23T08:35:26.524334095Z   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 77, in app
2024-08-23T08:35:26.524338877Z     await wrap_app_handling_exceptions(app, request)(scope, receive, send)
2024-08-23T08:35:26.524343683Z   File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
2024-08-23T08:35:26.524348490Z     raise exc
2024-08-23T08:35:26.524352885Z   File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
2024-08-23T08:35:26.524362393Z     await app(scope, receive, sender)
2024-08-23T08:35:26.524367458Z   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 72, in app
2024-08-23T08:35:26.524372352Z     response = await func(request)
2024-08-23T08:35:26.524376912Z                ^^^^^^^^^^^^^^^^^^^
2024-08-23T08:35:26.524381377Z   File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 278, in app
2024-08-23T08:35:26.524386247Z     raw_response = await run_endpoint_function(
2024-08-23T08:35:26.524390879Z                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-08-23T08:35:26.524396115Z   File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 191, in run_endpoint_function
2024-08-23T08:35:26.524401150Z     return await dependant.call(**values)
2024-08-23T08:35:26.524405592Z            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-08-23T08:35:26.524410137Z   File "/app/backend/main.py", line 1390, in generate_title
2024-08-23T08:35:26.524414892Z     return await generate_chat_completions(form_data=payload, user=user)
2024-08-23T08:35:26.524419602Z            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-08-23T08:35:26.524424380Z   File "/app/backend/main.py", line 1003, in generate_chat_completions
2024-08-23T08:35:26.524429020Z     return await generate_openai_chat_completion(form_data, user=user)
2024-08-23T08:35:26.524433690Z            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-08-23T08:35:26.524438353Z   File "/app/backend/apps/openai/main.py", line 378, in generate_chat_completion
2024-08-23T08:35:26.524443121Z     model = app.state.MODELS[payload.get("model")]
2024-08-23T08:35:26.524447860Z             ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
2024-08-23T08:35:26.524452455Z KeyError: 'dolphin'
2024-08-23T08:35:26.561969576Z INFO:     58.152.62.48:0 - "POST /api/v1/chats/5a77e01e-ec88-4ade-9fad-a955d94ec47b HTTP/1.1" 200 OK
2024-08-23T08:35:26.637008968Z INFO:     58.152.62.48:0 - "GET /api/v1/chats/?page=1 HTTP/1.1" 200 OK
2024-08-23T08:35:26.669095128Z INFO:     58.152.62.48:0 - "GET /api/v1/chats/?page=1 HTTP/1.1" 200 OK
2024-08-23T08:35:33.787970003Z Unknown session ID -UbZOu98G-k3wxEJAAAb disconnected
2024-08-23T08:35:33.788032874Z INFO:     192.168.7.10:0 - "GET /ws/socket.io/?EIO=4&transport=polling&t=P5-NxQj&sid=dFblD1DTr0tMYv-1AAAa HTTP/1.1" 400 Bad Request
2024-08-23T08:35:33.801502161Z INFO:     192.168.7.10:0 - "POST /ws/socket.io/?EIO=4&transport=polling&t=P5-O6Q3&sid=dFblD1DTr0tMYv-1AAAa HTTP/1.1" 400 Bad Request
2024-08-23T08:35:35.764512473Z INFO:     192.168.7.10:0 - "GET /ws/socket.io/?EIO=4&transport=polling&t=P5-O6ui HTTP/1.1" 200 OK
2024-08-23T08:35:35.786638308Z INFO:     192.168.7.10:0 - "POST /ws/socket.io/?EIO=4&transport=polling&t=P5-O6uz&sid=hSbZtgX8K6-ve0c9AAAc HTTP/1.1" 200 OK
2024-08-23T08:35:35.787736652Z INFO:     192.168.7.10:0 - "GET /ws/socket.io/?EIO=4&transport=polling&t=P5-O6u-&sid=hSbZtgX8K6-ve0c9AAAc HTTP/1.1" 200 OK

<!-- gh-comment-id:2306594893 --> @MatthK commented on GitHub (Aug 23, 2024): Unfortunately I still receive this error, although I just updated to version 0.3.15. I'm running it in two docker containers, both Open-WebUI and Ollama. When I check the Ollama API in Settings, it says the connection works fine. ``` 2024-08-23T08:34:46.810765650Z INFO: 192.168.7.10:0 - "GET /ws/socket.io/?EIO=4&transport=polling&t=P5-Nlyh&sid=Lkx7KhmXwJxnb1tCAAAY HTTP/1.1" 400 Bad Request 2024-08-23T08:34:46.825403347Z INFO: 192.168.7.10:0 - "POST /ws/socket.io/?EIO=4&transport=polling&t=P5-Nwy2&sid=Lkx7KhmXwJxnb1tCAAAY HTTP/1.1" 400 Bad Request 2024-08-23T08:34:48.754452352Z INFO: 192.168.7.10:0 - "GET /ws/socket.io/?EIO=4&transport=polling&t=P5-NxQC HTTP/1.1" 200 OK 2024-08-23T08:34:48.771937736Z INFO: 192.168.7.10:0 - "POST /ws/socket.io/?EIO=4&transport=polling&t=P5-NxQQ&sid=dFblD1DTr0tMYv-1AAAa HTTP/1.1" 200 OK 2024-08-23T08:34:48.773591426Z INFO: 192.168.7.10:0 - "GET /ws/socket.io/?EIO=4&transport=polling&t=P5-NxQR&sid=dFblD1DTr0tMYv-1AAAa HTTP/1.1" 200 OK 2024-08-23T08:34:49.146932524Z INFO: 58.152.62.48:0 - "GET /ws/socket.io/?EIO=4&transport=polling&t=P5-NrlC.0&sid=DTha41-p64s4RW73AAAI HTTP/1.1" 200 OK 2024-08-23T08:34:49.175557135Z INFO: 58.152.62.48:0 - "POST /ws/socket.io/?EIO=4&transport=polling&t=P5-NxsC&sid=DTha41-p64s4RW73AAAI HTTP/1.1" 200 OK 2024-08-23T08:35:13.755780691Z INFO: 192.168.7.10:0 - "GET /ws/socket.io/?EIO=4&transport=websocket&sid=dFblD1DTr0tMYv-1AAAa HTTP/1.1" 200 OK 2024-08-23T08:35:14.177095954Z INFO: 58.152.62.48:0 - "GET /ws/socket.io/?EIO=4&transport=polling&t=P5-NxsC.0&sid=DTha41-p64s4RW73AAAI HTTP/1.1" 200 OK 2024-08-23T08:35:14.206322534Z INFO: 58.152.62.48:0 - "POST /ws/socket.io/?EIO=4&transport=polling&t=P5-O1zJ&sid=DTha41-p64s4RW73AAAI HTTP/1.1" 200 OK 2024-08-23T08:35:26.472806608Z INFO: 58.152.62.48:0 - "POST /api/chat/completions HTTP/1.1" 500 Internal Server Error 2024-08-23T08:35:26.478708626Z ERROR: Exception in ASGI application 2024-08-23T08:35:26.478718326Z + Exception Group Traceback (most recent call last): 2024-08-23T08:35:26.478720860Z | File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 87, in collapse_excgroups 2024-08-23T08:35:26.478723409Z | yield 2024-08-23T08:35:26.478725371Z | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 190, in __call__ 2024-08-23T08:35:26.478727500Z | async with anyio.create_task_group() as task_group: 2024-08-23T08:35:26.478729562Z | File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 680, in __aexit__ 2024-08-23T08:35:26.478731619Z | raise BaseExceptionGroup( 2024-08-23T08:35:26.478733833Z | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception) 2024-08-23T08:35:26.478735904Z +-+---------------- 1 ---------------- 2024-08-23T08:35:26.478737805Z | Traceback (most recent call last): 2024-08-23T08:35:26.478739746Z | File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py", line 401, in run_asgi 2024-08-23T08:35:26.478742026Z | result = await app( # type: ignore[func-returns-value] 2024-08-23T08:35:26.478744059Z | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-08-23T08:35:26.478758154Z | File "/usr/local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 70, in __call__ 2024-08-23T08:35:26.478760540Z | return await self.app(scope, receive, send) 2024-08-23T08:35:26.478762715Z | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-08-23T08:35:26.478764775Z | File "/usr/local/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in __call__ 2024-08-23T08:35:26.478766849Z | await super().__call__(scope, receive, send) 2024-08-23T08:35:26.478768794Z | File "/usr/local/lib/python3.11/site-packages/starlette/applications.py", line 123, in __call__ 2024-08-23T08:35:26.478770845Z | await self.middleware_stack(scope, receive, send) 2024-08-23T08:35:26.478772716Z | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 186, in __call__ 2024-08-23T08:35:26.478774782Z | raise exc 2024-08-23T08:35:26.478776701Z | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 164, in __call__ 2024-08-23T08:35:26.478778761Z | await self.app(scope, receive, _send) 2024-08-23T08:35:26.478780633Z | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__ 2024-08-23T08:35:26.478782681Z | with collapse_excgroups(): 2024-08-23T08:35:26.478784530Z | File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__ 2024-08-23T08:35:26.478786585Z | self.gen.throw(typ, value, traceback) 2024-08-23T08:35:26.478789043Z | File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups 2024-08-23T08:35:26.478791136Z | raise exc 2024-08-23T08:35:26.478792921Z | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__ 2024-08-23T08:35:26.478794986Z | response = await self.dispatch_func(request, call_next) 2024-08-23T08:35:26.478796910Z | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-08-23T08:35:26.478798890Z | File "/app/backend/main.py", line 798, in update_embedding_function 2024-08-23T08:35:26.478800932Z | response = await call_next(request) 2024-08-23T08:35:26.478802824Z | ^^^^^^^^^^^^^^^^^^^^^^^^ 2024-08-23T08:35:26.478804689Z | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next 2024-08-23T08:35:26.478806718Z | raise app_exc 2024-08-23T08:35:26.478808573Z | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro 2024-08-23T08:35:26.478810639Z | await self.app(scope, receive_or_disconnect, send_no_error) 2024-08-23T08:35:26.478812520Z | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__ 2024-08-23T08:35:26.478817124Z | with collapse_excgroups(): 2024-08-23T08:35:26.478819003Z | File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__ 2024-08-23T08:35:26.478821068Z | self.gen.throw(typ, value, traceback) 2024-08-23T08:35:26.478823004Z | File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups 2024-08-23T08:35:26.478825063Z | raise exc 2024-08-23T08:35:26.478826840Z | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__ 2024-08-23T08:35:26.478829017Z | response = await self.dispatch_func(request, call_next) 2024-08-23T08:35:26.478830990Z | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-08-23T08:35:26.478832918Z | File "/app/backend/main.py", line 789, in check_url 2024-08-23T08:35:26.478834895Z | response = await call_next(request) 2024-08-23T08:35:26.478836770Z | ^^^^^^^^^^^^^^^^^^^^^^^^ 2024-08-23T08:35:26.478838628Z | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next 2024-08-23T08:35:26.478840657Z | raise app_exc 2024-08-23T08:35:26.478842477Z | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro 2024-08-23T08:35:26.478844524Z | await self.app(scope, receive_or_disconnect, send_no_error) 2024-08-23T08:35:26.478846538Z | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__ 2024-08-23T08:35:26.478850010Z | with collapse_excgroups(): 2024-08-23T08:35:26.478852173Z | File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__ 2024-08-23T08:35:26.478854286Z | self.gen.throw(typ, value, traceback) 2024-08-23T08:35:26.478856154Z | File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups 2024-08-23T08:35:26.478858204Z | raise exc 2024-08-23T08:35:26.478859985Z | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__ 2024-08-23T08:35:26.478862076Z | response = await self.dispatch_func(request, call_next) 2024-08-23T08:35:26.478864013Z | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-08-23T08:35:26.478865928Z | File "/app/backend/main.py", line 775, in commit_session_after_request 2024-08-23T08:35:26.478867987Z | response = await call_next(request) 2024-08-23T08:35:26.478869909Z | ^^^^^^^^^^^^^^^^^^^^^^^^ 2024-08-23T08:35:26.478871753Z | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next 2024-08-23T08:35:26.478873813Z | raise app_exc 2024-08-23T08:35:26.478875602Z | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro 2024-08-23T08:35:26.478879636Z | await self.app(scope, receive_or_disconnect, send_no_error) 2024-08-23T08:35:26.478881554Z | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/cors.py", line 93, in __call__ 2024-08-23T08:35:26.478883585Z | await self.simple_response(scope, receive, send, request_headers=headers) 2024-08-23T08:35:26.478885489Z | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/cors.py", line 148, in simple_response 2024-08-23T08:35:26.478887555Z | await self.app(scope, receive, send) 2024-08-23T08:35:26.478889428Z | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__ 2024-08-23T08:35:26.478891459Z | with collapse_excgroups(): 2024-08-23T08:35:26.478893314Z | File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__ 2024-08-23T08:35:26.478895345Z | self.gen.throw(typ, value, traceback) 2024-08-23T08:35:26.478897363Z | File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups 2024-08-23T08:35:26.478899419Z | raise exc 2024-08-23T08:35:26.478901218Z | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__ 2024-08-23T08:35:26.478903301Z | response = await self.dispatch_func(request, call_next) 2024-08-23T08:35:26.478905236Z | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-08-23T08:35:26.478907177Z | File "/app/backend/main.py", line 754, in dispatch 2024-08-23T08:35:26.478909488Z | response = await call_next(request) 2024-08-23T08:35:26.478911448Z | ^^^^^^^^^^^^^^^^^^^^^^^^ 2024-08-23T08:35:26.478918340Z | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next 2024-08-23T08:35:26.478920408Z | raise app_exc 2024-08-23T08:35:26.478922210Z | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro 2024-08-23T08:35:26.478924247Z | await self.app(scope, receive_or_disconnect, send_no_error) 2024-08-23T08:35:26.478926217Z | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__ 2024-08-23T08:35:26.478928255Z | with collapse_excgroups(): 2024-08-23T08:35:26.478930161Z | File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__ 2024-08-23T08:35:26.478932167Z | self.gen.throw(typ, value, traceback) 2024-08-23T08:35:26.478934003Z | File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups 2024-08-23T08:35:26.478936099Z | raise exc 2024-08-23T08:35:26.478937860Z | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__ 2024-08-23T08:35:26.478939919Z | response = await self.dispatch_func(request, call_next) 2024-08-23T08:35:26.478943689Z | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-08-23T08:35:26.478945614Z | File "/app/backend/main.py", line 619, in dispatch 2024-08-23T08:35:26.478947614Z | response = await call_next(request) 2024-08-23T08:35:26.478949518Z | ^^^^^^^^^^^^^^^^^^^^^^^^ 2024-08-23T08:35:26.478951360Z | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next 2024-08-23T08:35:26.478953416Z | raise app_exc 2024-08-23T08:35:26.478955239Z | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro 2024-08-23T08:35:26.478957297Z | await self.app(scope, receive_or_disconnect, send_no_error) 2024-08-23T08:35:26.478959195Z | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 65, in __call__ 2024-08-23T08:35:26.478961255Z | await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) 2024-08-23T08:35:26.478963171Z | File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app 2024-08-23T08:35:26.478965277Z | raise exc 2024-08-23T08:35:26.478967064Z | File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app 2024-08-23T08:35:26.478969108Z | await app(scope, receive, sender) 2024-08-23T08:35:26.478971042Z | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 756, in __call__ 2024-08-23T08:35:26.478973333Z | await self.middleware_stack(scope, receive, send) 2024-08-23T08:35:26.478975239Z | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 776, in app 2024-08-23T08:35:26.478977321Z | await route.handle(scope, receive, send) 2024-08-23T08:35:26.478979197Z | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 297, in handle 2024-08-23T08:35:26.478981248Z | await self.app(scope, receive, send) 2024-08-23T08:35:26.478983212Z | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 77, in app 2024-08-23T08:35:26.478985318Z | await wrap_app_handling_exceptions(app, request)(scope, receive, send) 2024-08-23T08:35:26.478987264Z | File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app 2024-08-23T08:35:26.478989328Z | raise exc 2024-08-23T08:35:26.478991128Z | File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app 2024-08-23T08:35:26.478993215Z | await app(scope, receive, sender) 2024-08-23T08:35:26.478995111Z | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 72, in app 2024-08-23T08:35:26.478997130Z | response = await func(request) 2024-08-23T08:35:26.479006708Z | ^^^^^^^^^^^^^^^^^^^ 2024-08-23T08:35:26.479008603Z | File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 278, in app 2024-08-23T08:35:26.479010637Z | raw_response = await run_endpoint_function( 2024-08-23T08:35:26.479014281Z | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-08-23T08:35:26.479017210Z | File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 191, in run_endpoint_function 2024-08-23T08:35:26.479019178Z | return await dependant.call(**values) 2024-08-23T08:35:26.479020911Z | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-08-23T08:35:26.479022721Z | File "/app/backend/main.py", line 1003, in generate_chat_completions 2024-08-23T08:35:26.479024590Z | return await generate_openai_chat_completion(form_data, user=user) 2024-08-23T08:35:26.479026390Z | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-08-23T08:35:26.479028177Z | File "/app/backend/apps/openai/main.py", line 378, in generate_chat_completion 2024-08-23T08:35:26.479030114Z | model = app.state.MODELS[payload.get("model")] 2024-08-23T08:35:26.479032006Z | ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^ 2024-08-23T08:35:26.479033766Z | KeyError: 'dolphin' 2024-08-23T08:35:26.479035510Z +------------------------------------ 2024-08-23T08:35:26.479037293Z 2024-08-23T08:35:26.479038998Z During handling of the above exception, another exception occurred: 2024-08-23T08:35:26.479040811Z 2024-08-23T08:35:26.479042447Z Traceback (most recent call last): 2024-08-23T08:35:26.479044497Z File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py", line 401, in run_asgi 2024-08-23T08:35:26.479046534Z result = await app( # type: ignore[func-returns-value] 2024-08-23T08:35:26.479048288Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-08-23T08:35:26.479050072Z File "/usr/local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 70, in __call__ 2024-08-23T08:35:26.479052016Z return await self.app(scope, receive, send) 2024-08-23T08:35:26.479053764Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-08-23T08:35:26.479055515Z File "/usr/local/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in __call__ 2024-08-23T08:35:26.479057433Z await super().__call__(scope, receive, send) 2024-08-23T08:35:26.479059179Z File "/usr/local/lib/python3.11/site-packages/starlette/applications.py", line 123, in __call__ 2024-08-23T08:35:26.479061055Z await self.middleware_stack(scope, receive, send) 2024-08-23T08:35:26.479062858Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 186, in __call__ 2024-08-23T08:35:26.479064750Z raise exc 2024-08-23T08:35:26.479068265Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 164, in __call__ 2024-08-23T08:35:26.479070163Z await self.app(scope, receive, _send) 2024-08-23T08:35:26.479071885Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__ 2024-08-23T08:35:26.479073746Z with collapse_excgroups(): 2024-08-23T08:35:26.479075563Z File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__ 2024-08-23T08:35:26.479077365Z self.gen.throw(typ, value, traceback) 2024-08-23T08:35:26.479079106Z File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups 2024-08-23T08:35:26.479081024Z raise exc 2024-08-23T08:35:26.479082733Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__ 2024-08-23T08:35:26.479084607Z response = await self.dispatch_func(request, call_next) 2024-08-23T08:35:26.479086349Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-08-23T08:35:26.479088129Z File "/app/backend/main.py", line 798, in update_embedding_function 2024-08-23T08:35:26.479089937Z response = await call_next(request) 2024-08-23T08:35:26.479091675Z ^^^^^^^^^^^^^^^^^^^^^^^^ 2024-08-23T08:35:26.479093395Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next 2024-08-23T08:35:26.479095287Z raise app_exc 2024-08-23T08:35:26.479097027Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro 2024-08-23T08:35:26.479098863Z await self.app(scope, receive_or_disconnect, send_no_error) 2024-08-23T08:35:26.479100633Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__ 2024-08-23T08:35:26.479102703Z with collapse_excgroups(): 2024-08-23T08:35:26.479104471Z File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__ 2024-08-23T08:35:26.479106289Z self.gen.throw(typ, value, traceback) 2024-08-23T08:35:26.479108016Z File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups 2024-08-23T08:35:26.479109925Z raise exc 2024-08-23T08:35:26.479111619Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__ 2024-08-23T08:35:26.479113566Z response = await self.dispatch_func(request, call_next) 2024-08-23T08:35:26.479115332Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-08-23T08:35:26.479117066Z File "/app/backend/main.py", line 789, in check_url 2024-08-23T08:35:26.479118932Z response = await call_next(request) 2024-08-23T08:35:26.479120625Z ^^^^^^^^^^^^^^^^^^^^^^^^ 2024-08-23T08:35:26.479122366Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next 2024-08-23T08:35:26.479125944Z raise app_exc 2024-08-23T08:35:26.479127613Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro 2024-08-23T08:35:26.479129469Z await self.app(scope, receive_or_disconnect, send_no_error) 2024-08-23T08:35:26.479131217Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__ 2024-08-23T08:35:26.479133117Z with collapse_excgroups(): 2024-08-23T08:35:26.479134879Z File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__ 2024-08-23T08:35:26.479136733Z self.gen.throw(typ, value, traceback) 2024-08-23T08:35:26.479138475Z File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups 2024-08-23T08:35:26.479140397Z raise exc 2024-08-23T08:35:26.479142060Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__ 2024-08-23T08:35:26.479143968Z response = await self.dispatch_func(request, call_next) 2024-08-23T08:35:26.479145710Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-08-23T08:35:26.479147496Z File "/app/backend/main.py", line 775, in commit_session_after_request 2024-08-23T08:35:26.479149311Z response = await call_next(request) 2024-08-23T08:35:26.479151038Z ^^^^^^^^^^^^^^^^^^^^^^^^ 2024-08-23T08:35:26.479152756Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next 2024-08-23T08:35:26.479154662Z raise app_exc 2024-08-23T08:35:26.479156331Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro 2024-08-23T08:35:26.479158180Z await self.app(scope, receive_or_disconnect, send_no_error) 2024-08-23T08:35:26.479159980Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/cors.py", line 93, in __call__ 2024-08-23T08:35:26.479162129Z await self.simple_response(scope, receive, send, request_headers=headers) 2024-08-23T08:35:26.479163986Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/cors.py", line 148, in simple_response 2024-08-23T08:35:26.479165858Z await self.app(scope, receive, send) 2024-08-23T08:35:26.479167578Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__ 2024-08-23T08:35:26.479169449Z with collapse_excgroups(): 2024-08-23T08:35:26.479171248Z File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__ 2024-08-23T08:35:26.479173054Z self.gen.throw(typ, value, traceback) 2024-08-23T08:35:26.479174780Z File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups 2024-08-23T08:35:26.479176692Z raise exc 2024-08-23T08:35:26.479178361Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__ 2024-08-23T08:35:26.479181935Z response = await self.dispatch_func(request, call_next) 2024-08-23T08:35:26.479183687Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-08-23T08:35:26.479185416Z File "/app/backend/main.py", line 754, in dispatch 2024-08-23T08:35:26.479187248Z response = await call_next(request) 2024-08-23T08:35:26.479188939Z ^^^^^^^^^^^^^^^^^^^^^^^^ 2024-08-23T08:35:26.479190679Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next 2024-08-23T08:35:26.479192640Z raise app_exc 2024-08-23T08:35:26.479194397Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro 2024-08-23T08:35:26.479196279Z await self.app(scope, receive_or_disconnect, send_no_error) 2024-08-23T08:35:26.479198031Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__ 2024-08-23T08:35:26.479199884Z with collapse_excgroups(): 2024-08-23T08:35:26.479201639Z File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__ 2024-08-23T08:35:26.479203515Z self.gen.throw(typ, value, traceback) 2024-08-23T08:35:26.479205264Z File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups 2024-08-23T08:35:26.479207163Z raise exc 2024-08-23T08:35:26.479208830Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__ 2024-08-23T08:35:26.479210737Z response = await self.dispatch_func(request, call_next) 2024-08-23T08:35:26.479212485Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-08-23T08:35:26.479214252Z File "/app/backend/main.py", line 619, in dispatch 2024-08-23T08:35:26.479216091Z response = await call_next(request) 2024-08-23T08:35:26.479217787Z ^^^^^^^^^^^^^^^^^^^^^^^^ 2024-08-23T08:35:26.479219514Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next 2024-08-23T08:35:26.479221439Z raise app_exc 2024-08-23T08:35:26.479223250Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro 2024-08-23T08:35:26.479225151Z await self.app(scope, receive_or_disconnect, send_no_error) 2024-08-23T08:35:26.479226915Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 65, in __call__ 2024-08-23T08:35:26.479228831Z await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) 2024-08-23T08:35:26.479230617Z File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app 2024-08-23T08:35:26.479232563Z raise exc 2024-08-23T08:35:26.479234198Z File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app 2024-08-23T08:35:26.479237781Z await app(scope, receive, sender) 2024-08-23T08:35:26.479239519Z File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 756, in __call__ 2024-08-23T08:35:26.479241412Z await self.middleware_stack(scope, receive, send) 2024-08-23T08:35:26.479243170Z File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 776, in app 2024-08-23T08:35:26.479245046Z await route.handle(scope, receive, send) 2024-08-23T08:35:26.479246804Z File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 297, in handle 2024-08-23T08:35:26.479248671Z await self.app(scope, receive, send) 2024-08-23T08:35:26.479250422Z File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 77, in app 2024-08-23T08:35:26.479252286Z await wrap_app_handling_exceptions(app, request)(scope, receive, send) 2024-08-23T08:35:26.479254037Z File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app 2024-08-23T08:35:26.479255922Z raise exc 2024-08-23T08:35:26.479257554Z File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app 2024-08-23T08:35:26.479259448Z await app(scope, receive, sender) 2024-08-23T08:35:26.479261188Z File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 72, in app 2024-08-23T08:35:26.479263070Z response = await func(request) 2024-08-23T08:35:26.479264821Z ^^^^^^^^^^^^^^^^^^^ 2024-08-23T08:35:26.479266550Z File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 278, in app 2024-08-23T08:35:26.479268497Z raw_response = await run_endpoint_function( 2024-08-23T08:35:26.479270217Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-08-23T08:35:26.479271970Z File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 191, in run_endpoint_function 2024-08-23T08:35:26.479273944Z return await dependant.call(**values) 2024-08-23T08:35:26.479275692Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-08-23T08:35:26.479277434Z File "/app/backend/main.py", line 1003, in generate_chat_completions 2024-08-23T08:35:26.479279487Z return await generate_openai_chat_completion(form_data, user=user) 2024-08-23T08:35:26.479281302Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-08-23T08:35:26.479283080Z File "/app/backend/apps/openai/main.py", line 378, in generate_chat_completion 2024-08-23T08:35:26.479284985Z model = app.state.MODELS[payload.get("model")] 2024-08-23T08:35:26.479286798Z ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^ 2024-08-23T08:35:26.479288571Z KeyError: 'dolphin' 2024-08-23T08:35:26.516679689Z generate_title 2024-08-23T08:35:26.516715957Z ollama-hub/uaquax/chatgpt-4-uncensored:latest 2024-08-23T08:35:26.516742691Z INFO: 58.152.62.48:0 - "POST /api/task/title/completions HTTP/1.1" 500 Internal Server Error 2024-08-23T08:35:26.522945041Z ERROR: Exception in ASGI application 2024-08-23T08:35:26.522984706Z + Exception Group Traceback (most recent call last): 2024-08-23T08:35:26.522991203Z | File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 87, in collapse_excgroups 2024-08-23T08:35:26.522996320Z | yield 2024-08-23T08:35:26.523000687Z | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 190, in __call__ 2024-08-23T08:35:26.523005533Z | async with anyio.create_task_group() as task_group: 2024-08-23T08:35:26.523010179Z | File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 680, in __aexit__ 2024-08-23T08:35:26.523015371Z | raise BaseExceptionGroup( 2024-08-23T08:35:26.523019878Z | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception) 2024-08-23T08:35:26.523024310Z +-+---------------- 1 ---------------- 2024-08-23T08:35:26.523028376Z | Traceback (most recent call last): 2024-08-23T08:35:26.523032595Z | File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py", line 401, in run_asgi 2024-08-23T08:35:26.523037176Z | result = await app( # type: ignore[func-returns-value] 2024-08-23T08:35:26.523041726Z | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-08-23T08:35:26.523045988Z | File "/usr/local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 70, in __call__ 2024-08-23T08:35:26.523050917Z | return await self.app(scope, receive, send) 2024-08-23T08:35:26.523055804Z | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-08-23T08:35:26.523060694Z | File "/usr/local/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in __call__ 2024-08-23T08:35:26.523065908Z | await super().__call__(scope, receive, send) 2024-08-23T08:35:26.523070849Z | File "/usr/local/lib/python3.11/site-packages/starlette/applications.py", line 123, in __call__ 2024-08-23T08:35:26.523075944Z | await self.middleware_stack(scope, receive, send) 2024-08-23T08:35:26.523080901Z | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 186, in __call__ 2024-08-23T08:35:26.523086149Z | raise exc 2024-08-23T08:35:26.523090937Z | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 164, in __call__ 2024-08-23T08:35:26.523096123Z | await self.app(scope, receive, _send) 2024-08-23T08:35:26.523100927Z | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__ 2024-08-23T08:35:26.523106104Z | with collapse_excgroups(): 2024-08-23T08:35:26.523110960Z | File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__ 2024-08-23T08:35:26.523137605Z | self.gen.throw(typ, value, traceback) 2024-08-23T08:35:26.523149374Z | File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups 2024-08-23T08:35:26.523155211Z | raise exc 2024-08-23T08:35:26.523168161Z | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__ 2024-08-23T08:35:26.523173564Z | response = await self.dispatch_func(request, call_next) 2024-08-23T08:35:26.523178584Z | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-08-23T08:35:26.523183477Z | File "/app/backend/main.py", line 798, in update_embedding_function 2024-08-23T08:35:26.523188555Z | response = await call_next(request) 2024-08-23T08:35:26.523193503Z | ^^^^^^^^^^^^^^^^^^^^^^^^ 2024-08-23T08:35:26.523198281Z | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next 2024-08-23T08:35:26.523203328Z | raise app_exc 2024-08-23T08:35:26.523208177Z | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro 2024-08-23T08:35:26.523213359Z | await self.app(scope, receive_or_disconnect, send_no_error) 2024-08-23T08:35:26.523218393Z | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__ 2024-08-23T08:35:26.523223517Z | with collapse_excgroups(): 2024-08-23T08:35:26.523228324Z | File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__ 2024-08-23T08:35:26.523233390Z | self.gen.throw(typ, value, traceback) 2024-08-23T08:35:26.523238304Z | File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups 2024-08-23T08:35:26.523243410Z | raise exc 2024-08-23T08:35:26.523248231Z | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__ 2024-08-23T08:35:26.523253387Z | response = await self.dispatch_func(request, call_next) 2024-08-23T08:35:26.523258381Z | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-08-23T08:35:26.523263286Z | File "/app/backend/main.py", line 789, in check_url 2024-08-23T08:35:26.523268535Z | response = await call_next(request) 2024-08-23T08:35:26.523273500Z | ^^^^^^^^^^^^^^^^^^^^^^^^ 2024-08-23T08:35:26.523278361Z | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next 2024-08-23T08:35:26.523283471Z | raise app_exc 2024-08-23T08:35:26.523288207Z | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro 2024-08-23T08:35:26.523293351Z | await self.app(scope, receive_or_disconnect, send_no_error) 2024-08-23T08:35:26.523304478Z | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__ 2024-08-23T08:35:26.523310113Z | with collapse_excgroups(): 2024-08-23T08:35:26.523315611Z | File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__ 2024-08-23T08:35:26.523320762Z | self.gen.throw(typ, value, traceback) 2024-08-23T08:35:26.523325581Z | File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups 2024-08-23T08:35:26.523330762Z | raise exc 2024-08-23T08:35:26.523335421Z | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__ 2024-08-23T08:35:26.523340590Z | response = await self.dispatch_func(request, call_next) 2024-08-23T08:35:26.523345690Z | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-08-23T08:35:26.523350668Z | File "/app/backend/main.py", line 775, in commit_session_after_request 2024-08-23T08:35:26.523355589Z | response = await call_next(request) 2024-08-23T08:35:26.523360513Z | ^^^^^^^^^^^^^^^^^^^^^^^^ 2024-08-23T08:35:26.523365337Z | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next 2024-08-23T08:35:26.523370501Z | raise app_exc 2024-08-23T08:35:26.523375187Z | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro 2024-08-23T08:35:26.523380296Z | await self.app(scope, receive_or_disconnect, send_no_error) 2024-08-23T08:35:26.523385159Z | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/cors.py", line 93, in __call__ 2024-08-23T08:35:26.523390260Z | await self.simple_response(scope, receive, send, request_headers=headers) 2024-08-23T08:35:26.523395288Z | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/cors.py", line 148, in simple_response 2024-08-23T08:35:26.523400534Z | await self.app(scope, receive, send) 2024-08-23T08:35:26.523405403Z | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__ 2024-08-23T08:35:26.523410482Z | with collapse_excgroups(): 2024-08-23T08:35:26.523415326Z | File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__ 2024-08-23T08:35:26.523420460Z | self.gen.throw(typ, value, traceback) 2024-08-23T08:35:26.523425149Z | File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups 2024-08-23T08:35:26.523430297Z | raise exc 2024-08-23T08:35:26.523434950Z | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__ 2024-08-23T08:35:26.523439999Z | response = await self.dispatch_func(request, call_next) 2024-08-23T08:35:26.523444833Z | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-08-23T08:35:26.523455153Z | File "/app/backend/main.py", line 721, in dispatch 2024-08-23T08:35:26.523461372Z | return await call_next(request) 2024-08-23T08:35:26.523466397Z | ^^^^^^^^^^^^^^^^^^^^^^^^ 2024-08-23T08:35:26.523471272Z | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next 2024-08-23T08:35:26.523476353Z | raise app_exc 2024-08-23T08:35:26.523480980Z | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro 2024-08-23T08:35:26.523486050Z | await self.app(scope, receive_or_disconnect, send_no_error) 2024-08-23T08:35:26.523491048Z | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__ 2024-08-23T08:35:26.523496388Z | with collapse_excgroups(): 2024-08-23T08:35:26.523501242Z | File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__ 2024-08-23T08:35:26.523506291Z | self.gen.throw(typ, value, traceback) 2024-08-23T08:35:26.523511067Z | File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups 2024-08-23T08:35:26.523516192Z | raise exc 2024-08-23T08:35:26.523520850Z | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__ 2024-08-23T08:35:26.523525955Z | response = await self.dispatch_func(request, call_next) 2024-08-23T08:35:26.523530812Z | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-08-23T08:35:26.523535720Z | File "/app/backend/main.py", line 513, in dispatch 2024-08-23T08:35:26.523540754Z | return await call_next(request) 2024-08-23T08:35:26.523545596Z | ^^^^^^^^^^^^^^^^^^^^^^^^ 2024-08-23T08:35:26.523550383Z | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next 2024-08-23T08:35:26.523555537Z | raise app_exc 2024-08-23T08:35:26.523560206Z | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro 2024-08-23T08:35:26.523565225Z | await self.app(scope, receive_or_disconnect, send_no_error) 2024-08-23T08:35:26.523570265Z | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 65, in __call__ 2024-08-23T08:35:26.523575434Z | await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) 2024-08-23T08:35:26.523580508Z | File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app 2024-08-23T08:35:26.523585798Z | raise exc 2024-08-23T08:35:26.523590446Z | File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app 2024-08-23T08:35:26.523595608Z | await app(scope, receive, sender) 2024-08-23T08:35:26.523606105Z | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 756, in __call__ 2024-08-23T08:35:26.523612347Z | await self.middleware_stack(scope, receive, send) 2024-08-23T08:35:26.523617314Z | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 776, in app 2024-08-23T08:35:26.523622426Z | await route.handle(scope, receive, send) 2024-08-23T08:35:26.523627231Z | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 297, in handle 2024-08-23T08:35:26.523632358Z | await self.app(scope, receive, send) 2024-08-23T08:35:26.523637085Z | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 77, in app 2024-08-23T08:35:26.523642216Z | await wrap_app_handling_exceptions(app, request)(scope, receive, send) 2024-08-23T08:35:26.523647287Z | File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app 2024-08-23T08:35:26.523652493Z | raise exc 2024-08-23T08:35:26.523657214Z | File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app 2024-08-23T08:35:26.523662298Z | await app(scope, receive, sender) 2024-08-23T08:35:26.523667178Z | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 72, in app 2024-08-23T08:35:26.523672332Z | response = await func(request) 2024-08-23T08:35:26.523677176Z | ^^^^^^^^^^^^^^^^^^^ 2024-08-23T08:35:26.523682038Z | File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 278, in app 2024-08-23T08:35:26.523687179Z | raw_response = await run_endpoint_function( 2024-08-23T08:35:26.523692032Z | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-08-23T08:35:26.523696956Z | File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 191, in run_endpoint_function 2024-08-23T08:35:26.523702126Z | return await dependant.call(**values) 2024-08-23T08:35:26.523706892Z | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-08-23T08:35:26.523711814Z | File "/app/backend/main.py", line 1390, in generate_title 2024-08-23T08:35:26.523716813Z | return await generate_chat_completions(form_data=payload, user=user) 2024-08-23T08:35:26.523721835Z | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-08-23T08:35:26.523726767Z | File "/app/backend/main.py", line 1003, in generate_chat_completions 2024-08-23T08:35:26.523731846Z | return await generate_openai_chat_completion(form_data, user=user) 2024-08-23T08:35:26.523736699Z | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-08-23T08:35:26.523741627Z | File "/app/backend/apps/openai/main.py", line 378, in generate_chat_completion 2024-08-23T08:35:26.523746789Z | model = app.state.MODELS[payload.get("model")] 2024-08-23T08:35:26.523757355Z | ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^ 2024-08-23T08:35:26.523762674Z | KeyError: 'dolphin' 2024-08-23T08:35:26.523768075Z +------------------------------------ 2024-08-23T08:35:26.523773031Z 2024-08-23T08:35:26.523777658Z During handling of the above exception, another exception occurred: 2024-08-23T08:35:26.523782639Z 2024-08-23T08:35:26.523787269Z Traceback (most recent call last): 2024-08-23T08:35:26.523792073Z File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py", line 401, in run_asgi 2024-08-23T08:35:26.523797375Z result = await app( # type: ignore[func-returns-value] 2024-08-23T08:35:26.523802271Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-08-23T08:35:26.523807158Z File "/usr/local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 70, in __call__ 2024-08-23T08:35:26.523812337Z return await self.app(scope, receive, send) 2024-08-23T08:35:26.523817145Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-08-23T08:35:26.523821965Z File "/usr/local/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in __call__ 2024-08-23T08:35:26.523827223Z await super().__call__(scope, receive, send) 2024-08-23T08:35:26.523832185Z File "/usr/local/lib/python3.11/site-packages/starlette/applications.py", line 123, in __call__ 2024-08-23T08:35:26.523837347Z await self.middleware_stack(scope, receive, send) 2024-08-23T08:35:26.523842248Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 186, in __call__ 2024-08-23T08:35:26.523847380Z raise exc 2024-08-23T08:35:26.523852052Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 164, in __call__ 2024-08-23T08:35:26.523857167Z await self.app(scope, receive, _send) 2024-08-23T08:35:26.523861948Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__ 2024-08-23T08:35:26.523867028Z with collapse_excgroups(): 2024-08-23T08:35:26.523871865Z File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__ 2024-08-23T08:35:26.523876999Z self.gen.throw(typ, value, traceback) 2024-08-23T08:35:26.523881739Z File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups 2024-08-23T08:35:26.523886890Z raise exc 2024-08-23T08:35:26.523891489Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__ 2024-08-23T08:35:26.523896650Z response = await self.dispatch_func(request, call_next) 2024-08-23T08:35:26.523901496Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-08-23T08:35:26.523906331Z File "/app/backend/main.py", line 798, in update_embedding_function 2024-08-23T08:35:26.523916215Z response = await call_next(request) 2024-08-23T08:35:26.523921400Z ^^^^^^^^^^^^^^^^^^^^^^^^ 2024-08-23T08:35:26.523926299Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next 2024-08-23T08:35:26.523931512Z raise app_exc 2024-08-23T08:35:26.523936719Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro 2024-08-23T08:35:26.523941812Z await self.app(scope, receive_or_disconnect, send_no_error) 2024-08-23T08:35:26.523946404Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__ 2024-08-23T08:35:26.523951217Z with collapse_excgroups(): 2024-08-23T08:35:26.523955742Z File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__ 2024-08-23T08:35:26.523960494Z self.gen.throw(typ, value, traceback) 2024-08-23T08:35:26.523964983Z File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups 2024-08-23T08:35:26.523969755Z raise exc 2024-08-23T08:35:26.523974150Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__ 2024-08-23T08:35:26.523978948Z response = await self.dispatch_func(request, call_next) 2024-08-23T08:35:26.523983537Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-08-23T08:35:26.523988115Z File "/app/backend/main.py", line 789, in check_url 2024-08-23T08:35:26.523992778Z response = await call_next(request) 2024-08-23T08:35:26.523997373Z ^^^^^^^^^^^^^^^^^^^^^^^^ 2024-08-23T08:35:26.524001891Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next 2024-08-23T08:35:26.524006693Z raise app_exc 2024-08-23T08:35:26.524011116Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro 2024-08-23T08:35:26.524015910Z await self.app(scope, receive_or_disconnect, send_no_error) 2024-08-23T08:35:26.524020528Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__ 2024-08-23T08:35:26.524025348Z with collapse_excgroups(): 2024-08-23T08:35:26.524029819Z File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__ 2024-08-23T08:35:26.524034533Z self.gen.throw(typ, value, traceback) 2024-08-23T08:35:26.524039060Z File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups 2024-08-23T08:35:26.524043861Z raise exc 2024-08-23T08:35:26.524048242Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__ 2024-08-23T08:35:26.524053014Z response = await self.dispatch_func(request, call_next) 2024-08-23T08:35:26.524057495Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-08-23T08:35:26.524071588Z File "/app/backend/main.py", line 775, in commit_session_after_request 2024-08-23T08:35:26.524076829Z response = await call_next(request) 2024-08-23T08:35:26.524081346Z ^^^^^^^^^^^^^^^^^^^^^^^^ 2024-08-23T08:35:26.524085890Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next 2024-08-23T08:35:26.524090693Z raise app_exc 2024-08-23T08:35:26.524095745Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro 2024-08-23T08:35:26.524100780Z await self.app(scope, receive_or_disconnect, send_no_error) 2024-08-23T08:35:26.524105288Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/cors.py", line 93, in __call__ 2024-08-23T08:35:26.524110008Z await self.simple_response(scope, receive, send, request_headers=headers) 2024-08-23T08:35:26.524114793Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/cors.py", line 148, in simple_response 2024-08-23T08:35:26.524119586Z await self.app(scope, receive, send) 2024-08-23T08:35:26.524124090Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__ 2024-08-23T08:35:26.524128878Z with collapse_excgroups(): 2024-08-23T08:35:26.524133312Z File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__ 2024-08-23T08:35:26.524138034Z self.gen.throw(typ, value, traceback) 2024-08-23T08:35:26.524142545Z File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups 2024-08-23T08:35:26.524147466Z raise exc 2024-08-23T08:35:26.524151825Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__ 2024-08-23T08:35:26.524156614Z response = await self.dispatch_func(request, call_next) 2024-08-23T08:35:26.524161178Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-08-23T08:35:26.524165700Z File "/app/backend/main.py", line 721, in dispatch 2024-08-23T08:35:26.524170416Z return await call_next(request) 2024-08-23T08:35:26.524174962Z ^^^^^^^^^^^^^^^^^^^^^^^^ 2024-08-23T08:35:26.524179427Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next 2024-08-23T08:35:26.524184221Z raise app_exc 2024-08-23T08:35:26.524188594Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro 2024-08-23T08:35:26.524193455Z await self.app(scope, receive_or_disconnect, send_no_error) 2024-08-23T08:35:26.524198017Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__ 2024-08-23T08:35:26.524202817Z with collapse_excgroups(): 2024-08-23T08:35:26.524207215Z File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__ 2024-08-23T08:35:26.524216709Z self.gen.throw(typ, value, traceback) 2024-08-23T08:35:26.524221767Z File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups 2024-08-23T08:35:26.524226720Z raise exc 2024-08-23T08:35:26.524231212Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in __call__ 2024-08-23T08:35:26.524236019Z response = await self.dispatch_func(request, call_next) 2024-08-23T08:35:26.524240636Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-08-23T08:35:26.524245216Z File "/app/backend/main.py", line 513, in dispatch 2024-08-23T08:35:26.524250316Z return await call_next(request) 2024-08-23T08:35:26.524254811Z ^^^^^^^^^^^^^^^^^^^^^^^^ 2024-08-23T08:35:26.524259248Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next 2024-08-23T08:35:26.524264086Z raise app_exc 2024-08-23T08:35:26.524268601Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro 2024-08-23T08:35:26.524273407Z await self.app(scope, receive_or_disconnect, send_no_error) 2024-08-23T08:35:26.524277928Z File "/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 65, in __call__ 2024-08-23T08:35:26.524282830Z await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) 2024-08-23T08:35:26.524287484Z File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app 2024-08-23T08:35:26.524292463Z raise exc 2024-08-23T08:35:26.524296820Z File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app 2024-08-23T08:35:26.524301636Z await app(scope, receive, sender) 2024-08-23T08:35:26.524306194Z File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 756, in __call__ 2024-08-23T08:35:26.524310990Z await self.middleware_stack(scope, receive, send) 2024-08-23T08:35:26.524315542Z File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 776, in app 2024-08-23T08:35:26.524320425Z await route.handle(scope, receive, send) 2024-08-23T08:35:26.524324941Z File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 297, in handle 2024-08-23T08:35:26.524329692Z await self.app(scope, receive, send) 2024-08-23T08:35:26.524334095Z File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 77, in app 2024-08-23T08:35:26.524338877Z await wrap_app_handling_exceptions(app, request)(scope, receive, send) 2024-08-23T08:35:26.524343683Z File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app 2024-08-23T08:35:26.524348490Z raise exc 2024-08-23T08:35:26.524352885Z File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app 2024-08-23T08:35:26.524362393Z await app(scope, receive, sender) 2024-08-23T08:35:26.524367458Z File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 72, in app 2024-08-23T08:35:26.524372352Z response = await func(request) 2024-08-23T08:35:26.524376912Z ^^^^^^^^^^^^^^^^^^^ 2024-08-23T08:35:26.524381377Z File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 278, in app 2024-08-23T08:35:26.524386247Z raw_response = await run_endpoint_function( 2024-08-23T08:35:26.524390879Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-08-23T08:35:26.524396115Z File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 191, in run_endpoint_function 2024-08-23T08:35:26.524401150Z return await dependant.call(**values) 2024-08-23T08:35:26.524405592Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-08-23T08:35:26.524410137Z File "/app/backend/main.py", line 1390, in generate_title 2024-08-23T08:35:26.524414892Z return await generate_chat_completions(form_data=payload, user=user) 2024-08-23T08:35:26.524419602Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-08-23T08:35:26.524424380Z File "/app/backend/main.py", line 1003, in generate_chat_completions 2024-08-23T08:35:26.524429020Z return await generate_openai_chat_completion(form_data, user=user) 2024-08-23T08:35:26.524433690Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-08-23T08:35:26.524438353Z File "/app/backend/apps/openai/main.py", line 378, in generate_chat_completion 2024-08-23T08:35:26.524443121Z model = app.state.MODELS[payload.get("model")] 2024-08-23T08:35:26.524447860Z ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^ 2024-08-23T08:35:26.524452455Z KeyError: 'dolphin' 2024-08-23T08:35:26.561969576Z INFO: 58.152.62.48:0 - "POST /api/v1/chats/5a77e01e-ec88-4ade-9fad-a955d94ec47b HTTP/1.1" 200 OK 2024-08-23T08:35:26.637008968Z INFO: 58.152.62.48:0 - "GET /api/v1/chats/?page=1 HTTP/1.1" 200 OK 2024-08-23T08:35:26.669095128Z INFO: 58.152.62.48:0 - "GET /api/v1/chats/?page=1 HTTP/1.1" 200 OK 2024-08-23T08:35:33.787970003Z Unknown session ID -UbZOu98G-k3wxEJAAAb disconnected 2024-08-23T08:35:33.788032874Z INFO: 192.168.7.10:0 - "GET /ws/socket.io/?EIO=4&transport=polling&t=P5-NxQj&sid=dFblD1DTr0tMYv-1AAAa HTTP/1.1" 400 Bad Request 2024-08-23T08:35:33.801502161Z INFO: 192.168.7.10:0 - "POST /ws/socket.io/?EIO=4&transport=polling&t=P5-O6Q3&sid=dFblD1DTr0tMYv-1AAAa HTTP/1.1" 400 Bad Request 2024-08-23T08:35:35.764512473Z INFO: 192.168.7.10:0 - "GET /ws/socket.io/?EIO=4&transport=polling&t=P5-O6ui HTTP/1.1" 200 OK 2024-08-23T08:35:35.786638308Z INFO: 192.168.7.10:0 - "POST /ws/socket.io/?EIO=4&transport=polling&t=P5-O6uz&sid=hSbZtgX8K6-ve0c9AAAc HTTP/1.1" 200 OK 2024-08-23T08:35:35.787736652Z INFO: 192.168.7.10:0 - "GET /ws/socket.io/?EIO=4&transport=polling&t=P5-O6u-&sid=hSbZtgX8K6-ve0c9AAAc HTTP/1.1" 200 OK ```
Author
Owner

@darkvertex commented on GitHub (Aug 26, 2024):

Unfortunately I still receive this error, although I just updated to version 0.3.15.

I'm running it in two docker containers, both Open-WebUI and Ollama. When I check the Ollama API in Settings, it says the connection works fine.

Not the same error as I and others were having. Perhaps you may wanna open a new GitHub issue for it if this reply does not solve your problem.

@MatthK From the error it appears you're trying to use this "model" prompt, yes? 👇
https://openwebui.com/m/uaquax/chatgpt-4-uncensored:latest

You're getting a KeyError that "dolphin" is not in your models. Looking at the page above under "Base Model ID" it says it's "dolphin", meaning it depends on a model by that name existing in your ollama server.

Which dolphin model though? That is the question, as there are many. 🤔 There's not one called simply "dolphin" though, so I wonder if the script ever worked?

You may have to download one of the many dolphins such as:
https://ollama.com/library/dolphin-mixtral
...and then edit your imported "model prompt" where it says "dolphin", change to the full model name like "dolphin-mixtral".

(If this doesn't solve it, open a new GitHub issue because your error is different from the one that started this one.)

<!-- gh-comment-id:2309373809 --> @darkvertex commented on GitHub (Aug 26, 2024): > Unfortunately I still receive this error, although I just updated to version 0.3.15. > > I'm running it in two docker containers, both Open-WebUI and Ollama. When I check the Ollama API in Settings, it says the connection works fine. > Not the same error as I and others were having. Perhaps you may wanna open a new GitHub issue for it if this reply does not solve your problem. @MatthK From the error it appears you're trying to use this "model" prompt, yes? 👇 https://openwebui.com/m/uaquax/chatgpt-4-uncensored:latest You're getting a KeyError that "dolphin" is not in your models. Looking at the page above under "Base Model ID" it says it's "dolphin", meaning it depends on a model by that name existing in your ollama server. Which dolphin model though? That is the question, as there are many. 🤔 There's not one called simply "dolphin" though, so I wonder if the script ever worked? You may have to download one of the many dolphins such as: https://ollama.com/library/dolphin-mixtral ...and then edit your imported "model prompt" where it says "dolphin", change to the full model name like "dolphin-mixtral". (If this doesn't solve it, open a new GitHub issue because your error is different from the one that started this one.)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#13732