Skip to content

Commit

Permalink
chore: support model gpt-4o-2024-05-13 and update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
CNSeniorious000 committed May 13, 2024
1 parent c1dfb43 commit 38c3146
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 34 deletions.
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@ requires-python = ">=3.10,<3.13"
readme = "README.md"
license = { text = "MIT" }
dependencies = [
"fastapi~=0.110.3",
"fastapi>=0.111.0",
"uvicorn[standard]~=0.29.0",
"promplate[all]~=0.3.4.4",
"promplate-trace[langfuse,langsmith]==0.3.0dev2",
"python-box~=7.1.1",
"pydantic-settings~=2.2.1",
"httpx[http2]~=0.27.0",
"promptools[stream,validation]~=0.1.3.2",
"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.7",
"dashscope~=1.17.1",
"anthropic~=0.25.8",
"dashscope~=1.19.0",
]

[tool.pdm.dev-dependencies]
Expand Down
31 changes: 1 addition & 30 deletions src/routes/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from ..logic import get_node
from ..logic.tools import tool_map
from ..utils.config import env
from ..utils.llm import find_llm
from ..utils.llm import Model, find_llm
from .sse import non_duplicated_event_stream

run_router = APIRouter(tags=["call"])
Expand All @@ -23,35 +23,6 @@ class Msg(BaseModel):
name: Annotated[Literal.__getitem__(tuple(tool_map)), str] | None = None # type: ignore


Model = Literal[
"gpt-3.5-turbo-0301",
"gpt-3.5-turbo-0613",
"gpt-3.5-turbo-1106",
"gpt-3.5-turbo-0125",
"gpt-4-1106-preview",
"gpt-4-0125-preview",
"gpt-4-turbo-2024-04-09",
"chatglm_turbo",
"claude-instant-1.2",
"claude-2.1",
"claude-3-opus-20240229",
"claude-3-sonnet-20240229",
"claude-3-haiku-20240307",
"gemma-7b-it",
"llama3-8b-8192",
"llama3-70b-8192",
"llama2-70b-4096",
"mixtral-8x7b-32768",
"nous-hermes-2-mixtral-8x7b-dpo",
"qwen-turbo",
"qwen-plus",
"qwen-max",
"abab5.5s-chat",
"abab5.5-chat",
"abab6-chat",
]


run_config_fields = {"model", "temperature", "stop", "stop_sequences"}


Expand Down
31 changes: 31 additions & 0 deletions src/utils/llm/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from typing import Literal

from .anthropic import anthropic
from .chatglm import glm
from .dispatch import find_llm
Expand All @@ -6,3 +8,32 @@
from .octoai import octoai
from .openai import openai
from .qwen import qwen

Model = Literal[
"gpt-3.5-turbo-0301",
"gpt-3.5-turbo-0613",
"gpt-3.5-turbo-1106",
"gpt-3.5-turbo-0125",
"gpt-4o-2024-05-13",
"gpt-4-1106-preview",
"gpt-4-0125-preview",
"gpt-4-turbo-2024-04-09",
"chatglm_turbo",
"claude-instant-1.2",
"claude-2.1",
"claude-3-opus-20240229",
"claude-3-sonnet-20240229",
"claude-3-haiku-20240307",
"gemma-7b-it",
"llama3-8b-8192",
"llama3-70b-8192",
"llama2-70b-4096",
"mixtral-8x7b-32768",
"nous-hermes-2-mixtral-8x7b-dpo",
"qwen-turbo",
"qwen-plus",
"qwen-max",
"abab5.5s-chat",
"abab5.5-chat",
"abab6-chat",
]

0 comments on commit 38c3146

Please sign in to comment.