Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🔧 refactor: update default API tool model to "gpt-4o-mini" in credent… #417

Merged
merged 1 commit into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions app/components/credential.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Credential(BaseModel):
api_key: str
api_endpoint: str
api_model: str
api_tool_model: str = "gpt-3.5-turbo"
api_tool_model: str = "gpt-4o-mini"

@classmethod
def from_provider(cls, token, provider_url):
Expand All @@ -36,7 +36,7 @@ def from_provider(cls, token, provider_url):
api_key=user_data["api_key"],
api_endpoint=user_data["api_endpoint"],
api_model=user_data["api_model"],
api_tool_model=user_data.get("api_tool_model", "gpt-3.5-turbo"),
api_tool_model=user_data.get("api_tool_model", "gpt-4o-mini"),
)


Expand All @@ -47,8 +47,8 @@ def from_provider(cls, token, provider_url):
global_credential = Credential(
api_key=os.getenv("GLOBAL_OAI_KEY"),
api_endpoint=os.getenv("GLOBAL_OAI_ENDPOINT"),
api_model=os.getenv("GLOBAL_OAI_MODEL", "gpt-3.5-turbo"),
api_tool_model=os.getenv("GLOBAL_OAI_TOOL_MODEL", "gpt-3.5-turbo"),
api_model=os.getenv("GLOBAL_OAI_MODEL", "gpt-4o-mini"),
api_tool_model=os.getenv("GLOBAL_OAI_TOOL_MODEL", "gpt-4o-mini"),
)
else:
global_credential = None
2 changes: 1 addition & 1 deletion app/sender/discord/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ async def listen_endpoint_command(
api_endpoint: str,
api_key: str,
api_model: str,
api_tool_model: str = "gpt-3.5-turbo",
api_tool_model: str = "gpt-4o-mini",
):
try:
credential = Credential(
Expand Down
4 changes: 2 additions & 2 deletions app/sender/kook/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,8 @@ async def listen_login_command(
msg: Message,
api_endpoint: str,
api_key: str,
api_model: str = "gpt-3.5-turbo",
api_tool_model: str = "gpt-3.5-turbo",
api_model: str = "gpt-4o-mini",
api_tool_model: str = "gpt-4o-mini",
):
try:
credential = Credential(
Expand Down
4 changes: 2 additions & 2 deletions app/sender/util_func.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ async def login(uid: str, arg_string) -> str:
error = telegramify_markdown.convert(
"🔑 **Incorrect format.**\n"
"You can set it via `/login https://<something api.openai.com>/v1$<api key>"
"$<model such as gpt-4-turbo>$<tool_model such as gpt-3.5-turbo>` format, "
"$<model such as gpt-4-turbo>$<tool_model such as gpt-4o-mini>` format, "
"or you can log in via URL using `/login token$https://provider.com`.\n"
"Use $ to separate the parameters."
)
Expand Down Expand Up @@ -202,7 +202,7 @@ async def login(uid: str, arg_string) -> str:
if len(settings) == 4:
api_tool_model = settings[3]
else:
api_tool_model = "gpt-3.5-turbo"
api_tool_model = "gpt-4o-mini"
credential = Credential(
api_endpoint=api_endpoint,
api_key=api_key,
Expand Down
Loading