NIA One · Docs
Intégration SDK

Référence API

Les symboles publics, les variables d'environnement et le contrat HTTP. Pour la référence exhaustive (taxonomie complète, configs d'assets typées), voyez les READMEs du SDK.

Initialiser le client

from niaone_sdk import NiaoneSDKclient = NiaoneSDK(api_key="sk_...", base_url="https://api.niaone.example")# ou zéro-config depuis l'environnementclient = NiaoneSDK.from_env()# ou désactivé (no-op, ne casse jamais votre code)client = NiaoneSDK.disabled()

Symboles publics principaux

from niaone_sdk import (  NiaoneSDK,  start_flow, end_flow, start_step, end_step,   # cycle de vie  flow, step, async_flow, async_step,           # context managers  instrument,                                    # décorateur  payload, metric, log, score,                   # émission de données  trace_llm_call, submit_feedback,               # helpers  resume_flow,                                    # propagation distribuée)from niaone_sdk.models import Asset, Flow, Branch, Data, JudgeRef, ScoreDetailsfrom niaone_sdk.enums import (  RecordType, AssetKind, AssetRole, FlowPhase, SpanKind,  DataRole, DataKind, DataFormat, StandardMetric,)

« instrument », pas « flow_step »

Le décorateur/HOF d'auto-step s'appelle instrument. Il n'existe pas de flow_step.

Variables d'environnement

VariableRôleDéfaut
NIAONE_API_KEYClé API (sinon SDK no-op)
NIAONE_BASE_URLEndpoint de l'intakehttps://api.niaone.com
NIAONE_TENANT_IDScope multi-tenant
NIAONE_DISABLED1 → client no-op
NIAONE_SAFE_MODE1 → erreurs vers on_error
NIAONE_SERVICE_NAMEIdentité (logique) pour le heartbeat
NIAONE_INSTANCE_IDIdentité physique de l’instancehostname:pid
NIAONE_HEARTBEAT_INTERVALIntervalle heartbeat (s)30
NIAONE_HEARTBEAT_DISABLEDtrue → stoppe le heartbeat
NIAONE_DISABLE_ENV_DETECTIONtrue → désactive l'introspection runtime
NIAONE_REGIONForce la région du SIA (sinon inférée)
NIAONE_EXTRA_AI_FRAMEWORKSFrameworks IA custom (CSV logical:pkg)
NIAONE_EXTRA_DB_CLIENTSClients DB custom (CSV logical:pkg)
NIAONE_EXTRA_VECTOR_STORESVector stores custom (CSV logical:pkg)

Endpoints HTTP de l'Intake (appelés par le SDK)

MéthodeRouteAuth
POST/v1/intake/batchBearer clé API
POST/v1/intake/recordBearer clé API
POST/v1/intake/validateBearer clé API
GET/v1/intake/healthaucune
GET/v1/intake/capabilitiesaucune

Aller plus loin

Les READMEs du SDK couvrent la taxonomie complète (tous les enums), les configurations d'assets typées (LLM, embedding, vector store, guardrail, cache, prompt), le sampling, le scrubbing PII et le modèle asynchrone :

  • Python : sdk/python/README.md
  • TypeScript : sdk/typescript/README.md

On this page