mistralai 0.4.0__tar.gz → 0.4.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mistralai
3
- Version: 0.4.0
3
+ Version: 0.4.1
4
4
  Summary:
5
5
  Author: Bam4d
6
6
  Author-email: bam4d@mistral.ai
@@ -10,9 +10,9 @@ Classifier: Programming Language :: Python :: 3.9
10
10
  Classifier: Programming Language :: Python :: 3.10
11
11
  Classifier: Programming Language :: Python :: 3.11
12
12
  Classifier: Programming Language :: Python :: 3.12
13
- Requires-Dist: httpx (>=0.25,<0.26)
13
+ Requires-Dist: httpx (>=0.25,<1)
14
14
  Requires-Dist: orjson (>=3.9.10,<3.11)
15
- Requires-Dist: pydantic (>=2.5.2,<3.0.0)
15
+ Requires-Dist: pydantic (>=2.5.2,<3)
16
16
  Description-Content-Type: text/markdown
17
17
 
18
18
  # Mistral Python Client
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "mistralai"
3
- version = "0.4.0"
3
+ version = "0.4.1"
4
4
  description = ""
5
5
  authors = ["Bam4d <bam4d@mistral.ai>"]
6
6
  readme = "README.md"
@@ -23,10 +23,10 @@ exclude = ["docs", "tests", "examples", "tools", "build"]
23
23
 
24
24
 
25
25
  [tool.poetry.dependencies]
26
- python = "^3.9,<4.0"
27
- orjson = "^3.9.10,<3.11"
28
- pydantic = "^2.5.2,<3"
29
- httpx = "^0.25,<1"
26
+ python = ">=3.9,<4.0"
27
+ orjson = ">=3.9.10,<3.11"
28
+ pydantic = ">=2.5.2,<3"
29
+ httpx = ">=0.25,<1"
30
30
 
31
31
 
32
32
  [tool.poetry.group.dev.dependencies]
@@ -29,7 +29,7 @@ from mistralai.models.chat_completion import (
29
29
  ToolChoice,
30
30
  )
31
31
  from mistralai.models.embeddings import EmbeddingResponse
32
- from mistralai.models.models import ModelList
32
+ from mistralai.models.models import ModelDeleted, ModelList
33
33
 
34
34
 
35
35
  class MistralAsyncClient(ClientBase):
@@ -304,6 +304,14 @@ class MistralAsyncClient(ClientBase):
304
304
 
305
305
  raise MistralException("No response received")
306
306
 
307
+ async def delete_model(self, model_id: str) -> ModelDeleted:
308
+ single_response = self._request("delete", {}, f"v1/models/{model_id}")
309
+
310
+ async for response in single_response:
311
+ return ModelDeleted(**response)
312
+
313
+ raise MistralException("No response received")
314
+
307
315
  async def completion(
308
316
  self,
309
317
  model: str,
@@ -22,7 +22,7 @@ from mistralai.models.chat_completion import (
22
22
  ToolChoice,
23
23
  )
24
24
  from mistralai.models.embeddings import EmbeddingResponse
25
- from mistralai.models.models import ModelList
25
+ from mistralai.models.models import ModelDeleted, ModelList
26
26
 
27
27
 
28
28
  class MistralClient(ClientBase):
@@ -298,6 +298,14 @@ class MistralClient(ClientBase):
298
298
 
299
299
  raise MistralException("No response received")
300
300
 
301
+ def delete_model(self, model_id: str) -> ModelDeleted:
302
+ single_response = self._request("delete", {}, f"v1/models/{model_id}")
303
+
304
+ for response in single_response:
305
+ return ModelDeleted(**response)
306
+
307
+ raise MistralException("No response received")
308
+
301
309
  def completion(
302
310
  self,
303
311
  model: str,
@@ -10,7 +10,7 @@ from mistralai.exceptions import (
10
10
  )
11
11
  from mistralai.models.chat_completion import ChatMessage, Function, ResponseFormat, ToolChoice
12
12
 
13
- CLIENT_VERSION = "0.4.0"
13
+ CLIENT_VERSION = "0.4.1"
14
14
 
15
15
 
16
16
  class ClientBase(ABC):
@@ -31,3 +31,9 @@ class ModelCard(BaseModel):
31
31
  class ModelList(BaseModel):
32
32
  object: str
33
33
  data: List[ModelCard]
34
+
35
+
36
+ class ModelDeleted(BaseModel):
37
+ id: str
38
+ object: str
39
+ deleted: bool
File without changes
File without changes