Skip to content

Added the Python Client for Anton#3

Closed
MinuraPunchihewa wants to merge 6 commits into
mainfrom
feature/anton_client
Closed

Added the Python Client for Anton#3
MinuraPunchihewa wants to merge 6 commits into
mainfrom
feature/anton_client

Conversation

@MinuraPunchihewa

@MinuraPunchihewa MinuraPunchihewa commented Feb 26, 2026

Copy link
Copy Markdown
Contributor

This PR adds a client module for Anton. This enables Anton to be called easily via other Python applications (like the Minds API) while maintaining certain session specific parameters such as message history and scratchpad manager.

This also enables custom tools to be defined for Anton. This was mainly done with the intention of passing through a tool that will allow Anton to query data sources in Minds (via MindsDB).

import asyncio

from anton import Anton

anton = Anton()

asyncio.run(anton.chat("Hi"))
# OR
def stream(prompt: str):
  async for event in anton.chat_stream(prompt):
    print(event)

asyncio.run(stream("Hi"))

@ianu82
ianu82 requested a review from torrmal February 26, 2026 12:57
@tino097
tino097 deleted the feature/anton_client branch April 7, 2026 09:56
alecantu7 added a commit that referenced this pull request Jul 10, 2026
…path (ENG-673)

Self-review of the 3-PR stack surfaced four issues; fixing them here (anton
side):

- #1 (was a real regression): truncation detection raised whenever a stream
  ended with no finish_reason/stop_reason — but many OpenAI-compatible endpoints
  simply don't report one, so a COMPLETE, good answer was being discarded and
  turned into an error (and would fail every turn for such a provider). Now only
  the truly-empty case (no content AND no tool_calls) is treated as truncated;
  a content-bearing stream without a terminal marker is logged and passed
  through.
- #3: user-stop DURING backoff re-raised the TransientProviderError, surfacing a
  provider-error card instead of a clean cancellation. Now it breaks cleanly
  (like a normal stop).
- #4: ProviderOverloadedError always named the planning model even when the
  CODING model was the one that failed. TransientProviderError now carries the
  in-flight `model` (threaded through classify_transient + both providers' raise
  sites); the card names the actual failing model, falling back to planning.

Tests updated for the new clean-cancel semantics + 2 new (model propagation,
failing-model-not-planning). Full suite green (bar the 2 pre-existing
environmental scratchpad failures).

(#2 — an overstated "graceful degradation" claim — corrected in the PR #246
description, no code change.)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
alecantu7 added a commit that referenced this pull request Jul 16, 2026
…path (ENG-673)

Self-review of the 3-PR stack surfaced four issues; fixing them here (anton
side):

- #1 (was a real regression): truncation detection raised whenever a stream
  ended with no finish_reason/stop_reason — but many OpenAI-compatible endpoints
  simply don't report one, so a COMPLETE, good answer was being discarded and
  turned into an error (and would fail every turn for such a provider). Now only
  the truly-empty case (no content AND no tool_calls) is treated as truncated;
  a content-bearing stream without a terminal marker is logged and passed
  through.
- #3: user-stop DURING backoff re-raised the TransientProviderError, surfacing a
  provider-error card instead of a clean cancellation. Now it breaks cleanly
  (like a normal stop).
- #4: ProviderOverloadedError always named the planning model even when the
  CODING model was the one that failed. TransientProviderError now carries the
  in-flight `model` (threaded through classify_transient + both providers' raise
  sites); the card names the actual failing model, falling back to planning.

Tests updated for the new clean-cancel semantics + 2 new (model propagation,
failing-model-not-planning). Full suite green (bar the 2 pre-existing
environmental scratchpad failures).

(#2 — an overstated "graceful degradation" claim — corrected in the PR #246
description, no code change.)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants