macore-client-dev 0.1.71__tar.gz → 0.1.72__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.
- {macore_client_dev-0.1.71 → macore_client_dev-0.1.72}/PKG-INFO +1 -1
- {macore_client_dev-0.1.71 → macore_client_dev-0.1.72}/macore_client/__about__.py +1 -1
- {macore_client_dev-0.1.71 → macore_client_dev-0.1.72}/macore_client/client.py +27 -0
- {macore_client_dev-0.1.71 → macore_client_dev-0.1.72}/.gitignore +0 -0
- {macore_client_dev-0.1.71 → macore_client_dev-0.1.72}/macore_client/__init__.py +0 -0
- {macore_client_dev-0.1.71 → macore_client_dev-0.1.72}/macore_client/cli.py +0 -0
- {macore_client_dev-0.1.71 → macore_client_dev-0.1.72}/macore_client/live_check.py +0 -0
- {macore_client_dev-0.1.71 → macore_client_dev-0.1.72}/pyproject.toml +0 -0
|
@@ -32,6 +32,8 @@ COMMANDS: tuple[str, ...] = (
|
|
|
32
32
|
"count_vectorization_tokens",
|
|
33
33
|
"vectorize",
|
|
34
34
|
"openai_models",
|
|
35
|
+
"model_pricing_get",
|
|
36
|
+
"provider_balance_get",
|
|
35
37
|
"health",
|
|
36
38
|
"model_health",
|
|
37
39
|
"model_providers",
|
|
@@ -148,6 +150,29 @@ class MacClient:
|
|
|
148
150
|
"""Return the raw OpenAI model list with the added capability marker (no parameters)."""
|
|
149
151
|
return await self.call("openai_models")
|
|
150
152
|
|
|
153
|
+
async def model_pricing_get(
|
|
154
|
+
self,
|
|
155
|
+
provider_id: str | None = None,
|
|
156
|
+
model_id: str | None = None,
|
|
157
|
+
tier: str | None = None,
|
|
158
|
+
page: int | None = None,
|
|
159
|
+
page_size: int | None = None,
|
|
160
|
+
) -> Any:
|
|
161
|
+
"""Return normalised model prices (USD per 1M tokens); omitted parameters are not sent."""
|
|
162
|
+
given = {"provider_id": provider_id, "model_id": model_id, "tier": tier, "page": page, "page_size": page_size}
|
|
163
|
+
return await self.call("model_pricing_get", {k: v for k, v in given.items() if v is not None})
|
|
164
|
+
|
|
165
|
+
async def provider_balance_get(
|
|
166
|
+
self,
|
|
167
|
+
provider_id: str | None = None,
|
|
168
|
+
period: str | None = None,
|
|
169
|
+
include_rate: bool | None = None,
|
|
170
|
+
refresh: bool | None = None,
|
|
171
|
+
) -> Any:
|
|
172
|
+
"""Return balance, spend and rate records of the provider accounts; omitted parameters are not sent."""
|
|
173
|
+
given = {"provider_id": provider_id, "period": period, "include_rate": include_rate, "refresh": refresh}
|
|
174
|
+
return await self.call("provider_balance_get", {k: v for k, v in given.items() if v is not None})
|
|
175
|
+
|
|
151
176
|
async def vectorize(
|
|
152
177
|
self,
|
|
153
178
|
text: str | list[str],
|
|
@@ -196,6 +221,8 @@ for _command in COMMANDS:
|
|
|
196
221
|
"vectorize",
|
|
197
222
|
"count_vectorization_tokens",
|
|
198
223
|
"openai_models",
|
|
224
|
+
"model_pricing_get",
|
|
225
|
+
"provider_balance_get",
|
|
199
226
|
}:
|
|
200
227
|
continue
|
|
201
228
|
setattr(MacClient, _command, _make_method(_command))
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|