Skip to content
This repository has been archived by the owner on Jun 12, 2024. It is now read-only.

Commit

Permalink
fix: async open router hot fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dsdanielpark committed Apr 24, 2024
1 parent 750740e commit 9dbecb2
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions gemini/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from .client import Gemini
from .async_client import GeminiClient
from .src.modules.openrouter.client import OpenRouter
from .src.modules.openrouter.async_client import AsyncOpenRouter

from .src.model.image import GeminiImage
from .src.model.output import GeminiCandidate, GeminiModelOutput
Expand Down
4 changes: 2 additions & 2 deletions gemini/src/modules/openrouter/async_client.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import aiohttp
import asyncio
from const import FreeModel
from .const import FREE_MODELS
from typing import List, Optional


Expand Down Expand Up @@ -87,7 +87,7 @@ def _validate_model(self, model: str) -> None:
"""
Checks if the specified model is in the list of free models.
"""
if model not in FreeModel:
if model not in FREE_MODELS:
print(
"This model may not be free. Please check the following list for costs.\nUsers are responsible for API costs. Visit https://openrouter.ai/docs#models"
)
4 changes: 2 additions & 2 deletions gemini/src/modules/openrouter/client.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import requests
from const import FreeModel
from .const import FREE_MODELS
from typing import List, Optional
from requests.models import Response

Expand Down Expand Up @@ -122,7 +122,7 @@ def _validate_model(self, model: str) -> None:
"""
Checks if the specified model is in the list of free models.
"""
if model not in FreeModel:
if model not in FREE_MODELS:
print(
"This model may not be free. Please check the following list for costs.\nUsers are responsible for API costs. Visit https://openrouter.ai/docs#models"
)
2 changes: 2 additions & 0 deletions gemini/src/modules/openrouter/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ class FreeModel(Enum):
MYTHOMIST_7B = "gryphe/mythomist-7b:free"
CAPYBARA_7B = "nousresearch/nous-capybara-7b:free"
OPENCHAT_7B = "openchat/openchat-7b:free"

FREE_MODELS = {member.value for member in FreeModel}

0 comments on commit 9dbecb2

Please sign in to comment.