metal-sdk is the official Python SDK for getmetal.io, a managed service for ML Embeddings and an AI-first datastore & retrieval engine. It allows developers to easily integrate Metal's capabilities, such as semantic search and building AI-powered applications, into their Python projects. The current version is 2.5.1, released on November 10, 2023, with the broader Metal platform actively maintained and updated.
pip install metal-sdkVerified import paths — ran on the pinned version, not inferred.
Initializes the Metal client using API credentials and demonstrates how to index a simple text document and perform a basic search. It's crucial to replace placeholder credentials or set them as environment variables.
Ensure `METAL_API_KEY`, `METAL_CLIENT_ID`, and `METAL_INDEX_ID` environment variables are correctly set, or that the values passed during `Metal` initialization are accurate and valid. Verify permissions for the provided API key.
Always ensure you are importing `from metal_sdk.metal import Metal` and that `pip install metal-sdk` was used. Consult documentation specific to getmetal.io when troubleshooting.
Implement retry logic with exponential backoff for rate limit errors. For endpoints like `/v1/indexes/:id/documents`, utilize the `page` and `limit` query parameters, or `lastObjectIdSeen` for deep pagination, as described in the Metal API documentation.
Double-check your `METAL_API_KEY` and `METAL_CLIENT_ID`. Regenerate them in the Metal dashboard if unsure, and ensure they are correctly set as environment variables or passed to the `Metal` constructor.
Verify that the `METAL_INDEX_ID` is correct and corresponds to an existing index in your Metal account. Ensure the API key has permissions to interact with that specific index.
Ensure you are accessing attributes/keys of the API response correctly (e.g., `response['data']` instead of `response()`). When indexing, verify that the input dictionary for methods like `index()` matches the expected schema, typically `{'text': 'your_text_here'}` for simple cases.