From 20218d77c3f7d87eaa7bc761353a64358820d0a5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 28 Jan 2025 12:21:34 +0000 Subject: [PATCH 01/21] chore(deps): update logfire[fastapi,httpx,system-metrics] requirement Updates the requirements on [logfire[fastapi,httpx,system-metrics]](https://github.com/pydantic/logfire) to permit the latest version. - [Release notes](https://github.com/pydantic/logfire/releases) - [Changelog](https://github.com/pydantic/logfire/blob/main/CHANGELOG.md) - [Commits](https://github.com/pydantic/logfire/compare/v3.3.0...v3.4.0) --- updated-dependencies: - dependency-name: logfire[fastapi,httpx,system-metrics] dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 4cc369e..980ee2d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,7 +21,7 @@ dependencies = [ "zhipuai~=2.1.5.20241203", "anthropic~=0.45.0", "dashscope~=1.22.0", - "logfire[fastapi,system-metrics,httpx]~=3.3.0", + "logfire[fastapi,system-metrics,httpx]~=3.4.0", ] [tool.pdm] From 3ec1b1074630eefc26e5f4f0bc482d205033dbf5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 30 Jan 2025 12:30:10 +0000 Subject: [PATCH 02/21] chore(deps-dev): bump @antfu/eslint-config in /frontend Bumps [@antfu/eslint-config](https://github.com/antfu/eslint-config) from 3.16.0 to 4.1.0. - [Release notes](https://github.com/antfu/eslint-config/releases) - [Commits](https://github.com/antfu/eslint-config/compare/v3.16.0...v4.1.0) --- updated-dependencies: - dependency-name: "@antfu/eslint-config" dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- frontend/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/package.json b/frontend/package.json index ef8133a..4a965ab 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -12,7 +12,7 @@ "check": "svelte-check --tsconfig ./tsconfig.json" }, "devDependencies": { - "@antfu/eslint-config": "^3.0.0", + "@antfu/eslint-config": "^4.1.0", "@promplate/pattern": "^0.0.1", "@sveltejs/vite-plugin-svelte": "^3.1.1", "@tsconfig/svelte": "^5.0.4", From a3371896c81d1c9d98889bbde61348f703394e13 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Feb 2025 12:42:12 +0000 Subject: [PATCH 03/21] chore(deps): update beautifulsoup4 requirement from ~=4.12.3 to ~=4.13.1 Updates the requirements on [beautifulsoup4](https://www.crummy.com/software/BeautifulSoup/bs4/) to permit the latest version. --- updated-dependencies: - dependency-name: beautifulsoup4 dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 980ee2d..fe06ea7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,7 +16,7 @@ dependencies = [ "promptools[stream,validation]~=0.1.3.3", "fake-useragent~=2.0.0", "html2text~=2024.2.26", - "beautifulsoup4~=4.12.3", + "beautifulsoup4~=4.13.1", "rich~=13.9.0", "zhipuai~=2.1.5.20241203", "anthropic~=0.45.0", From 9ef085a36c82f2e69999637a15bdd578a7aa16d4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 4 Feb 2025 12:38:48 +0000 Subject: [PATCH 04/21] chore(deps): update logfire[fastapi,httpx,system-metrics] requirement Updates the requirements on [logfire[fastapi,httpx,system-metrics]](https://github.com/pydantic/logfire) to permit the latest version. - [Release notes](https://github.com/pydantic/logfire/releases) - [Changelog](https://github.com/pydantic/logfire/blob/main/CHANGELOG.md) - [Commits](https://github.com/pydantic/logfire/compare/v3.4.0...v3.5.0) --- updated-dependencies: - dependency-name: logfire[fastapi,httpx,system-metrics] dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index fe06ea7..d35695b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,7 +21,7 @@ dependencies = [ "zhipuai~=2.1.5.20241203", "anthropic~=0.45.0", "dashscope~=1.22.0", - "logfire[fastapi,system-metrics,httpx]~=3.4.0", + "logfire[fastapi,system-metrics,httpx]~=3.5.0", ] [tool.pdm] From 9bb8d0b9be1940a34d8907c3a7f5e22a35cbe665 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 18 Feb 2025 15:59:59 +0800 Subject: [PATCH 05/21] chore(ci): add `renovate.json` --- renovate.json | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 renovate.json diff --git a/renovate.json b/renovate.json new file mode 100644 index 0000000..5db72dd --- /dev/null +++ b/renovate.json @@ -0,0 +1,6 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": [ + "config:recommended" + ] +} From a8bee0d23983ec93c6c1affb9b3e58c29b5d1e27 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 18 Feb 2025 16:01:37 +0800 Subject: [PATCH 06/21] chore(deps): update dependency black to ~=24.10.0 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index d35695b..4d8ab7d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,7 +30,7 @@ distribution = false [dependency-groups] dev = [ "isort~=5.13.2", - "black~=24.4.2", + "black~=24.10.0", ] [tool.pdm.scripts] From ba393cb834a64186e935c242e615309d54597cb7 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 18 Feb 2025 16:20:36 +0800 Subject: [PATCH 07/21] chore(deps): update unocss monorepo to v65 Co-authored-by: Muspi Merol --- frontend/package.json | 8 ++++---- frontend/uno.config.ts | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/frontend/package.json b/frontend/package.json index 4a965ab..7a8e797 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -16,9 +16,9 @@ "@promplate/pattern": "^0.0.1", "@sveltejs/vite-plugin-svelte": "^3.1.1", "@tsconfig/svelte": "^5.0.4", - "@unocss/eslint-plugin": "^0.61.0", - "@unocss/extractor-svelte": "^0.61.0", - "@unocss/reset": "^0.61.0", + "@unocss/eslint-plugin": "^65.0.0", + "@unocss/extractor-svelte": "^65.0.0", + "@unocss/reset": "^65.0.0", "eslint": "^9.4.0", "eslint-plugin-format": "^1.0.1", "eslint-plugin-svelte": "^2.39.3", @@ -29,7 +29,7 @@ "svelte-eslint-parser": "^0.43.0", "tslib": "^2.6.3", "typescript": "^5.4.5", - "unocss": "^0.61.0", + "unocss": "^65.0.0", "vite": "^5.3.1" } } diff --git a/frontend/uno.config.ts b/frontend/uno.config.ts index 46b9a2e..826083b 100644 --- a/frontend/uno.config.ts +++ b/frontend/uno.config.ts @@ -4,7 +4,7 @@ import { defineConfig, presetAttributify, presetUno, presetWebFonts, transformer const config = defineConfig({ extractors: [extractorSvelte()], transformers: [transformerDirectives(), transformerVariantGroup()], - presets: [presetAttributify(), presetUno(), presetWebFonts({ provider: "bunny", fonts: { mono: "Fira Code" } })], + presets: [presetAttributify(), presetUno({ preflight: "on-demand" }), presetWebFonts({ provider: "bunny", fonts: { mono: "Fira Code" } })], }); export default config; From 78590411fbb9c97ea73f8e1790638ad681735d73 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 18 Feb 2025 16:24:59 +0800 Subject: [PATCH 08/21] chore(deps): update dependency isort to v6 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 4d8ab7d..cb404fa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,7 +29,7 @@ distribution = false [dependency-groups] dev = [ - "isort~=5.13.2", + "isort~=6.0.0", "black~=24.10.0", ] From 175b93c87fd146f23fbc1d3665f0dbcd1e6f494f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 18 Feb 2025 16:26:50 +0800 Subject: [PATCH 09/21] chore(deps): update dependency black to v25 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index cb404fa..f19be49 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,7 +30,7 @@ distribution = false [dependency-groups] dev = [ "isort~=6.0.0", - "black~=24.10.0", + "black~=25.1.0", ] [tool.pdm.scripts] From bf93b72fdf9ca99ee2c7735f62f5cc38ff21b474 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 18 Feb 2025 17:16:40 +0800 Subject: [PATCH 10/21] feat(deps): migrate svelte to v5 Co-authored-by: Muspi Merol --- frontend/app/HeroPage.svelte | 8 ++++---- frontend/app/main.ts | 7 +++---- frontend/package.json | 14 +++++++------- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/frontend/app/HeroPage.svelte b/frontend/app/HeroPage.svelte index c440259..ed98419 100644 --- a/frontend/app/HeroPage.svelte +++ b/frontend/app/HeroPage.svelte @@ -2,18 +2,18 @@ import { TokenSquare } from "@promplate/pattern"; import { onMount } from "svelte"; import { sineInOut } from "svelte/easing"; - import { tweened } from "svelte/motion"; + import { Tween } from "svelte/motion"; const length = 20; - const i = tweened(length * 1.3, { easing: sineInOut, duration: 700 }); + const i = new Tween(length * 1.3, { easing: sineInOut, duration: 700 }); - onMount(() => ($i = 0)); + onMount(() => i.set(0));
- y - x >= $i} /> + y - x >= i.current} />

