vendor_fabric.meshy.base¶
Base HTTP client - auth, retries, rate limiting.
This module handles ALL the HTTP infrastructure. API modules import this.
Uses InputProvider for credential loading, consistent with other vendor-fabric integrations. Credentials can come from:
Environment variables (MESHY_API_KEY)
Direct parameters
stdin JSON input
Module Contents¶
Functions¶
Configure Meshy API credentials. |
|
Get API key from InputProvider (env vars, direct inputs, or stdin). |
|
Get or create HTTP client. |
|
Close the HTTP client. |
|
Return a public, redacted Meshy task failure message. |
|
Return a public, redacted unexpected-response diagnostic. |
|
Extract a non-empty Meshy task id from a create/refine response. |
|
Validate a Meshy task payload and return a promoted public mapping. |
|
Make HTTP request with retries and rate limiting. |
|
Download file from URL. |
Data¶
API¶
- exception vendor_fabric.meshy.base.RateLimitError¶
Bases:
ExceptionRaised when API rate limit is hit.
Initialization
Initialize self. See help(type(self)) for accurate signature.
- add_note()¶
- class args¶
- with_traceback()¶
- exception vendor_fabric.meshy.base.MeshyAPIError(message: str, status_code: int | None = None)¶
Bases:
ExceptionRaised when API returns an error.
Initialization
Initialize self. See help(type(self)) for accurate signature.
- add_note()¶
- class args¶
- with_traceback()¶
- vendor_fabric.meshy.base.BASE_URL = 'https://api.meshy.ai'¶
- vendor_fabric.meshy.base.configure(api_key: str | None = None, **kwargs: Any) None¶
Configure Meshy API credentials.
Args: api_key: Meshy API key (overrides environment variable) **kwargs: Additional inputs to merge
- vendor_fabric.meshy.base.get_api_key() str¶
Get API key from InputProvider (env vars, direct inputs, or stdin).
- vendor_fabric.meshy.base.get_client() httpx.Client¶
Get or create HTTP client.
- vendor_fabric.meshy.base.close() None¶
Close the HTTP client.
- vendor_fabric.meshy.base.task_failure_message(error: Any) str¶
Return a public, redacted Meshy task failure message.
- vendor_fabric.meshy.base.unexpected_response_message(data: Any) str¶
Return a public, redacted unexpected-response diagnostic.
- vendor_fabric.meshy.base.task_id_from_response(response: httpx.Response) extended_data.containers.ExtendedString¶
Extract a non-empty Meshy task id from a create/refine response.
- vendor_fabric.meshy.base.task_payload_from_response(response: httpx.Response, model_type: type[pydantic.BaseModel], endpoint: str) extended_data.containers.ExtendedDict¶
Validate a Meshy task payload and return a promoted public mapping.
- vendor_fabric.meshy.base.request(method: str, endpoint: str, *, version: str = 'v2', **kwargs: Any) httpx.Response¶
Make HTTP request with retries and rate limiting.
Args: method: HTTP method (GET, POST, etc.) endpoint: API endpoint (e.g., “text-to-3d”) version: API version (v1 or v2) **kwargs: Passed to httpx.request (json, params, etc.)
Returns: httpx.Response
Raises: RateLimitError: On 429 (will retry) MeshyAPIError: On other API errors
- vendor_fabric.meshy.base.download(url: str, output_path: str) int¶
Download file from URL.
Args: url: URL to download from output_path: Local path to save to
Returns: File size in bytes