The Oda Python SDK

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 run Oda tasks from outside the app.

This page covers installation, a first run from the shipped example, the profiles and the settings you pass. The run results, the runtime's lifecycle, the wire surface and the error details are in the Python SDK reference.

Install the SDK

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 system, with its supporting files). The SDK package declares the runtime package as a dependency, so an install brings the package that matches your operating system and processor, and the two share one version.

Your first run

  1. Choose the folders. Pass the home folder: every launch needs one, and the SDK never falls back to a default home folder; the runtime keeps the profile it runs and the sessions it creates there. Pass the workspace folder the agent should work in; it is resolved to an absolute path before the runtime starts.
  2. Create the client. Construct it with the home folder, the workspace folder and the profile you want; the settings table below lists what else you can pass. 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. Pass the task text, and a session id if you want to name the session. The call returns when the session goes idle; read the final response from the result.
  4. Close when you are done. Closing stops the runtime; a context manager closes it for you when the block ends.

Start from the shipped example

The SDK package ships a runnable minimal example: it drives the sdk-minimal profile, runs one task and prints the agent's final response. These are the choices it takes:

What you passWhat it decides
The task textThe prompt for the run.
The workspace folderThe folder the agent works in.
The home folderWhere the runtime keeps its profile and sessions; the example stops without one, with a message that an explicit home is required.
The profileWhich profile to drive; it defaults to sdk-minimal.
The session idA name for the session; without one, the run gets its own.
The provider and modelThe model route; without them, the built-in route applies, and the runtime resolves it before the first prompt.
The token capOptional; caps the output of each request.

Profiles

Settings and defaults

These are the settings you pass when you create the client, with their defaults:

SettingDefaultWhat it does
Home folderrequiredWhere the runtime keeps its profile and sessions; every launch needs one and the SDK never falls back to a default.
Working folderyour program's folderThe folder the agent works in; resolved to an absolute path before launch.
Runtime folderthe working folderThe folder the runtime process itself starts in.
ProfilesdkThe profile the bundled runtime runs.
Patch filesnoneApplied in order after the profile's own layers; the later file wins.
Provider and modelthe built-in routeThe model route, resolved before the runtime accepts a prompt; a route it cannot serve fails the start instead of falling back.
Reasoning effortthe model's defaultHow long the model thinks before it answers; omit it for the model's own default.
Token capnoneCaps the output of each request.
Service address and keyyour environmentOverride the address and key the runtime starts with; without them the runtime inherits your program's environment, so credentials already set there keep working.
Start-up timeout30 secondsHow long the start-up handshake may take before the client gives up.
Shutdown timeout1 secondHow long the shutdown request may take before the client moves on.
Request timeoutnoneWith no value, a run waits for the task, however long it takes.

Patches, Office and skills

Questions, answered

How do I install the Python SDK?

Two packages, installed together: the SDK package (the client) and the runtime package for your operating system and processor. The SDK package brings the matching runtime package with it, and the two share one version. Both run on Python 3.10 or later.

Do I need a system Node.js?

No. The runtime ships prebuilt inside the runtime package, so using the SDK needs no system Node.js and no build step. Only a development source build needs a system Node.js, and that route is an explicit request.

What happens if I launch without a home folder?

The launch is refused: every launch needs an explicit home folder, and the SDK never falls back to a default one. The error says an explicit home is required.

Which profile should I use?

Start with sdk, the default: it answers SDK clients with the usual tool set. Choose sdk-minimal for exactly one persistent shell tool; Automation clients describes what it includes and leaves out. A profile you build must keep the part that answers SDK clients.

What does the shipped example do?

It drives the sdk-minimal profile, runs one task and prints the agent's final response. You give it the task, the workspace and home folders, the profile, a session id and the model route; without a home folder it stops with a message that an explicit home is required.

When do patch changes take effect?

At the runtime's next start. There is no rebuild step, even for skills and other resources.

Can I disable the Office document features?

Yes. Disable the Office skill in a patch, or point it at a replacement resource folder; 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 if the model I name cannot be served?

The start fails: the runtime resolves the route before it accepts a prompt, and a route it cannot serve does not fall back to a default. Name a provider and model this runtime can serve and start again.

Why can't my custom profile serve a client?

It is missing the part that answers SDK clients (the JSON-RPC server). Without it the profile cannot serve a client, and the problem surfaces when the runtime starts or the SDK initializes. Keep that part in the profile and try again.

Can I drive the web application with the SDK?

No. The web application is separate and is not a serving profile, so an SDK client cannot select it.