Install
python -m pip install iagenifyA model session
import os
from iagenify import IaGenify
with IaGenify(api_key=os.environ["IAGENIFY_API_KEY"]) as api:
assistant = api.models.create(
model="gemini-3.5-flash",
settings={"instructions": "Answer in French, in at most three sentences."},
)
result = assistant.generate(
inputs=[{"type": "text", "content": "Résume ce contrat."}]
)
print(result["outputs"])
print(result["usage"]["credits"])The Python spelling
| JavaScript SDK | Python SDK |
|---|---|
| new IaGenify({ apiKey }) | IaGenify(api_key=...) |
| await api.models.create({ model }) | api.models.create(model=...) |
| await assistant.generate({ inputs }) | assistant.generate(inputs=...) |
| api.getUser() | api.get_user() |
| api.getStorage() | api.get_storage() |
| onText | on_text |
| onPermission | on_permission |
| maxSteps | max_steps |
Resources
Der Python-Client stellt auth, keys, models, memory, files, storage, cloud, search, fetch, convert, agents, workflows, domains, mail, hosts, compute, MCP und brand bereit. Siehe die Ressourcenreferenz für Python.
Where it runs
Use it in Python scripts, notebooks, CLI tools, or backend applications such as Flask, Django, and FastAPI. The client is synchronous. In async handlers, call it in a worker thread. It is not a React-style UI library, and IaGenify Hosts currently deploys static sites and edge JavaScript modules rather than persistent Python servers.
SDK feature parity
Das Python-Paket enthält synchrone Ressourcen-Clients und einen nativen lokalen Python-Agenten: dauerhafte, im Konto gespeicherte Sitzungen, Bildeingaben, Rücksprungpunkte und Zurückspulen, MCP-Einbindung, eigene Tools, Skills und Delegation an Subagenten, Tools für Shell, Speicher, Dokumente und Workflows, Erzeugung von Bildern, Videos, Sprache und Musik, agent.queue(), um während der Arbeit zu schreiben, und die Dienst-Tools der JavaScript-Engine: deploy, mail, send_mail (HTML, BCC und Anhänge), domain, cloud, document, generate, brand, iagenify_docs und mcp. Die Berechtigungen folgen den JavaScript-Regeln: Senden, Veröffentlichen und Ausgeben von Credits werden bei jedem Aufruf erfragt, in jedem Modus. Eine mit memory gestartete Sitzung lässt sich auf einem anderen Rechner aus dem Konto wieder öffnen, nur als Text. Python schätzt die Kontextgröße für Bereinigung und Komprimierung; das Kontextfenster des Modells liest es aus dem Katalog, wenn verfügbar. Jede Anleitungsseite hat bei ihren Codeblöcken einen Umschalter JavaScript / Python.
Errors
from iagenify import IaGenifyError, NotEnoughCredits
try:
answer = assistant.generate(inputs=[{"type": "text", "content": "Hello"}])
except NotEnoughCredits as error:
print(error.required, error.available)
except IaGenifyError as error:
print(error.status, error.code, error.details)