Skip to main content

SDK oficial de Python para la API de Meteor — infraestructura agéntica como servicio.

Project description

meteor-ia — SDK oficial de Python para Meteor

Infraestructura agéntica como servicio. Ejecutá tus Mets, gestioná el CRM, integraciones MCP y más, por código.

Server-side only: tu API key met_* es secreta. Nunca la expongas en el browser.

Instalación

pip install meteor-ia

Sin dependencias de runtime (solo la stdlib).

Uso

import os
from meteor_ia import Met

met = Met(os.environ["MET_API_KEY"], workspace_id=7)

# Ejecutar un Met y esperar el resultado
run = met.runs.create("Resume los leads de hoy", met="ventas")
print(run["output"])
print(run["energy"])  # breakdown de Energía del run

# Streaming de eventos
for event, data in met.runs.stream("Hola"):
    print(event, data)

# CRM
for contact in met.contacts.iterate():
    print(contact["id"], contact.get("name"))

Manejo de errores

from meteor_ia import MetRateLimitError, MetAuthError

try:
    met.runs.create("...")
except MetRateLimitError as e:
    print("esperá", e.retry_after, "segundos")
except MetAuthError:
    print("key inválida")

Jerarquía: MetErrorMetAuthError (401), MetInvalidRequestError (400/403/404/409), MetRateLimitError (429, con retry_after), MetAgentError (el Met falló), MetApiError (5xx).

Webhooks salientes (Meteor → tu servidor)

Verificá la firma HMAC de cada entrega antes de procesarla:

from meteor_ia import construct_event, MetSignatureVerificationError

# En tu handler HTTP (Flask/FastAPI/…):
try:
    event = construct_event(raw_body, signature_header, os.environ["MET_WEBHOOK_SECRET"])
except MetSignatureVerificationError:
    return ("bad signature", 400)

if event["type"] == "run.completed":
    ...

Partners

Con una key de partner (partner:*):

met.partner.clients.list()
met.partner.commissions.list(status="PAID")
met.partner.payouts.summary()

Auto-paginación

Los endpoints de lista devuelven { "data": [...], "has_more": bool }. Usá .iterate() para recorrer todo transparentemente (cursor opaco starting_after).

Reintentos

429 y 5xx se reintentan con backoff exponencial (default 2 intentos, respeta Retry-After). Los POST llevan Idempotency-Key automático para no duplicar.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

meteor_ia-0.1.0.tar.gz (19.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

meteor_ia-0.1.0-py3-none-any.whl (18.8 kB view details)

Uploaded Python 3

File details

Details for the file meteor_ia-0.1.0.tar.gz.

File metadata

  • Download URL: meteor_ia-0.1.0.tar.gz
  • Upload date:
  • Size: 19.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for meteor_ia-0.1.0.tar.gz
Algorithm Hash digest
SHA256 54c38282d13655aa541cf35e28c1e1bc8c1df8f904d4c67fc005532c72d63b1d
MD5 2451b68e8536e6ceabbe3ad30d61e82c
BLAKE2b-256 7c82ce32cbf4b7d7a9531a4ccdf397126d0cad4a4a58981ca2fd4c46e0a80b02

See more details on using hashes here.

File details

Details for the file meteor_ia-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: meteor_ia-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 18.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for meteor_ia-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d6c33f012c9159ff22c1154433f48358ab7b53faf12f85c6b040b3caac3728c3
MD5 a0f7b8921e83efaa3104804813893be8
BLAKE2b-256 7dba39f657e3375741c6e4b215019267831e6fd07fdb48d4033a7b895df1be94

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page