Skip to content

Commit

Permalink
fix(cache): use get_llm_cache and set_llm_cache instead of `langc…
Browse files Browse the repository at this point in the history
…hain.llm_cache` (#147)

* 🍱 update logo asset

* ⬆️ upgrade base dependencies

* ⬆️ upgrade example dependencies

* 🐛 fix langchain.llm_cache warning

use get_llm_cache() and set_llm_cache() functions

* 🔧 pre-commit autoupdate

* 👷 add new workflow to upgrade dependencies

* 🎨 pre-commit run

* 📌 pin pydantic dependency

v2.0+ support will be added in v0.8

* 🎨 minor change
  • Loading branch information
ajndkr authored Nov 14, 2023
1 parent ae158a7 commit 02f88b3
Show file tree
Hide file tree
Showing 11 changed files with 638 additions and 546 deletions.
70 changes: 70 additions & 0 deletions .github/workflows/dependency-manager.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Dependency Manager

on:
workflow_dispatch: # Allow running on-demand
schedule:
# Every Sunday at 1PM UTC
- cron: 0 13 * * 6

env:
PYTHON_VERSION: 3.9

jobs:
upgrade:
name: Weekly dependency upgrade
runs-on: ubuntu-latest
env:
BRANCH_NAME: deps/weekly-upgrade
steps:
- name: Code checkout
uses: actions/checkout@v4

- name: Setup python
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Upgrade base dependencies
run: |
pip install -U poetry
poetry update
- name: Upgrade dependencies of demo examples
run: |
pip install -U pip pip-tools
cd examples; pip-compile --upgrade requirements.in
- name: Upgrade pre-commit hooks
run: |
pip install pre-commit
pre-commit autoupdate
- name: Detect changes
id: changes
run: echo "count=$(git status --porcelain=v1 2>/dev/null | wc -l)" >> $GITHUB_OUTPUT

- name: Commit & push changes
if: steps.changes.outputs.count > 0
run: |
git config user.name "github-actions"
git config user.email "github-actions@github.com"
git add .
git commit -m "build(deps): upgrade dependencies"
git push -f origin ${{ github.ref_name }}:$BRANCH_NAME
- name: Open pull request
if: steps.changes.outputs.count > 0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
PR=$(gh pr list --head $BRANCH_NAME --json number -q '.[0].number')
if [ -z $PR ]; then
gh pr create \
--draft \
--head $BRANCH_NAME \
--title "build(deps): upgrade dependencies" \
--body "Full log: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
--label "dependencies"
else
echo "Pull request already exists, won't create a new one."
fi
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ default_language_version:

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: check-ast
- id: check-builtin-literals
Expand All @@ -26,12 +26,12 @@ repos:
args: [--markdown-linebreak-ext=md]

- repo: https://github.com/psf/black
rev: 23.1.0
rev: 23.11.0
hooks:
- id: black

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.259
rev: v0.1.5
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand All @@ -43,6 +43,6 @@ repos:
args: [--profile, black]

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.7.1
rev: v3.1.0
hooks:
- id: prettier
Binary file modified assets/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
97 changes: 55 additions & 42 deletions examples/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,24 @@
#
aiofiles==23.2.1
# via gradio
aiohttp==3.8.5
# via
# langchain
# openai
aiohttp==3.8.6
# via langchain
aiosignal==1.3.1
# via aiohttp
altair==5.1.1
altair==5.1.2
# via gradio
anyio==3.7.1
# via
# fastapi
# httpcore
# httpx
# langchain
# openai
# starlette
# watchfiles
async-timeout==4.0.3
# via aiohttp
# via
# aiohttp
# langchain
attrs==23.1.0
# via
# aiohttp
Expand All @@ -33,58 +34,63 @@ certifi==2023.7.22
# httpcore
# httpx
# requests
charset-normalizer==3.3.0
charset-normalizer==3.3.2
# via
# aiohttp
# requests
click==8.1.7
# via uvicorn
contourpy==1.1.1
contourpy==1.2.0
# via matplotlib
cycler==0.12.0
cycler==0.12.1
# via matplotlib
dataclasses-json==0.6.1
dataclasses-json==0.6.2
# via langchain
distro==1.8.0
# via openai
exceptiongroup==1.1.3
# via anyio
faiss-cpu==1.7.4
# via -r requirements.in
fastapi==0.103.2
fastapi==0.104.1
# via
# -r requirements.in
# gradio
# lanarky
ffmpy==0.3.1
# via gradio
filelock==3.12.4
filelock==3.13.1
# via huggingface-hub
fonttools==4.43.0
fonttools==4.44.0
# via matplotlib
frozenlist==1.4.0
# via
# aiohttp
# aiosignal
fsspec==2023.9.2
fsspec==2023.10.0
# via
# gradio-client
# huggingface-hub
gradio==3.46.0
gradio==3.50.2
# via -r requirements.in
gradio-client==0.5.3
gradio-client==0.6.1
# via gradio
greenlet==3.0.0
greenlet==3.0.1
# via sqlalchemy
h11==0.14.0
# via
# httpcore
# uvicorn
httpcore==0.18.0
httpcore==1.0.2
# via httpx
httptools==0.6.0
httptools==0.6.1
# via uvicorn
httpx==0.25.0
httpx==0.25.1
# via
# gradio
# gradio-client
huggingface-hub==0.17.3
# openai
huggingface-hub==0.19.1
# via
# gradio
# gradio-client
Expand All @@ -94,8 +100,10 @@ idna==3.4
# httpx
# requests
# yarl
importlib-resources==6.1.0
# via gradio
importlib-resources==6.1.1
# via
# gradio
# matplotlib
jinja2==3.1.2
# via
# altair
Expand All @@ -104,45 +112,45 @@ jsonpatch==1.33
# via langchain
jsonpointer==2.4
# via jsonpatch
jsonschema==4.19.1
jsonschema==4.19.2
# via altair
jsonschema-specifications==2023.7.1
# via jsonschema
kiwisolver==1.4.5
# via matplotlib
lanarky==0.7.16
# via -r requirements.in
langchain==0.0.312
langchain==0.0.335
# via
# -r requirements.in
# lanarky
langsmith==0.0.43
langsmith==0.0.64
# via langchain
markupsafe==2.1.3
# via
# gradio
# jinja2
marshmallow==3.20.1
# via dataclasses-json
matplotlib==3.8.0
matplotlib==3.8.1
# via gradio
multidict==6.0.4
# via
# aiohttp
# yarl
mypy-extensions==1.0.0
# via typing-inspect
numpy==1.26.0
numpy==1.26.2
# via
# altair
# contourpy
# gradio
# langchain
# matplotlib
# pandas
openai==0.28.1
openai==1.2.4
# via -r requirements.in
orjson==3.9.7
orjson==3.9.10
# via gradio
packaging==23.2
# via
Expand All @@ -152,11 +160,11 @@ packaging==23.2
# huggingface-hub
# marshmallow
# matplotlib
pandas==2.1.1
pandas==2.1.3
# via
# altair
# gradio
pillow==10.0.1
pillow==10.1.0
# via
# gradio
# matplotlib
Expand All @@ -167,6 +175,7 @@ pydantic==1.10.13
# gradio
# langchain
# langsmith
# openai
pydub==0.25.1
# via gradio
pyparsing==3.1.1
Expand All @@ -193,7 +202,7 @@ referencing==0.30.2
# via
# jsonschema
# jsonschema-specifications
regex==2023.8.8
regex==2023.10.3
# via tiktoken
requests==2.31.0
# via
Expand All @@ -202,9 +211,8 @@ requests==2.31.0
# huggingface-hub
# langchain
# langsmith
# openai
# tiktoken
rpds-py==0.10.3
rpds-py==0.12.0
# via
# jsonschema
# referencing
Expand All @@ -215,9 +223,8 @@ six==1.16.0
sniffio==1.3.0
# via
# anyio
# httpcore
# httpx
sqlalchemy==2.0.21
sqlalchemy==2.0.23
# via langchain
starlette==0.27.0
# via fastapi
Expand All @@ -233,26 +240,30 @@ tqdm==4.66.1
# openai
typing-extensions==4.8.0
# via
# altair
# fastapi
# gradio
# gradio-client
# huggingface-hub
# openai
# pydantic
# sqlalchemy
# starlette
# typing-inspect
# uvicorn
typing-inspect==0.9.0
# via dataclasses-json
tzdata==2023.3
# via pandas
urllib3==2.0.6
urllib3==2.1.0
# via requests
uvicorn[standard]==0.23.2
uvicorn[standard]==0.24.0.post1
# via
# -r requirements.in
# gradio
uvloop==0.17.0
uvloop==0.19.0
# via uvicorn
watchfiles==0.20.0
watchfiles==0.21.0
# via uvicorn
websockets==11.0.3
# via
Expand All @@ -261,3 +272,5 @@ websockets==11.0.3
# uvicorn
yarl==1.9.2
# via aiohttp
zipp==3.17.0
# via importlib-resources
2 changes: 1 addition & 1 deletion examples/templates/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand Down
Loading

0 comments on commit 02f88b3

Please sign in to comment.