meshapi 0.1.7__tar.gz → 0.1.8__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.
- {meshapi-0.1.7 → meshapi-0.1.8}/PKG-INFO +1 -1
- {meshapi-0.1.7 → meshapi-0.1.8}/meshapi/__init__.py +1 -15
- {meshapi-0.1.7 → meshapi-0.1.8}/meshapi/_http.py +1 -1
- {meshapi-0.1.7 → meshapi-0.1.8}/meshapi/_types.py +0 -52
- {meshapi-0.1.7 → meshapi-0.1.8}/pyproject.toml +1 -1
- meshapi-0.1.7/meshapi/resources/documents.py +0 -60
- {meshapi-0.1.7 → meshapi-0.1.8}/.gitignore +0 -0
- {meshapi-0.1.7 → meshapi-0.1.8}/CHANGELOG.md +0 -0
- {meshapi-0.1.7 → meshapi-0.1.8}/CLAUDE.md +0 -0
- {meshapi-0.1.7 → meshapi-0.1.8}/README.md +0 -0
- {meshapi-0.1.7 → meshapi-0.1.8}/TESTING.md +0 -0
- {meshapi-0.1.7 → meshapi-0.1.8}/livetests/.env.livetest.example +0 -0
- {meshapi-0.1.7 → meshapi-0.1.8}/livetests/compare.py +0 -0
- {meshapi-0.1.7 → meshapi-0.1.8}/livetests/config.py +0 -0
- {meshapi-0.1.7 → meshapi-0.1.8}/livetests/conftest.py +0 -0
- {meshapi-0.1.7 → meshapi-0.1.8}/livetests/pytest.ini +0 -0
- {meshapi-0.1.7 → meshapi-0.1.8}/livetests/requirements.txt +0 -0
- {meshapi-0.1.7 → meshapi-0.1.8}/livetests/responses.py +0 -0
- {meshapi-0.1.7 → meshapi-0.1.8}/livetests/test_audio.py +0 -0
- {meshapi-0.1.7 → meshapi-0.1.8}/livetests/test_chat.py +0 -0
- {meshapi-0.1.7 → meshapi-0.1.8}/livetests/test_compare.py +0 -0
- {meshapi-0.1.7 → meshapi-0.1.8}/livetests/test_errors.py +0 -0
- {meshapi-0.1.7 → meshapi-0.1.8}/livetests/test_feature_matrix.py +0 -0
- {meshapi-0.1.7 → meshapi-0.1.8}/livetests/test_images_edit.py +0 -0
- {meshapi-0.1.7 → meshapi-0.1.8}/livetests/test_inference_resources.py +0 -0
- {meshapi-0.1.7 → meshapi-0.1.8}/livetests/test_models.py +0 -0
- {meshapi-0.1.7 → meshapi-0.1.8}/livetests/test_moderations.py +0 -0
- {meshapi-0.1.7 → meshapi-0.1.8}/livetests/test_rag.py +0 -0
- {meshapi-0.1.7 → meshapi-0.1.8}/livetests/test_realtime.py +0 -0
- {meshapi-0.1.7 → meshapi-0.1.8}/livetests/test_responses.py +0 -0
- {meshapi-0.1.7 → meshapi-0.1.8}/livetests/test_router_select.py +0 -0
- {meshapi-0.1.7 → meshapi-0.1.8}/livetests/test_stream.py +0 -0
- {meshapi-0.1.7 → meshapi-0.1.8}/livetests/test_structured_output.py +0 -0
- {meshapi-0.1.7 → meshapi-0.1.8}/livetests/test_templates.py +0 -0
- {meshapi-0.1.7 → meshapi-0.1.8}/livetests/test_tool_calling.py +0 -0
- {meshapi-0.1.7 → meshapi-0.1.8}/livetests/test_video.py +0 -0
- {meshapi-0.1.7 → meshapi-0.1.8}/livetests/test_web_search.py +0 -0
- {meshapi-0.1.7 → meshapi-0.1.8}/meshapi/_errors.py +0 -0
- {meshapi-0.1.7 → meshapi-0.1.8}/meshapi/resources/__init__.py +0 -0
- {meshapi-0.1.7 → meshapi-0.1.8}/meshapi/resources/audio.py +0 -0
- {meshapi-0.1.7 → meshapi-0.1.8}/meshapi/resources/batches.py +0 -0
- {meshapi-0.1.7 → meshapi-0.1.8}/meshapi/resources/chat.py +0 -0
- {meshapi-0.1.7 → meshapi-0.1.8}/meshapi/resources/compare.py +0 -0
- {meshapi-0.1.7 → meshapi-0.1.8}/meshapi/resources/embeddings.py +0 -0
- {meshapi-0.1.7 → meshapi-0.1.8}/meshapi/resources/images.py +0 -0
- {meshapi-0.1.7 → meshapi-0.1.8}/meshapi/resources/models.py +0 -0
- {meshapi-0.1.7 → meshapi-0.1.8}/meshapi/resources/moderations.py +0 -0
- {meshapi-0.1.7 → meshapi-0.1.8}/meshapi/resources/rag.py +0 -0
- {meshapi-0.1.7 → meshapi-0.1.8}/meshapi/resources/realtime.py +0 -0
- {meshapi-0.1.7 → meshapi-0.1.8}/meshapi/resources/responses.py +0 -0
- {meshapi-0.1.7 → meshapi-0.1.8}/meshapi/resources/router_select.py +0 -0
- {meshapi-0.1.7 → meshapi-0.1.8}/meshapi/resources/templates.py +0 -0
- {meshapi-0.1.7 → meshapi-0.1.8}/meshapi/resources/videos.py +0 -0
- {meshapi-0.1.7 → meshapi-0.1.8}/meshapi/resources/web_search.py +0 -0
|
@@ -23,10 +23,6 @@ from ._types import (
|
|
|
23
23
|
BulkEmbedResponse,
|
|
24
24
|
BulkEmbedResult,
|
|
25
25
|
ChatCompletionChunk,
|
|
26
|
-
DocumentListResponse,
|
|
27
|
-
DocumentResponse,
|
|
28
|
-
GenerateDocumentRequest,
|
|
29
|
-
ListDocumentsParams,
|
|
30
26
|
ChatCompletionChunkChoice,
|
|
31
27
|
ChatCompletionChunkDelta,
|
|
32
28
|
ChatCompletionChoice,
|
|
@@ -122,7 +118,6 @@ from ._types import (
|
|
|
122
118
|
UsageInfo,
|
|
123
119
|
)
|
|
124
120
|
from .resources.audio import AsyncAudioResource, AudioResource
|
|
125
|
-
from .resources.documents import AsyncDocumentsResource, DocumentsResource
|
|
126
121
|
from .resources.videos import AsyncVideosResource, VideosResource
|
|
127
122
|
from .resources.batches import AsyncBatchesResource, BatchesResource
|
|
128
123
|
from .resources.chat import AsyncChatResource, ChatResource
|
|
@@ -145,7 +140,7 @@ from .resources.realtime import (
|
|
|
145
140
|
from .resources.responses import AsyncResponsesResource, ResponsesResource
|
|
146
141
|
from .resources.templates import AsyncTemplatesResource, TemplatesResource
|
|
147
142
|
|
|
148
|
-
__version__ = "0.1.
|
|
143
|
+
__version__ = "0.1.8"
|
|
149
144
|
__all__ = [
|
|
150
145
|
"__version__",
|
|
151
146
|
"MeshAPI",
|
|
@@ -287,13 +282,6 @@ __all__ = [
|
|
|
287
282
|
"ListVoicesParams",
|
|
288
283
|
"Voice",
|
|
289
284
|
"VoicesResponse",
|
|
290
|
-
# Documents
|
|
291
|
-
"DocumentsResource",
|
|
292
|
-
"AsyncDocumentsResource",
|
|
293
|
-
"GenerateDocumentRequest",
|
|
294
|
-
"ListDocumentsParams",
|
|
295
|
-
"DocumentResponse",
|
|
296
|
-
"DocumentListResponse",
|
|
297
285
|
]
|
|
298
286
|
|
|
299
287
|
|
|
@@ -343,7 +331,6 @@ class MeshAPI:
|
|
|
343
331
|
self.templates = TemplatesResource(http)
|
|
344
332
|
self.images = ImagesResource(http)
|
|
345
333
|
self.videos = VideosResource(http)
|
|
346
|
-
self.documents = DocumentsResource(http)
|
|
347
334
|
self.audio = AudioResource(http)
|
|
348
335
|
self.rag = RagResource(http)
|
|
349
336
|
self.moderations = ModerationsResource(http)
|
|
@@ -407,7 +394,6 @@ class AsyncMeshAPI:
|
|
|
407
394
|
self.templates = AsyncTemplatesResource(http)
|
|
408
395
|
self.images = AsyncImagesResource(http)
|
|
409
396
|
self.videos = AsyncVideosResource(http)
|
|
410
|
-
self.documents = AsyncDocumentsResource(http)
|
|
411
397
|
self.audio = AsyncAudioResource(http)
|
|
412
398
|
self.rag = AsyncRagResource(http)
|
|
413
399
|
self.moderations = AsyncModerationsResource(http)
|
|
@@ -1319,55 +1319,3 @@ class ImageEditParams(BaseModel):
|
|
|
1319
1319
|
mask_feather: Optional[int] = None
|
|
1320
1320
|
|
|
1321
1321
|
|
|
1322
|
-
# ---------------------------------------------------------------------------
|
|
1323
|
-
# Documents — GET /v1/documents, POST /v1/documents/generate,
|
|
1324
|
-
# GET /v1/documents/{document_id}
|
|
1325
|
-
# ---------------------------------------------------------------------------
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
class GenerateDocumentRequest(BaseModel):
|
|
1329
|
-
"""Request body for POST /v1/documents/generate."""
|
|
1330
|
-
|
|
1331
|
-
model_config = ConfigDict(extra="ignore")
|
|
1332
|
-
|
|
1333
|
-
format: Literal["pdf", "docx", "pptx", "csv", "xlsx"]
|
|
1334
|
-
prompt: str
|
|
1335
|
-
model: Optional[str] = None
|
|
1336
|
-
metadata: Optional[Dict[str, Any]] = None
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
class ListDocumentsParams(BaseModel):
|
|
1340
|
-
"""Query params for GET /v1/documents."""
|
|
1341
|
-
|
|
1342
|
-
model_config = ConfigDict(extra="ignore")
|
|
1343
|
-
|
|
1344
|
-
limit: Optional[int] = Field(default=None, ge=1, le=200)
|
|
1345
|
-
offset: Optional[int] = Field(default=None, ge=0)
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
class DocumentResponse(BaseModel):
|
|
1349
|
-
model_config = ConfigDict(extra="ignore")
|
|
1350
|
-
|
|
1351
|
-
document_id: str
|
|
1352
|
-
status: str
|
|
1353
|
-
format: str
|
|
1354
|
-
model: str
|
|
1355
|
-
title: Optional[str] = None
|
|
1356
|
-
download_url: Optional[str] = None
|
|
1357
|
-
expires_at: Optional[str] = None
|
|
1358
|
-
size_bytes: Optional[int] = None
|
|
1359
|
-
prompt_tokens: Optional[int] = None
|
|
1360
|
-
completion_tokens: Optional[int] = None
|
|
1361
|
-
total_tokens: Optional[int] = None
|
|
1362
|
-
failure_reason: Optional[str] = None
|
|
1363
|
-
created_at: Optional[str] = None
|
|
1364
|
-
updated_at: Optional[str] = None
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
class DocumentListResponse(BaseModel):
|
|
1368
|
-
model_config = ConfigDict(extra="ignore")
|
|
1369
|
-
|
|
1370
|
-
documents: List[DocumentResponse]
|
|
1371
|
-
total: int
|
|
1372
|
-
limit: int
|
|
1373
|
-
offset: int
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
"""Documents resource — /v1/documents endpoints."""
|
|
2
|
-
|
|
3
|
-
from __future__ import annotations
|
|
4
|
-
|
|
5
|
-
from typing import Optional
|
|
6
|
-
from urllib.parse import quote
|
|
7
|
-
|
|
8
|
-
from .._http import AsyncHttpClient, SyncHttpClient
|
|
9
|
-
from .._types import (
|
|
10
|
-
DocumentListResponse,
|
|
11
|
-
DocumentResponse,
|
|
12
|
-
GenerateDocumentRequest,
|
|
13
|
-
ListDocumentsParams,
|
|
14
|
-
)
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
class DocumentsResource:
|
|
18
|
-
def __init__(self, http: SyncHttpClient) -> None:
|
|
19
|
-
self._http = http
|
|
20
|
-
|
|
21
|
-
def generate(self, params: GenerateDocumentRequest) -> DocumentResponse:
|
|
22
|
-
"""POST /v1/documents/generate — generate a document."""
|
|
23
|
-
data = self._http.post("/v1/documents/generate", params.model_dump(exclude_none=True))
|
|
24
|
-
return DocumentResponse.model_validate(data)
|
|
25
|
-
|
|
26
|
-
def list(self, params: Optional[ListDocumentsParams] = None) -> DocumentListResponse:
|
|
27
|
-
"""GET /v1/documents — list documents."""
|
|
28
|
-
query = None
|
|
29
|
-
if params is not None:
|
|
30
|
-
query = {k: str(v) for k, v in params.model_dump(exclude_none=True).items()} or None
|
|
31
|
-
data = self._http.get("/v1/documents", params=query)
|
|
32
|
-
return DocumentListResponse.model_validate(data)
|
|
33
|
-
|
|
34
|
-
def retrieve(self, document_id: str) -> DocumentResponse:
|
|
35
|
-
"""GET /v1/documents/{document_id} — get a document."""
|
|
36
|
-
data = self._http.get(f"/v1/documents/{quote(document_id, safe='')}")
|
|
37
|
-
return DocumentResponse.model_validate(data)
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
class AsyncDocumentsResource:
|
|
41
|
-
def __init__(self, http: AsyncHttpClient) -> None:
|
|
42
|
-
self._http = http
|
|
43
|
-
|
|
44
|
-
async def generate(self, params: GenerateDocumentRequest) -> DocumentResponse:
|
|
45
|
-
"""POST /v1/documents/generate — generate a document."""
|
|
46
|
-
data = await self._http.post("/v1/documents/generate", params.model_dump(exclude_none=True))
|
|
47
|
-
return DocumentResponse.model_validate(data)
|
|
48
|
-
|
|
49
|
-
async def list(self, params: Optional[ListDocumentsParams] = None) -> DocumentListResponse:
|
|
50
|
-
"""GET /v1/documents — list documents."""
|
|
51
|
-
query = None
|
|
52
|
-
if params is not None:
|
|
53
|
-
query = {k: str(v) for k, v in params.model_dump(exclude_none=True).items()} or None
|
|
54
|
-
data = await self._http.get("/v1/documents", params=query)
|
|
55
|
-
return DocumentListResponse.model_validate(data)
|
|
56
|
-
|
|
57
|
-
async def retrieve(self, document_id: str) -> DocumentResponse:
|
|
58
|
-
"""GET /v1/documents/{document_id} — get a document."""
|
|
59
|
-
data = await self._http.get(f"/v1/documents/{quote(document_id, safe='')}")
|
|
60
|
-
return DocumentResponse.model_validate(data)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|