Skip to content

Commit

Permalink
Only Anthropic for now
Browse files Browse the repository at this point in the history
  • Loading branch information
kgrofelnik committed Jun 26, 2024
1 parent 2a6392a commit 3409977
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 23 deletions.
22 changes: 1 addition & 21 deletions oracles/src/entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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]
Expand Down
4 changes: 2 additions & 2 deletions oracles/src/repositories/web3/chat_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 3409977

Please sign in to comment.