From e540f8a4e4ce52111377994d693e64fb4be81713 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 30 Jun 2024 03:27:27 +0000 Subject: [PATCH 1/5] chore(deps): bump chromadb from 0.5.0 to 0.5.3 in /backend Bumps [chromadb](https://github.com/chroma-core/chroma) from 0.5.0 to 0.5.3. - [Release notes](https://github.com/chroma-core/chroma/releases) - [Changelog](https://github.com/chroma-core/chroma/blob/main/RELEASE_PROCESS.md) - [Commits](https://github.com/chroma-core/chroma/compare/0.5.0...0.5.3) --- updated-dependencies: - dependency-name: chromadb dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- backend/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/requirements.txt b/backend/requirements.txt index dd9de2ff1..f12a433c4 100644 --- a/backend/requirements.txt +++ b/backend/requirements.txt @@ -35,7 +35,7 @@ langchain-community==0.2.0 langchain-chroma==0.1.1 fake-useragent==1.5.1 -chromadb==0.5.0 +chromadb==0.5.3 sentence-transformers==2.7.0 pypdf==4.2.0 docx2txt==0.8 From 9d1aa4aebe4f7db64bfb683f695780588543a064 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 30 Jun 2024 03:27:34 +0000 Subject: [PATCH 2/5] chore(deps): bump python-socketio from 5.11.2 to 5.11.3 in /backend Bumps [python-socketio](https://github.com/miguelgrinberg/python-socketio) from 5.11.2 to 5.11.3. - [Release notes](https://github.com/miguelgrinberg/python-socketio/releases) - [Changelog](https://github.com/miguelgrinberg/python-socketio/blob/main/CHANGES.md) - [Commits](https://github.com/miguelgrinberg/python-socketio/compare/v5.11.2...v5.11.3) --- updated-dependencies: - dependency-name: python-socketio dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- backend/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/requirements.txt b/backend/requirements.txt index dd9de2ff1..ab90d8a35 100644 --- a/backend/requirements.txt +++ b/backend/requirements.txt @@ -6,7 +6,7 @@ python-multipart==0.0.9 Flask==3.0.3 Flask-Cors==4.0.1 -python-socketio==5.11.2 +python-socketio==5.11.3 python-jose==3.3.0 passlib[bcrypt]==1.7.4 From 3c0ce5d1b08b6b08ce59a8f07da6efcd65252823 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 30 Jun 2024 03:27:39 +0000 Subject: [PATCH 3/5] chore(deps): bump langchain-chroma from 0.1.1 to 0.1.2 in /backend Bumps [langchain-chroma](https://github.com/langchain-ai/langchain) from 0.1.1 to 0.1.2. - [Release notes](https://github.com/langchain-ai/langchain/releases) - [Commits](https://github.com/langchain-ai/langchain/compare/langchain-chroma==0.1.1...langchain-chroma==0.1.2) --- updated-dependencies: - dependency-name: langchain-chroma dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- backend/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/requirements.txt b/backend/requirements.txt index dd9de2ff1..34baadd8b 100644 --- a/backend/requirements.txt +++ b/backend/requirements.txt @@ -32,7 +32,7 @@ google-generativeai==0.5.4 langchain==0.2.0 langchain-community==0.2.0 -langchain-chroma==0.1.1 +langchain-chroma==0.1.2 fake-useragent==1.5.1 chromadb==0.5.0 From 052c582930ea29c226565c428d482a9abd595477 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 30 Jun 2024 03:27:43 +0000 Subject: [PATCH 4/5] chore(deps): update duckduckgo-search requirement in /backend Updates the requirements on [duckduckgo-search](https://github.com/deedy5/duckduckgo_search) to permit the latest version. - [Release notes](https://github.com/deedy5/duckduckgo_search/releases) - [Commits](https://github.com/deedy5/duckduckgo_search/compare/v6.1.5...v6.1.7) --- updated-dependencies: - dependency-name: duckduckgo-search dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- backend/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/requirements.txt b/backend/requirements.txt index dd9de2ff1..b72920074 100644 --- a/backend/requirements.txt +++ b/backend/requirements.txt @@ -67,4 +67,4 @@ pytube==15.0.0 extract_msg pydub -duckduckgo-search~=6.1.5 \ No newline at end of file +duckduckgo-search~=6.1.7 \ No newline at end of file From f6efda9e2ff9782bad2aa0294ebef19c244035bc Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Sun, 30 Jun 2024 01:30:19 -0700 Subject: [PATCH 5/5] refac: ollama non stream response --- backend/apps/ollama/main.py | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/backend/apps/ollama/main.py b/backend/apps/ollama/main.py index 455dc89a5..fd4ba7b06 100644 --- a/backend/apps/ollama/main.py +++ b/backend/apps/ollama/main.py @@ -153,7 +153,7 @@ async def cleanup_response( await session.close() -async def post_streaming_url(url: str, payload: str): +async def post_streaming_url(url: str, payload: str, stream: bool = True): r = None try: session = aiohttp.ClientSession( @@ -162,12 +162,20 @@ async def post_streaming_url(url: str, payload: str): r = await session.post(url, data=payload) r.raise_for_status() - return StreamingResponse( - r.content, - status_code=r.status, - headers=dict(r.headers), - background=BackgroundTask(cleanup_response, response=r, session=session), - ) + if stream: + return StreamingResponse( + r.content, + status_code=r.status, + headers=dict(r.headers), + background=BackgroundTask( + cleanup_response, response=r, session=session + ), + ) + else: + res = await r.json() + await cleanup_response(r, session) + return res + except Exception as e: error_detail = "Open WebUI: Server Connection Error" if r is not None: @@ -963,7 +971,11 @@ async def generate_openai_chat_completion( url = app.state.config.OLLAMA_BASE_URLS[url_idx] log.info(f"url: {url}") - return await post_streaming_url(f"{url}/v1/chat/completions", json.dumps(payload)) + return await post_streaming_url( + f"{url}/v1/chat/completions", + json.dumps(payload), + stream=payload.get("stream", False), + ) @app.get("/v1/models")