Align with modernized TS SDK: hosted-gateway default, OTARI_AI_TOKEN, logo#1
Open
khaledosman wants to merge 2 commits into
Open
Align with modernized TS SDK: hosted-gateway default, OTARI_AI_TOKEN, logo#1khaledosman wants to merge 2 commits into
khaledosman wants to merge 2 commits into
Conversation
Mirrors the otari-sdk-ts changes for consistency across SDKs: - Add the otari logo (seal + wordmark) to the README header - Note where to generate an API token and add a provider key on the hosted platform in the Platform Mode section - Clarify that a 404 can mean no provider key is configured, and that the exception message carries the gateway's detail Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Brings the Python SDK to parity with the modernized otari-sdk-ts: - In platform mode, default api_base to https://api.otari.ai when none is given, so OtariClient(platform_token=...) works with no further setup. API-key (self-hosted) mode still requires an explicit base URL. - Read the canonical OTARI_AI_TOKEN env var for the platform token, keeping GATEWAY_PLATFORM_TOKEN as a legacy alias (canonical wins). - Rewrite the README to be hosted-first. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Brings the Python SDK in line with the modernized TypeScript SDK (otari-sdk-ts#8 + #9), so the SDKs behave and read consistently.
Behavioral changes
api_basenow defaults tohttps://api.otari.aiwhen none is supplied — soOtariClient(platform_token="tk_...")works with no further setup. API-key (self-hosted) mode still requires an explicit base URL.OTARI_AI_TOKENfor the platform token, keepingGATEWAY_PLATFORM_TOKENas a legacy alias (canonical wins when both are set). Base/key env vars remainGATEWAY_API_BASE/GATEWAY_API_KEY, matching the TS SDK.Docs
assets/otari-logo.svg) to the README header.OTARI_AI_TOKENand the hosted default.404can mean no provider key is configured for the requested provider, and the exception'smessagecarries the gateway's detail.Implementation note
No error-handling change was needed — the gateway's
{"detail": "..."}body already reaches the typed exception message (the OpenAI Python SDK embeds the body inAPIStatusError.message; the batch path extractsdetaildirectly). The fetch-wrapper fix in the TS PR was specific to the JS OpenAI SDK, which drops the body as"(no body)".Verification
pytest tests/→ all green (incl. 6 new hosted-default / env-precedence tests)ruff check src/ tests/→ cleanmypy src/→ cleanVerified end-to-end: a sample app completed a real request against the live hosted gateway (
https://api.otari.ai) using the hosted default.🤖 Generated with Claude Code