{"library":"metal-sdk","title":"Metal Python SDK","description":"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.","language":"python","status":"active","last_verified":"Thu Apr 16","install":{"commands":["pip install metal-sdk"],"cli":{"name":"metal","version":"sh: 1: metal: not found"}},"imports":["from metal_sdk.metal import Metal"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import os\nfrom metal_sdk.metal import Metal\n\n# It's recommended to load credentials from environment variables\napi_key = os.environ.get('METAL_API_KEY', 'your_api_key_here')\nclient_id = os.environ.get('METAL_CLIENT_ID', 'your_client_id_here')\nindex_id = os.environ.get('METAL_INDEX_ID', 'your_index_id_here')\n\nif not all([api_key, client_id, index_id]):\n    print(\"Warning: API_KEY, CLIENT_ID, or INDEX_ID are missing. Please set environment variables or replace placeholders.\")\n    exit(1)\n\nmetal = Metal(api_key, client_id, index_id)\n\ntry:\n    # Example: Indexing a document\n    response = metal.index({\"text\": \"The quick brown fox jumps over the lazy dog.\"})\n    print(f\"Document indexed successfully. ID: {response['data']['id']}\")\n\n    # Example: Searching for documents\n    search_results = metal.search(text=\"quick fox\", limit=1)\n    if search_results and search_results['data']:\n        print(f\"Search result: {search_results['data'][0]['text']}\")\n    else:\n        print(\"No search results found.\")\n\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")","lang":"python","description":"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.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}