Oda SDK: Python

The Oda Python SDK lets a Python program drive DataMind Oda as a subprocess: your program starts a bundled Oda runtime and talks to it over newline-delimited JSON-RPC on standard input and output. Use it when a script or an internal tool of yours should drive Oda from outside the app.

The family starts with the Oda SDK overview; this page covers the packages, the profiles and a first run. The result fields and the error families are in the Oda SDK: Python reference.

Install the packages

The Python side of the SDK is two packages, installed together: the SDK package (the client, which starts the bundled runtime for you and drives runs through it) and the runtime package (the bundled Oda runtime for one platform, with its supporting files). The SDK package declares the runtime package as a dependency, so an install brings the wheel that matches your operating system and processor, and the two share one version.

SystemRuntime wheel
Linux, x64 and arm64Yes
macOS, x64 and arm64Yes, on macOS 14 or later
Windows, x64Yes
Windows on ArmNo

A system with no published runtime is refused rather than served by another system's build.

These packages are independent of the DataMind Oda desktop app; Install and sign in covers the app itself.

Run your first task

  1. Choose the folders. Pass an explicit home folder: every launch requires one, and the SDK never silently falls back to a default home folder. The runtime keeps the profile it runs and the sessions it creates there (Oda's home folder and settings files). Pass the folder the agent should work in as the working folder (cwd); it defaults to the folder your program runs in and is resolved to an absolute path before the runtime starts.
  2. Create the client. Construct it with the home folder, the working folder and the profile you want. The client starts the bundled runtime as a subprocess when it is first needed, and reuses it for later runs; you never start the runtime by hand.
  3. Run a prompt. Call run() with your prompt, and optionally a session id to name the session. The call returns when the session goes idle; read the final response and the finish reason from the result.
  4. Close when you are done. Closing stops the runtime in stages, from a shutdown request to a forced end, and it is safe to call again; a context manager closes it for you when the block ends.

Choose a profile

Options and defaults

SettingDefaultWhat it does
Home folderrequiredThe folder the runtime keeps its profile and sessions in; every launch needs one and the SDK never falls back to a default.
cwdyour program's folderThe folder the agent works in; resolved to an absolute path before launch.
runtime_cwdcwdThe folder the runtime process itself starts in.
provider, modelbuilt-in default routeThe model route the runtime resolves before it accepts a prompt; a route it cannot serve fails the start-up instead of falling back.
reasoning_effortmodel defaultOmit it and the model's own default applies.
max_tokensnoneCaps the output of each request; helpers that run in the same process inherit the cap.
base_url, api_keyyour environmentOverride the service address and key the runtime starts with; without them the runtime inherits your program's environment, so credentials already set there keep working.
profilesdkThe profile the bundled runtime runs.
patchesnonePatch files applied in order; the paths are absolute and the later file wins.
initialize_timeout_seconds30How long the start-up handshake may take before the client gives up.
shutdown_timeout_seconds1How long the shutdown request may take before the client moves on.
request_timeout_secondsnoneWith no value, a run waits indefinitely, because a turn can legitimately run long.

Change capabilities with patches

yaml
- id: skill-office
  disabled: true

Questions, answered

Which packages do I install?

Two, installed together: the SDK package (the client) and the runtime package for your operating system and processor. The SDK package brings the matching runtime wheel with it, and the two share one version.

Which Python versions are supported?

Python 3.10 or later. Both wheels install on Python 3.10 and newer.

Do I need Node.js installed?

No. The bundled runtime ships inside the runtime wheel, so using the SDK requires no system Node.js, and nothing extra is downloaded or compiled at install time.

Which systems have a runtime wheel?

Linux x64 and arm64, macOS x64 and arm64 on macOS 14 or later, and Windows x64. Windows on Arm has no wheel, and a system with no published runtime is refused rather than served by another system's build.

Why does every launch need a home folder?

So nothing is found or written silently. The SDK never falls back to a default home folder: you pass one at every launch, and the runtime keeps the profile it runs and the sessions it creates there. A launch without one is refused, and the error says an explicit home is required.

Where do the sessions live?

Under the home folder you pass, as plain JSON lines, one record per line.

Which profile should I start with?

sdk, the default: it serves SDK clients with the usual tool set. Choose sdk-minimal for exactly a small runtime with one persistent shell tool; Automation clients describes what it includes and leaves out. A profile you build yourself must keep a JSON-RPC server row, or it cannot serve an SDK client.

What happens if start-up takes too long?

The start-up handshake is bounded: the client gives it 30 seconds (initialize_timeout_seconds), and a start-up timeout names the selected profile and carries the runtime's recent error output. Ordinary runs are unbounded unless you set request_timeout_seconds, because a turn can legitimately run long.

Do patch changes need a rebuild?

No. Patches apply when the runtime process starts, so a change, even to skills and other resources, takes effect at the next start; there is no rebuild step.

Can I turn the Office document features off?

Yes. Disable the Office skill in a patch, or point it at a replacement resource folder through its assetRoot; the change takes effect at the next start. A skill you keep on the filesystem still overrides a bundled skill with the same name.

What model does the SDK use if I do not name one?

The client sends its built-in default route unless you pass a provider and model. The runtime resolves the exact route before it accepts a prompt, and a route it cannot serve fails the start-up instead of falling back to a default.