Skip to main content

SDK oficial de OniPin — protocolo /v1 para IAs y apps (Python)

Project description

onipin (Python)

SDK oficial de OniPin — protocolo onipin/0.2.

Mismo contrato que onipin-js: discover → handshake → chat → poll messages.

PyPI: https://pypi.org/project/onipin/
OpenAPI: https://onnivers.store/v1/openapi.yaml

Instalación

pip install onipin

Solo usa la biblioteca estándar (sin dependencias).

Inicio rápido

from onipin import OniPinClient

oni = OniPinClient(
    pin="onp_tu_pin",
    agent={"name": "MiAgente", "version": "1.0"},
)

oni.handshake("business.chat")
chat = oni.chat("Hola, ¿qué servicios ofrecen?", intent="business.chat")
print(chat.get("reply", {}).get("text") if chat.get("reply") else chat)

# Si reply es null (dueño en modo humano):
# page = oni.poll_messages(timeout_ms=120_000)

API

Método Descripción
ping() Discovery GET /v1/ping/:pin
discover_from_url(url) GET /v1/discover?url=
handshake(intent?, agent?) Handshake 0.2
catalog() Catálogo público
chat(message, …) Chat; guarda conversation_id
messages(…) Poll de mensajes
poll_messages(…) Poll hasta bot/owner o timeout
create_booking(**fields) Reserva
create_order(**fields) Pedido
reset() Nueva conversación local

Integraciones

  • LangChain / LlamaIndex: ver examples/langchain_tool.py (tool HTTP)
  • n8n / Zapier / Power Automate: HTTP Request a https://onnivers.store/v1/... — ver examples/n8n_http.md
  • MCP (Cursor/Claude): https://onnivers.store/mcp (sin Python)

Conformance

# Desde PyPI (venv limpio) contra producción
npm run smoke:sdk:py

# O con el checkout del monorepo
python packages/onipin-py/examples/prod_smoke.py

Licencia

MIT — Empresa Tecnológica de Colombia / OnniVers

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

onipin-0.2.2.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

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

onipin-0.2.2-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file onipin-0.2.2.tar.gz.

File metadata

  • Download URL: onipin-0.2.2.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for onipin-0.2.2.tar.gz
Algorithm Hash digest
SHA256 8f0101f32f9d4724e16b05f07cc4e793d66bdf9b7036148bc4b181e12dfc6b80
MD5 beaa2beffb601b21ed4627f93c7e7af5
BLAKE2b-256 2a521d8f39c8452f814d6b0df37031788db876d9c93f8796e033ac5c48f31f7e

See more details on using hashes here.

File details

Details for the file onipin-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: onipin-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for onipin-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 695780f5c2d14a80e2fbc42c01425c172623003246b39638a09514af894249bb
MD5 38cc0e77f18d725120fc52ea3d7d6e97
BLAKE2b-256 510fca4da2c654ecdd5099caf92523aec747fe8a293cfedb4f00bc39365bc571

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