Skip to content

Commit

Permalink
Merge branch 'main' into deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
CNSeniorious000 committed Jun 14, 2024
2 parents e970440 + 91dd3fc commit 6dffbd1
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 27 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1
- name: Install dependencies
working-directory: frontend
run: |
yarn install
bun install
- name: Run svelte-check
working-directory: frontend
run: |
yarn check
bun check
- name: Run prettier
working-directory: frontend
run: |
yarn prettier --check . --ignore-path ../.gitignore
bun prettier --check . --ignore-path ../.gitignore
2 changes: 1 addition & 1 deletion frontend/app/HeroPage.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import { tweened } from "svelte/motion";
const length = 20;
let i = tweened(length * 1.3, { easing: sineInOut, duration: 700 });
const i = tweened(length * 1.3, { easing: sineInOut, duration: 700 });
onMount(() => ($i = 0));
</script>
Expand Down
30 changes: 15 additions & 15 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,24 @@
"check": "svelte-check --tsconfig ./tsconfig.json"
},
"devDependencies": {
"@antfu/eslint-config": "^2.15.0",
"@antfu/eslint-config": "^2.21.1",
"@promplate/pattern": "^0.0.1",
"@sveltejs/vite-plugin-svelte": "^3.1.0",
"@sveltejs/vite-plugin-svelte": "^3.1.1",
"@tsconfig/svelte": "^5.0.4",
"@unocss/eslint-plugin": "^0.59.3",
"@unocss/extractor-svelte": "^0.59.3",
"@unocss/reset": "^0.59.3",
"eslint": "^8.57.0",
"@unocss/eslint-plugin": "^0.61.0",
"@unocss/extractor-svelte": "^0.61.0",
"@unocss/reset": "^0.61.0",
"eslint": "^9.4.0",
"eslint-plugin-format": "^0.1.1",
"eslint-plugin-svelte": "^2.37.0",
"prettier": "^3.2.5",
"prettier-plugin-svelte": "^3.2.3",
"svelte": "^4.2.15",
"svelte-check": "^3.6.9",
"svelte-eslint-parser": "^0.33.1",
"tslib": "^2.6.2",
"eslint-plugin-svelte": "^2.39.3",
"prettier": "^3.3.2",
"prettier-plugin-svelte": "^3.2.4",
"svelte": "^4.2.18",
"svelte-check": "^3.8.0",
"svelte-eslint-parser": "^0.37.0",
"tslib": "^2.6.3",
"typescript": "^5.4.5",
"unocss": "^0.59.3",
"vite": "^5.2.9"
"unocss": "^0.61.0",
"vite": "^5.3.1"
}
}
15 changes: 8 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,21 @@ readme = "README.md"
license = { text = "MIT" }
dependencies = [
"fastapi-slim~=0.111.0",
"uvicorn[standard]~=0.29.0",
"promplate[all]~=0.3.4.4",
"promplate-trace[langfuse,langsmith]==0.3.0dev2",
"uvicorn[standard]~=0.30.1",
"promplate[all]~=0.3.4.7",
"promplate-trace[langfuse,langsmith]==0.3.0dev5",
"python-box~=7.1.1",
"pydantic-settings~=2.2.1",
"pydantic-settings~=2.3.1",
"httpx[http2]~=0.27.0",
"promptools[stream,validation]~=0.1.3.3",
"fake-useragent~=1.5.1",
"html2text~=2024.2.26",
"beautifulsoup4~=4.12.3",
"rich~=13.7.1",
"zhipuai~=2.0.1",
"anthropic~=0.25.8",
"dashscope~=1.19.0",
"zhipuai~=2.1.0.20240521",
"anthropic~=0.28.0",
"dashscope~=1.19.2",
"logfire[fastapi,system-metrics]~=0.42.0",
]

[tool.pdm]
Expand Down
10 changes: 10 additions & 0 deletions src/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

from .routes.prompts import prompts_router
from .routes.run import run_router
from .utils.config import env
from .utils.load import generate_pyi
from .utils.time import now

Expand All @@ -21,3 +22,12 @@ async def greet():


app.mount("/", StaticFiles(directory="frontend/dist", html=True, check_dir=False))

if env.logfire_token:
import logfire

logfire.configure()
logfire.info("app started", **env.model_dump())
logfire.instrument_openai()
logfire.instrument_anthropic()
logfire.instrument_fastapi(app)
1 change: 1 addition & 0 deletions src/utils/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class Config(BaseSettings):

# other services
serper_api_key: str = ""
logfire_token: str = ""

base_path: str = ""

Expand Down
2 changes: 1 addition & 1 deletion src/utils/llm/anthropic.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ async def generate(prompt: str | list[Message], /, **config):
) as stream:
async for event in stream:
if event.type == "content_block_delta":
yield event.delta.text
yield getattr(event.delta, "text", "")


@link_llm("claude")
Expand Down

0 comments on commit 6dffbd1

Please sign in to comment.