Skip to main content

Python SDK for Mobius agent loops and workers

Project description

deepnoodle-mobius

Python SDK for Mobius agent sessions, loops, and workers.

Multi-tool agent quickstart

import os
import deepnoodle.mobius as mobius

client = mobius.Client(mobius.ClientOptions(
    api_key=os.environ["MOBIUS_API_KEY"],
    project=os.environ["MOBIUS_PROJECT"],
))

try:
    turn = client.invoke_agent(mobius.InvokeAgentOptions(
        agent_name="launch-scout",
        idempotency_key=inbound_message_id,
        content=[{"type": "text", "text": "Check the name and create a shortlist."}],
        config=mobius.InlineAgentConfig(toolkits=[
            mobius.InlineToolkit(name="naming", actions=["naming.domain.check"]),
            mobius.InlineToolkit(name="shortlists", actions=["shortlists.create"]),
        ]),
    ))
    for update in turn.updates():
        for message in update.transcript.renderable_messages():
            print(mobius.text_of(message))
            for block in message["content"]:
                if block.get("type") == "tool_use":
                    tool = mobius.normalize_tool_use(block)
                    print((tool.resolved_action or {}).get("name", tool.wire_name))
    if turn.error:
        raise turn.error
except mobius.MobiusAPIError as error:
    if error.code == "session_turn_active":
        # Choose explicitly: wait and invoke again, or client.nudge_session(...).
        pass
    else:
        raise

Use messages() for the lossless protocol view and renderable_messages() for UI. normalize_tool_use() preserves the model-facing wire fields and prefers Mobius' persisted canonical action identity. The cross-language helper guide covers nudges, reconnection, diagnostics, session management, persistence ordering, and the server-to-browser boundary.

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

deepnoodle_mobius-0.0.50.tar.gz (95.4 kB view details)

Uploaded Source

Built Distribution

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

deepnoodle_mobius-0.0.50-py3-none-any.whl (101.1 kB view details)

Uploaded Python 3

File details

Details for the file deepnoodle_mobius-0.0.50.tar.gz.

File metadata

  • Download URL: deepnoodle_mobius-0.0.50.tar.gz
  • Upload date:
  • Size: 95.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for deepnoodle_mobius-0.0.50.tar.gz
Algorithm Hash digest
SHA256 ef2555b9ebccb8d9315963eb6866d15202737daefc5e204f1a8d47cfb7a0219d
MD5 6e7f6c6ad3a0bed34ce03f946d91cb2b
BLAKE2b-256 126facc5b905e7733e1d7b7d9959d1254d1d65d430155993b0cba5bfb9577072

See more details on using hashes here.

Provenance

The following attestation bundles were made for deepnoodle_mobius-0.0.50.tar.gz:

Publisher: release-pypi.yml on deepnoodle-ai/mobius

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file deepnoodle_mobius-0.0.50-py3-none-any.whl.

File metadata

File hashes

Hashes for deepnoodle_mobius-0.0.50-py3-none-any.whl
Algorithm Hash digest
SHA256 1b336b29e7983e572a408774a776ef6f7a4ede09e6e77613c91730754dadb291
MD5 411b16d9796b9eb47c031b5bae0059e2
BLAKE2b-256 1edf71edcf1b7f6dce4212c4848b0f64e207d9a96678c22cb4807bf2187ddd86

See more details on using hashes here.

Provenance

The following attestation bundles were made for deepnoodle_mobius-0.0.50-py3-none-any.whl:

Publisher: release-pypi.yml on deepnoodle-ai/mobius

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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