Method
__init__
(
self,
path: str,
key: str,
group_id: str,
model_type: str = 'chat',
url:
str = 'https://api.minimax.chat/v1/text/chatcompletion_pro?GroupId=',
query_per_second: int = 2,
max_seq_len: int = 2048,
meta_template: Optional[Dict] = None,
retry: int = 2,
)
Source from the content-addressed store, hash-verified
| 33 | """ |
| 34 | |
| 35 | def __init__( |
| 36 | self, |
| 37 | path: str, |
| 38 | key: str, |
| 39 | group_id: str, |
| 40 | model_type: str = 'chat', |
| 41 | url: |
| 42 | str = 'https://api.minimax.chat/v1/text/chatcompletion_pro?GroupId=', |
| 43 | query_per_second: int = 2, |
| 44 | max_seq_len: int = 2048, |
| 45 | meta_template: Optional[Dict] = None, |
| 46 | retry: int = 2, |
| 47 | ): |
| 48 | super().__init__(path=path, |
| 49 | max_seq_len=max_seq_len, |
| 50 | query_per_second=query_per_second, |
| 51 | meta_template=meta_template, |
| 52 | retry=retry) |
| 53 | self.headers = { |
| 54 | 'Authorization': f'Bearer {key}', |
| 55 | 'Content-Type': 'application/json', |
| 56 | } |
| 57 | self.type = model_type |
| 58 | self.url = url + group_id |
| 59 | self.model = path |
| 60 | |
| 61 | def generate( |
| 62 | self, |
Tested by
no test coverage detected