Promplate diff --git a/frontend/app/main.ts b/frontend/app/main.ts index 61c6d6b..128095d 100644 --- a/frontend/app/main.ts +++ b/frontend/app/main.ts @@ -1,9 +1,8 @@ +import { mount } from "svelte"; import App from "./App.svelte"; import "@unocss/reset/tailwind-compat.css"; import "uno.css"; -const app = new App({ - target: document.getElementById("app")!, +export default mount(App, { + target: document.body, }); - -export default app; diff --git a/frontend/package.json b/frontend/package.json index 7a8e797..0f558e5 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -13,23 +13,23 @@ }, "devDependencies": { "@antfu/eslint-config": "^4.1.0", - "@promplate/pattern": "^0.0.1", - "@sveltejs/vite-plugin-svelte": "^3.1.1", + "@promplate/pattern": "^0.0.3", + "@sveltejs/vite-plugin-svelte": "^5.0.0", "@tsconfig/svelte": "^5.0.4", "@unocss/eslint-plugin": "^65.0.0", "@unocss/extractor-svelte": "^65.0.0", "@unocss/reset": "^65.0.0", "eslint": "^9.4.0", "eslint-plugin-format": "^1.0.1", - "eslint-plugin-svelte": "^2.39.3", + "eslint-plugin-svelte": "^2.45.1", "prettier": "^3.3.2", - "prettier-plugin-svelte": "^3.2.4", - "svelte": "^4.2.18", + "prettier-plugin-svelte": "^3.2.6", + "svelte": "^5.0.0", "svelte-check": "^4.0.0", "svelte-eslint-parser": "^0.43.0", "tslib": "^2.6.3", - "typescript": "^5.4.5", + "typescript": "^5.5.0", "unocss": "^65.0.0", - "vite": "^5.3.1" + "vite": "^6.0.0" } } From 114bab3d5c02d37e2477280428c08bb06ce4f2b3 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 19 Feb 2025 09:45:18 +0800 Subject: [PATCH 11/21] fix(deps): update dependency anthropic to ~=0.46.0 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index f19be49..5e82bd4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,7 +19,7 @@ dependencies = [ "beautifulsoup4~=4.13.1", "rich~=13.9.0", "zhipuai~=2.1.5.20241203", - "anthropic~=0.45.0", + "anthropic~=0.46.0", "dashscope~=1.22.0", "logfire[fastapi,system-metrics,httpx]~=3.5.0", ] From a0a5bca3724870617b8f171d2d2d78d62013f78f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 19 Feb 2025 10:45:16 +0800 Subject: [PATCH 12/21] fix(deps): update dependency logfire to ~=3.6.0 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 5e82bd4..bfe03fc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,7 +21,7 @@ dependencies = [ "zhipuai~=2.1.5.20241203", "anthropic~=0.46.0", "dashscope~=1.22.0", - "logfire[fastapi,system-metrics,httpx]~=3.5.0", + "logfire[fastapi,system-metrics,httpx]~=3.6.0", ] [tool.pdm] From 5942d55b6efb1630877f11ba10acf2d9fb198e9b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 19 Feb 2025 17:09:44 +0800 Subject: [PATCH 13/21] chore(deps): update unocss monorepo to v66 Co-authored-by: Muspi Merol --- frontend/package.json | 8 ++++---- frontend/uno.config.ts | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/frontend/package.json b/frontend/package.json index 0f558e5..88847e5 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -16,9 +16,9 @@ "@promplate/pattern": "^0.0.3", "@sveltejs/vite-plugin-svelte": "^5.0.0", "@tsconfig/svelte": "^5.0.4", - "@unocss/eslint-plugin": "^65.0.0", - "@unocss/extractor-svelte": "^65.0.0", - "@unocss/reset": "^65.0.0", + "@unocss/eslint-plugin": "^66.0.0", + "@unocss/extractor-svelte": "^66.0.0", + "@unocss/reset": "^66.0.0", "eslint": "^9.4.0", "eslint-plugin-format": "^1.0.1", "eslint-plugin-svelte": "^2.45.1", @@ -29,7 +29,7 @@ "svelte-eslint-parser": "^0.43.0", "tslib": "^2.6.3", "typescript": "^5.5.0", - "unocss": "^65.0.0", + "unocss": "^66.0.0", "vite": "^6.0.0" } } diff --git a/frontend/uno.config.ts b/frontend/uno.config.ts index 826083b..48e4c3c 100644 --- a/frontend/uno.config.ts +++ b/frontend/uno.config.ts @@ -1,10 +1,10 @@ import extractorSvelte from "@unocss/extractor-svelte"; -import { defineConfig, presetAttributify, presetUno, presetWebFonts, transformerDirectives, transformerVariantGroup } from "unocss"; +import { defineConfig, presetAttributify, presetWebFonts, presetWind3, transformerDirectives, transformerVariantGroup } from "unocss"; const config = defineConfig({ extractors: [extractorSvelte()], transformers: [transformerDirectives(), transformerVariantGroup()], - presets: [presetAttributify(), presetUno({ preflight: "on-demand" }), presetWebFonts({ provider: "bunny", fonts: { mono: "Fira Code" } })], + presets: [presetAttributify(), presetWind3({ preflight: "on-demand" }), presetWebFonts({ provider: "bunny", fonts: { mono: "Fira Code" } })], }); export default config; From 42f3f352736d281854a1f7e1743e0789e72afe7b Mon Sep 17 00:00:00 2001 From: Muspi Merol Date: Wed, 19 Feb 2025 21:10:29 +0800 Subject: [PATCH 14/21] chore: update llm from github models provider --- src/utils/llm/__init__.py | 4 ++++ src/utils/llm/azure.py | 3 +++ 2 files changed, 7 insertions(+) diff --git a/src/utils/llm/__init__.py b/src/utils/llm/__init__.py index 8341f7d..41f10e7 100644 --- a/src/utils/llm/__init__.py +++ b/src/utils/llm/__init__.py @@ -36,12 +36,14 @@ "azure:gpt-4o-mini", "azure:o1", "azure:o1-mini", + "azure:o3-mini", "azure:o1-preview", "Mistral-Nemo", "Mistral-large", "Mistral-large-2407", "Mistral-large-2411", "Mistral-small", + "Codestral-2501", "Ministral-3B", "Meta-Llama-3.1-405B-Instruct", "Meta-Llama-3.1-70B-Instruct", @@ -54,6 +56,7 @@ "Cohere-command-r-08-2024", "AI21-Jamba-1.5-Large", "AI21-Jamba-1.5-Mini", + "Phi-4", "Phi-3.5-MoE-instruct", "Phi-3.5-mini-instruct", "Phi-3-medium-128k-instruct", @@ -62,6 +65,7 @@ "Phi-3-mini-4k-instruct", "Phi-3-small-128k-instruct", "Phi-3-small-8k-instruct", + "DeepSeek-R1", "chatglm_turbo", "claude-instant-1.2", "claude-2.1", diff --git a/src/utils/llm/azure.py b/src/utils/llm/azure.py index d1c0a45..751c493 100644 --- a/src/utils/llm/azure.py +++ b/src/utils/llm/azure.py @@ -14,13 +14,16 @@ @link_llm("azure:o1") +@link_llm("azure:o3") @link_llm("azure:gpt") @link_llm("Ministral") +@link_llm("Codestral") @link_llm("Mistral") @link_llm("Meta") @link_llm("Cohere") @link_llm("AI21") @link_llm("Phi") +@link_llm("DeepSeek") class AzureOpenAI(AsyncChatOpenAI): @staticmethod async def generate(prompt, **kwargs): From 041d79c60dbcbe7f5239a652f2f5a503cc2face2 Mon Sep 17 00:00:00 2001 From: Muspi Merol Date: Wed, 19 Feb 2025 21:36:28 +0800 Subject: [PATCH 15/21] chore: update llm from groq provider --- src/utils/llm/__init__.py | 5 +++++ src/utils/llm/groq.py | 2 ++ 2 files changed, 7 insertions(+) diff --git a/src/utils/llm/__init__.py b/src/utils/llm/__init__.py index 41f10e7..f0c63e2 100644 --- a/src/utils/llm/__init__.py +++ b/src/utils/llm/__init__.py @@ -72,6 +72,11 @@ "claude-3-opus-20240229", "claude-3-sonnet-20240229", "claude-3-haiku-20240307", + "qwen-2.5-32b", + "qwen-2.5-coder-32b", + "deepseek-r1-distill-qwen-32b", + "deepseek-r1-distill-llama-70b", + "deepseek-r1-distill-llama-70b-specdec", "gemma-7b-it", "gemma2-9b-it", "llama3-8b-8192", diff --git a/src/utils/llm/groq.py b/src/utils/llm/groq.py index dadfd1c..dd6be0b 100644 --- a/src/utils/llm/groq.py +++ b/src/utils/llm/groq.py @@ -18,6 +18,8 @@ @link_llm("llama-3.2") @link_llm("llama-3.3-70b-") @link_llm("mixtral") +@link_llm("qwen-2.5") +@link_llm("deepseek-r1-distill") class Groq(AsyncChatOpenAI): async def complete(self, prompt: str | list[Message], /, **config): config = self._run_config | config From 7050fa87656f46941aa35b6712908d6f16bf1db8 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 22 Feb 2025 09:29:15 +0800 Subject: [PATCH 16/21] fix(deps): update dependency pydantic-settings to ~=2.8.0 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index bfe03fc..d802826 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,7 +11,7 @@ dependencies = [ "promplate[all]~=0.3.5.0", "promplate-trace[langfuse,langsmith]==0.3.0dev5", "python-box~=7.3.0", - "pydantic-settings~=2.7.0", + "pydantic-settings~=2.8.0", "httpx[http2]~=0.28.0", "promptools[stream,validation]~=0.1.3.3", "fake-useragent~=2.0.0", From 94cdd396d9f9e392c3996a2218687277b0e92970 Mon Sep 17 00:00:00 2001 From: Muspi Merol Date: Sat, 22 Feb 2025 16:26:43 +0800 Subject: [PATCH 17/21] feat: improve openai-compatible api --- src/routes/openai.py | 17 ++++++++++++++--- src/utils/openai_api.py | 11 ++++++----- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/src/routes/openai.py b/src/routes/openai.py index 586b4a8..dc9c6ff 100644 --- a/src/routes/openai.py +++ b/src/routes/openai.py @@ -1,7 +1,8 @@ -from typing import AsyncIterable, cast +from typing import AsyncIterable, Literal, cast, get_args from fastapi import APIRouter from promplate import Message +from typing_extensions import TypedDict from ..utils.llm import Model from ..utils.llm.dispatch import find_llm @@ -12,8 +13,18 @@ openai_router = APIRouter(tags=["openai"]) +class ModelItem(TypedDict): + id: Model + object: Literal["model"] + + +class ModelList(TypedDict): + object: Literal["list"] + data: list[ModelItem] + + @openai_router.get("/models") -async def get_models(): +async def get_models() -> ModelList: return { "object": "list", "data": [ @@ -21,7 +32,7 @@ async def get_models(): "id": name, "object": "model", } - for name in Model.__args__ + for name in get_args(Model) ], } diff --git a/src/utils/openai_api.py b/src/utils/openai_api.py index 4cd4331..54178fd 100644 --- a/src/utils/openai_api.py +++ b/src/utils/openai_api.py @@ -3,12 +3,12 @@ from typing import AsyncIterable -def format_chunk(id, content, model, stop=False): +def format_chunk(t, id, content, model, stop=False): if stop: choice = {"index": 0, "delta": {}, "finish_reason": "stop"} else: choice = {"index": 0, "delta": {"content": content, "role": "assistant"}} - return {"id": id, "choices": [choice], "model": model, "object": "chat.completion.chunk"} + return {"id": id, "choices": [choice], "model": model, "object": "chat.completion.chunk", "created": t} def format_response(content, model: str): @@ -21,9 +21,10 @@ def format_response(content, model: str): async def stream_output(stream: AsyncIterable[str], model: str): - response_id = f"chatcmpl-{int(time())}" + created = int(time()) + response_id = f"chatcmpl-{created}" async for delta in stream: - yield f"data: {dumps(format_chunk(response_id, delta, model))}\n\n" + yield f"data: {dumps(format_chunk(created, response_id, delta, model))}\n\n" - yield f"data: {dumps(format_chunk(response_id, None, model, stop=True))}\n\ndata: [DONE]\n\n" + yield f"data: {dumps(format_chunk(created, response_id, None, model, stop=True))}\n\ndata: [DONE]\n\n" From 29c69a5281d9699b1db3ac4be2689e380c2756a7 Mon Sep 17 00:00:00 2001 From: Muspi Merol Date: Sat, 22 Feb 2025 17:33:25 +0800 Subject: [PATCH 18/21] feat: support specifying prompt content as a list --- src/routes/openai.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/routes/openai.py b/src/routes/openai.py index dc9c6ff..ba2d1b7 100644 --- a/src/routes/openai.py +++ b/src/routes/openai.py @@ -1,7 +1,9 @@ from typing import AsyncIterable, Literal, cast, get_args from fastapi import APIRouter +from openai.types.chat import ChatCompletionContentPartTextParam from promplate import Message +from pydantic import field_serializer from typing_extensions import TypedDict from ..utils.llm import Model @@ -37,9 +39,21 @@ async def get_models() -> ModelList: } +class CompatibleMessage(Message): + content: str | list[ChatCompletionContentPartTextParam] # type: ignore + + class ChatInput(ChainInput): stream: bool = False - messages: list[Message] # type: ignore + messages: list[CompatibleMessage] # type: ignore + + @field_serializer("messages") + def serialize_messages(self, value: CompatibleMessage): + content = value["content"] + if isinstance(content, str): + return value + value["content"] = "".join(i["text"] for i in content) + return value @property def config(self): From 607f228d17f9022e94299d6d48c1fcad18301805 Mon Sep 17 00:00:00 2001 From: Muspi Merol Date: Sat, 22 Feb 2025 18:10:37 +0800 Subject: [PATCH 19/21] chore: organize config files --- .github/ISSUE_TEMPLATE/sweep-template.yml | 15 -------- renovate.json => .github/renovate.json | 0 sweep.yaml | 43 ----------------------- 3 files changed, 58 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/sweep-template.yml rename renovate.json => .github/renovate.json (100%) delete mode 100644 sweep.yaml diff --git a/.github/ISSUE_TEMPLATE/sweep-template.yml b/.github/ISSUE_TEMPLATE/sweep-template.yml deleted file mode 100644 index 44116f5..0000000 --- a/.github/ISSUE_TEMPLATE/sweep-template.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: Sweep Issue -title: 'Sweep: ' -description: For small bugs, features, refactors, and tests to be handled by Sweep, an AI-powered junior developer. -labels: sweep -body: - - type: textarea - id: description - attributes: - label: Details - description: Tell Sweep where and what to edit and provide enough context for a new developer to the codebase - placeholder: | - Unit Tests: Write unit tests for . Test each function in the file. Make sure to test edge cases. - Bugs: The bug might be in . Here are the logs: ... - Features: the new endpoint should use the ... class from because it contains ... logic. - Refactors: We are migrating this function to ... version because ... \ No newline at end of file diff --git a/renovate.json b/.github/renovate.json similarity index 100% rename from renovate.json rename to .github/renovate.json diff --git a/sweep.yaml b/sweep.yaml deleted file mode 100644 index e2c3de3..0000000 --- a/sweep.yaml +++ /dev/null @@ -1,43 +0,0 @@ -# Sweep AI turns bugs & feature requests into code changes (https://sweep.dev) -# For details on our config file, check out our docs at https://docs.sweep.dev/usage/config - -# This setting contains a list of rules that Sweep will check for. If any of these rules are broken in a new commit, Sweep will create an pull request to fix the broken rule. -rules: -- "All new business logic should have corresponding unit tests." -- "Refactor large functions to be more modular." -- "Add docstrings to all functions and file headers." - -# This is the branch that Sweep will develop from and make pull requests to. Most people use 'main' or 'master' but some users also use 'dev' or 'staging'. -branch: 'main' - -# By default Sweep will read the logs and outputs from your existing Github Actions. To disable this, set this to false. -gha_enabled: True - -# This is the description of your project. It will be used by sweep when creating PRs. You can tell Sweep what's unique about your project, what frameworks you use, or anything else you want. -# -# Example: -# -# description: sweepai/sweep is a python project. The main api endpoints are in sweepai/api.py. Write code that adheres to PEP8. -description: '' - -# This sets whether to create pull requests as drafts. If this is set to True, then all pull requests will be created as drafts and GitHub Actions will not be triggered. -draft: False - -# This is a list of directories that Sweep will not be able to edit. -blocked_dirs: [] - -# This is a list of documentation links that Sweep will use to help it understand your code. You can add links to documentation for any packages you use here. -# -# Example: -# -# docs: -# - PyGitHub: ["https://pygithub.readthedocs.io/en/latest/", "We use pygithub to interact with the GitHub API"] -docs: [] - -# Sandbox executes commands in a sandboxed environment to validate code changes after every edit to guarantee pristine code. For more details, see the [Sandbox](./sandbox) page. -sandbox: - install: - - trunk init - check: - - trunk fmt {file_path} || return 0 - - trunk check --fix --print-failures {file_path} From d561c51bff5919bd0d2ad59cd736ffeeeb70ed2e Mon Sep 17 00:00:00 2001 From: Muspi Merol Date: Sat, 22 Feb 2025 23:46:06 +0800 Subject: [PATCH 20/21] chore: update llm from siliconflow provider --- src/utils/llm/__init__.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/utils/llm/__init__.py b/src/utils/llm/__init__.py index f0c63e2..53fd378 100644 --- a/src/utils/llm/__init__.py +++ b/src/utils/llm/__init__.py @@ -103,11 +103,6 @@ "abab5.5-chat", "abab6-chat", "Qwen/QwQ-32B-Preview", - "Qwen/Qwen2-7B-Instruct", - "Qwen/Qwen2-1.5B-Instruct", - "Qwen/Qwen2-72B-Instruct", - "Qwen/Qwen2-57B-A14B-Instruct", - "Vendor-A/Qwen/Qwen2-72B-Instruct", "Qwen/Qwen2.5-Coder-7B-Instruct", "Qwen/Qwen2.5-7B-Instruct", "Qwen/Qwen2.5-14B-Instruct", @@ -123,6 +118,14 @@ "deepseek-ai/DeepSeek-V2-Chat", "deepseek-ai/DeepSeek-V2.5", "deepseek-ai/deepseek-llm-67b-chat", + "deepseek-ai/DeepSeek-V3", + "deepseek-ai/DeepSeek-R1", + "deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B", + "deepseek-ai/DeepSeek-R1-Distill-Qwen-7B", + "deepseek-ai/DeepSeek-R1-Distill-Qwen-14B", + "deepseek-ai/DeepSeek-R1-Distill-Qwen-32B", + "deepseek-ai/DeepSeek-R1-Distill-Llama-8B", + "deepseek-ai/DeepSeek-R1-Distill-Llama-70B", "internlm/internlm2_5-7b-chat", "internlm/internlm2_5-20b-chat", "yi-lightning", From 918a8562b7a97dfccb08bdb21f62ba65f9a9761f Mon Sep 17 00:00:00 2001 From: Muspi Merol Date: Sun, 23 Feb 2025 00:24:48 +0800 Subject: [PATCH 21/21] chore: update llm from sambanova provider --- src/utils/llm/__init__.py | 7 +++++++ src/utils/llm/sambanova.py | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/src/utils/llm/__init__.py b/src/utils/llm/__init__.py index 53fd378..b9c09a6 100644 --- a/src/utils/llm/__init__.py +++ b/src/utils/llm/__init__.py @@ -134,5 +134,12 @@ "Qwen2.5-Coder-32B-Instruct", "Qwen2.5-72B-Instruct", "QwQ-32B-Preview", + "Llama-3.1-Tulu-3-405B", + "Llama-3.2-11B-Vision-Instruct", + "Llama-3.2-90B-Vision-Instruct", + "Meta-Llama-3.2-1B-Instruct", + "Meta-Llama-3.2-3B-Instruct", + "Meta-Llama-3.3-70B-Instruct", + "DeepSeek-R1-Distill-Llama-70B", "deepseek-chat", ] diff --git a/src/utils/llm/sambanova.py b/src/utils/llm/sambanova.py index 80f613c..1329e5e 100644 --- a/src/utils/llm/sambanova.py +++ b/src/utils/llm/sambanova.py @@ -8,6 +8,10 @@ @link_llm("Qwen2.5") @link_llm("QwQ") +@link_llm("Llama-3") +@link_llm("Meta-Llama-3.2") +@link_llm("Meta-Llama-3.3") +@link_llm("DeepSeek-R1-Distill") class SambaNova(AsyncChatOpenAI): complete = staticmethod( patch.chat.acomplete(