|
1 | 1 | # initial_load.py
|
2 | 2 | from typing import Optional, Any
|
3 | 3 | from threading import Lock
|
4 |
| -from langchain_openai import ChatOpenAI |
5 |
| -from langchain_mistralai.chat_models import ChatMistralAI |
6 | 4 |
|
7 | 5 | from llama_github.config.config import config
|
8 | 6 | from llama_github.logger import logger
|
@@ -67,15 +65,17 @@ def __init__(self,
|
67 | 65 | self.llm = llm
|
68 | 66 | self.model_type = "Custom_langchain_llm"
|
69 | 67 | elif mistral_api_key is not None and mistral_api_key != "" and self.llm is None:
|
70 |
| - logger.info("Initializing Mistral API...") |
71 |
| - self.llm = ChatMistralAI(mistral_api_key=mistral_api_key, model="mistral-large-2411") |
| 68 | + logger.info("Initializing Codestral API...") |
| 69 | + from langchain_mistralai.chat_models import ChatMistralAI |
| 70 | + self.llm = ChatMistralAI(mistral_api_key=mistral_api_key, model="codestral-latest") |
72 | 71 | self.llm_simple = ChatMistralAI(
|
73 | 72 | mistral_api_key=mistral_api_key,
|
74 |
| - model="open-mistral-nemo", |
| 73 | + model="open-mistral-nemo", |
75 | 74 | temperature=0.2
|
76 | 75 | )
|
77 | 76 | self.model_type = "OpenAI"
|
78 | 77 | elif openai_api_key is not None and openai_api_key != "" and self.llm is None:
|
| 78 | + from langchain_openai import ChatOpenAI |
79 | 79 | logger.info("Initializing OpenAI API...")
|
80 | 80 | self.llm = ChatOpenAI(api_key=openai_api_key, model="gpt-4-turbo")
|
81 | 81 | self.llm_simple = ChatOpenAI(
|
|
0 commit comments