Skip to content

Python: [Feature]: Python: nace.ai Drex decision models: document TypeSafeChatClient(base_url=) or add an agent-framework-nace connector with image input #9716

Description

@saruar-dev

Problem

agent_framework_typesafe.TypeSafeChatClient (python/packages/typesafe/agent_framework_typesafe/_chat_client.py) is written for TypeSafe's System One API. nace.ai's Drex models speak the same POST /v1/systemone request and response at https://console.nace.ai, so TypeSafeChatClient(base_url="https://console.nace.ai", model="drex-max") should work for text. I have not verified that yet (the client goes through typesafe_sdk.AsyncTypeSafeClient, which may add Jev-specific headers), and nothing in the package or its README says whether another System One server is supported. Images are the larger gap: drex-max reads images as a top-level images array, while the client serializes only text, function calls and function results into state.messages, and #9411 (still open) adds images in Jev's assets shape, which Drex does not accept.

Use Case and Evidence

A screenshot or scanned-page question inside an agent loop ("which of these form types is this?", "does this page show an error?") answered with calibrated per-answer probabilities instead of generated text. The TypeSafeChatOptions question shapes (choice / noul / score) are what Drex takes; the differences are the images array, string-only choice criteria values and no box question.

Desired Outcome

Either (a) a documented, tested statement in python/packages/typesafe/README.md that base_url= plus model= is a supported way to reach other System One servers, Drex included, text only; or (b) a python/packages/nace/ subpackage (agent-framework-nace, NaceChatClient) per docs/decisions/0008-python-subpackages.md, reusing the typesafe client's option parsing and adding the images array for Content parts of type data/uri with an image media type, with unit tests on mocked HTTP and a sample. I'd prefer (b) because of the images and would start with (a) if you'd rather keep one System One client.

Alternatives Considered

Subclassing RawTypeSafeChatClient in user code: works for text, duplicates the question/answer mapping for images. Waiting for #9411: it targets Jev's assets map, which is not the Drex wire shape, so an adapter is still needed.

Proposed Direction

(b) above as a plain httpx2 client with no typesafe_sdk dependency, NACE_API_KEY / NACE_BASE_URL settings, and the same ChatOptions surface as TypeSafeChatOptions.

Scope and Non-Goals

No behavior change to the typesafe package; no box question; no streaming (System One does not stream). .NET is out of scope for this issue.

Language

Python

Contribution Intent

I am willing to implement this

Acknowledgements

  • I searched existing issues and did not find a duplicate.
  • I will wait for explicit maintainer agreement before starting implementation of a non-trivial change.

AI assistance disclosure (per AI_CONTRIBUTIONS.md): this issue was drafted with Claude Code, which also checked the file paths and PR references against main.

Disclosure: I work at nace.ai, which serves Drex Max. Docs: https://console.nace.ai/docs/drex/guides/drex-max

🤖 Generated with Claude Code

Activity

  1. added
    pythonUsage: [Issues, PRs], Target: Python
    triageUsage: [Issues], Target: All issues that still need to be triaged
    on Oct 26, 2026
  2. changed the title [-][Feature]: Python: nace.ai Drex decision models: document TypeSafeChatClient(base_url=) or add an agent-framework-nace connector with image input[/-] [+]Python: [Feature]: Python: nace.ai Drex decision models: document TypeSafeChatClient(base_url=) or add an agent-framework-nace connector with image input[/+] on Oct 26, 2026
  3. removed
    triageUsage: [Issues], Target: All issues that still need to be triaged
    on Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

pythonUsage: [Issues, PRs], Target: Python

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions