(
self,
model_type: Union[ModelType, str],
model_config_dict: Optional[Dict[str, Any]] = None,
api_key: Optional[str] = None,
url: Optional[str] = None,
token_counter: Optional[BaseTokenCounter] = None,
)
| 66 | ) |
| 67 | @dependencies_required('mistralai') |
| 68 | def __init__( |
| 69 | self, |
| 70 | model_type: Union[ModelType, str], |
| 71 | model_config_dict: Optional[Dict[str, Any]] = None, |
| 72 | api_key: Optional[str] = None, |
| 73 | url: Optional[str] = None, |
| 74 | token_counter: Optional[BaseTokenCounter] = None, |
| 75 | ) -> None: |
| 76 | from mistralai import Mistral |
| 77 | |
| 78 | if model_config_dict is None: |
| 79 | model_config_dict = MistralConfig().as_dict() |
| 80 | |
| 81 | api_key = api_key or os.environ.get("MISTRAL_API_KEY") |
| 82 | url = url or os.environ.get("MISTRAL_API_BASE_URL") |
| 83 | super().__init__( |
| 84 | model_type, model_config_dict, api_key, url, token_counter |
| 85 | ) |
| 86 | self._client = Mistral(api_key=self._api_key, server_url=self._url) |
| 87 | |
| 88 | def _to_openai_response( |
| 89 | self, response: 'ChatCompletionResponse' |
nothing calls this directly
no test coverage detected