diff --git a/oracles/src/entities.py b/oracles/src/entities.py index ee37248..08bc8fc 100644 --- a/oracles/src/entities.py +++ b/oracles/src/entities.py @@ -25,26 +25,6 @@ "claude-2.0", "claude-instant-1.2", ] -LlmModelType = Literal[ - # OpenAI models - "gpt-4o", - "gpt-4-turbo", - "gpt-4-turbo-preview", - "gpt-3.5-turbo-1106", - # Groq models - "llama3-8b-8192", - "llama3-70b-8192", - "mixtral-8x7b-32768", - "gemma-7b-it", - # Anthropic models - "claude-3-5-sonnet-20240620", - "claude-3-opus-20240229", - "claude-3-sonnet-20240229", - "claude-3-haiku-20240307", - "claude-2.1", - "claude-2.0", - "claude-instant-1.2", -] class PromptType(str, Enum): DEFAULT = "default" @@ -59,7 +39,7 @@ class PromptType(str, Enum): @dataclass class LlmConfig: - model: LlmModelType + model: AnthropicModelType frequency_penalty: Optional[float] logit_bias: Optional[Dict] max_tokens: Optional[int] diff --git a/oracles/src/repositories/web3/chat_repository.py b/oracles/src/repositories/web3/chat_repository.py index 5e4b629..7b37b07 100644 --- a/oracles/src/repositories/web3/chat_repository.py +++ b/oracles/src/repositories/web3/chat_repository.py @@ -19,7 +19,7 @@ from src.entities import OpenAiModelType from src.entities import ToolChoiceType from src.entities import LlmConfig -from src.entities import LlmModelType +from src.entities import AnthropicModelType from src.entities import PromptType from src.repositories.web3.base import Web3BaseRepository @@ -231,7 +231,7 @@ async def _build_response_tx(self, chat: Chat): async def _get_llm_config(self, i: int) -> Optional[LlmConfig]: config = await self.oracle_contract.functions.llmConfigurations(i).call() - if not config or not config[0] or not config[0] in get_args(LlmModelType): + if not config or not config[0] or not config[0] in get_args(AnthropicModelType): return None try: return LlmConfig(