mira-network 0.1.1__tar.gz → 0.1.2__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: mira-network
3
- Version: 0.1.1
3
+ Version: 0.1.2
4
4
  Summary: Python SDK for Mira Network API
5
5
  Author-Email: sarim2000 <sarimbleedblue@gmail.com>
6
6
  License: MIT
@@ -11,14 +11,14 @@ Requires-Dist: typing-extensions>=4.8.0
11
11
  Requires-Dist: requests>=2.32.3
12
12
  Description-Content-Type: text/markdown
13
13
 
14
- # Mira SDK
14
+ # Mira Network SDK
15
15
 
16
16
  A Python SDK for interacting with the Mira Network API. This SDK provides a simple interface to access all Mira API endpoints including model inference, flow management, and credit system.
17
17
 
18
18
  ## Installation
19
19
 
20
20
  ```bash
21
- pip install mira-sdk
21
+ pip install mira-network
22
22
  ```
23
23
 
24
24
  ## Quick Start
@@ -1,11 +1,11 @@
1
- # Mira SDK
1
+ # Mira Network SDK
2
2
 
3
3
  A Python SDK for interacting with the Mira Network API. This SDK provides a simple interface to access all Mira API endpoints including model inference, flow management, and credit system.
4
4
 
5
5
  ## Installation
6
6
 
7
7
  ```bash
8
- pip install mira-sdk
8
+ pip install mira-network
9
9
  ```
10
10
 
11
11
  ## Quick Start
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "mira-network"
3
- version = "0.1.1"
3
+ version = "0.1.2"
4
4
  description = "Python SDK for Mira Network API"
5
5
  authors = [
6
6
  { name = "sarim2000", email = "sarimbleedblue@gmail.com" },
@@ -1,6 +1,6 @@
1
1
  from typing import Optional, List, Dict, AsyncGenerator, Union
2
2
  import httpx
3
- from src.mira_sdk.models import (
3
+ from mira_sdk.models import (
4
4
  Message,
5
5
  ModelProvider,
6
6
  AiRequest,
@@ -14,15 +14,21 @@ from src.mira_sdk.models import (
14
14
  def client():
15
15
  return MiraClient(
16
16
  base_url="https://mira-client-balancer.alts.dev",
17
- api_token="sk-mira-8ac810228d32ff68fc93266fb9a0ba612724119ffab16dcc"
17
+ api_token="sk-mira-9eebf90946b4ff710580cafd1c651517e3decd07bd810402",
18
18
  )
19
19
 
20
20
 
21
21
  @pytest.mark.asyncio
22
22
  async def test_list_models(client):
23
23
  result = await client.list_models()
24
- assert isinstance(result, list)
25
- # assert len(result) > 0
24
+ assert isinstance(result, dict)
25
+ assert result.get("object") == "list"
26
+ assert isinstance(result.get("data"), list)
27
+ for model in result.get("data", []):
28
+ assert isinstance(model, dict)
29
+ assert "id" in model
30
+ assert "object" in model
31
+ assert model["object"] == "model"
26
32
 
27
33
 
28
34
  @pytest.mark.asyncio
@@ -31,9 +37,9 @@ async def test_generate(client):
31
37
  model="mira/llama3.1",
32
38
  messages=[Message(role="user", content="Hi Who are you!")],
33
39
  stream=False,
34
- model_provider=None
40
+ model_provider=None,
35
41
  )
36
-
42
+
37
43
  result = await client.generate(request)
38
44
  assert isinstance(result, str)
39
45
  assert len(result) > 0
@@ -45,9 +51,9 @@ async def test_generate_stream(client):
45
51
  model="mira/llama3.1",
46
52
  messages=[Message(role="user", content="Hi!")],
47
53
  stream=True,
48
- model_provider=None
54
+ model_provider=None,
49
55
  )
50
-
56
+
51
57
  stream = await client.generate(request)
52
58
  chunks = []
53
59
  async for chunk in stream:
@@ -64,14 +70,11 @@ async def test_list_flows(client):
64
70
  @pytest.mark.asyncio
65
71
  async def test_create_and_delete_flow(client):
66
72
  # Create flow
67
- request = FlowRequest(
68
- system_prompt="You are a helpful assistant",
69
- name="test_flow"
70
- )
71
-
73
+ request = FlowRequest(system_prompt="You are a helpful assistant", name="test_flow")
74
+
72
75
  flow = await client.create_flow(request)
73
76
  assert flow.get("name") == "test_flow"
74
-
77
+
75
78
  # Delete the created flow
76
79
  flow_id = flow.get("id")
77
80
  await client.delete_flow(flow_id)
@@ -98,7 +101,7 @@ async def test_error_handling(client):
98
101
  model="invalid_model",
99
102
  messages=[Message(role="user", content="Hi!")],
100
103
  stream=False,
101
- model_provider=None
104
+ model_provider=None,
102
105
  )
103
106
  await client.generate(request)
104
107