Skip to content

Commit

Permalink
fix grazie llm instantiation
Browse files Browse the repository at this point in the history
  • Loading branch information
waleko committed Jun 25, 2024
1 parent 453c621 commit e81db58
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions code_editing/configs/agents/llm_config.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import os
from dataclasses import dataclass
from dataclasses import dataclass, field

from grazie.api.client.endpoints import GrazieApiGatewayUrls
from grazie.api.client.gateway import AuthType
from grazie.api.client.profiles import LLMProfile, Profile
from hydra.core.config_store import ConfigStore
from omegaconf import MISSING

Expand All @@ -19,12 +18,17 @@ class OpenAILLMConfigChat(ChatLLMConfig):
model_name: str = "gpt-3.5-turbo"


@dataclass
class GrazieLLMConfig(ChatLLMConfig):
@dataclass
class LLMProfileConfig:
_target_: str = "grazie.api.client.profiles.Profile.get_by_name"
name: str = "openai-chat-gpt"
_target_: str = "grazie_langchain_utils.language_models.grazie.ChatGrazie"
grazie_jwt_token: str = os.environ.get("GRAZIE_JWT_TOKEN", MISSING)
auth_type: str = AuthType.USER
client_url: str = GrazieApiGatewayUrls.STAGING
profile: LLMProfile = Profile.OPENAI_CHAT_GPT
profile: LLMProfileConfig = field(default_factory=LLMProfileConfig)


cs = ConfigStore.instance()
Expand Down

0 comments on commit e81db58

Please sign in to comment.