Skip to content

docs: add native SDK usage example (#1365) - #2447

Closed
DoubleCore wants to merge 3 commits into
oceanbase:masterfrom
DoubleCore:issue-1365-native-sdk-doc
Closed

DoubleCore wants to merge 3 commits into
oceanbase:masterfrom
DoubleCore:issue-1365-native-sdk-doc

Conversation

@DoubleCore

Copy link
Copy Markdown

Resolves #1365

@CLAassistant

CLAassistant commented Nov 3, 2026 •

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ DoubleCore
❌ Picodet
You have signed the CLA already but the status is still pending? Let us recheck it.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-03T11:17:41.783765Z a3d68be PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a3d68be324

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +61 to +62
uv run python -m examples.openai_sdk.chat
uv run python -m examples.openai_sdk.chat --seed

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Require a source checkout before running the example modules

If a reader follows step 1's uv tool install path from outside a repository checkout, these commands fail with ModuleNotFoundError: No module named 'examples'. The wheel only packages src/powercontext and src/powercontext_service_bootstrap (pyproject.toml:209-210), not examples/, and uv help run states that outside a project it uses “the environment of the discovered interpreter,” not the isolated tool environment. Add an explicit checkout, cd, and uv sync prerequisite before this step in both locale guides.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This still reproduces at dec3b4dd: running the Anthropic example from outside a checkout fails with ModuleNotFoundError because the examples are not included in the installed wheel. Could you add the clone, cd, and dependency setup steps to both language guides before the example commands?

@hidb4ai hidb4ai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI preflight is failing on the new documentation files, so the downstream tests and docs checks did not run. Please fix the formatting failure and rerun the checks.

Comment thread docs/en/docs/develop/native-sdk.md Outdated
- [API Quick Start](api-quickstart.md): capture a Source and write Memory with the HTTP API.
- [Interfaces](interfaces.md): compare the Python Client, HTTP API, and Core SDK.
- [HTTP behavior](http-api.md): authentication, request IDs, errors, and concurrency.
- [Python Agent frameworks](../integrations/index.md#python-agent-frameworks): adapters that own the model loop. No newline at end of file

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is missing its final newline. The end-of-file-fixer hook fails CI preflight here and on docs/zh/docs/develop/native-sdk.md and both examples/anthropic_sdk/README files. Please run the hook and commit its fixes so the downstream checks can run.

@DoubleCore

Copy link
Copy Markdown
Author

Thanks — fixed the \ ix end of files\ preflight failure (trailing newline normalisation on the new docs/examples) and reran the checks. All preflight hooks now pass; downstream jobs are running.

@DoubleCore

Copy link
Copy Markdown
Author

Added the explicit clone + cd + uv sync prerequisite to both the English and Chinese guides: the example modules live in the repository, not in the published wheel, so they must be run from a checkout (step 1's uv tool install only installs the Server/CLI). Also re-verified the trailing-newline formatting on the touched files.

@DoubleCore

Copy link
Copy Markdown
Author

Scope clarification (self-review): issue #1365 was already closed as completed by #2010 (OpenAI Python SDK example, merged 2026-10-15), so this PR must not be read as delivering that issue.

What remains unique here is the Anthropic SDK half, which #2010 does not cover: examples/anthropic_sdk/ (chat.py, __init__.py, bilingual READMEs), tests/examples/anthropic_sdk/test_anthropic_sdk_example.py, and the native-sdk.md pages.

The examples/openai_sdk/* and api-quickstart edits in this branch are overlapping with the merged #2010 and I'm happy to drop them and rebase onto current master so the diff is Anthropic-only. If the Anthropic example isn't wanted either, just say so and I'll close this PR — I don't want it sitting here implying it completes an issue that's already done.

@AlexStocks AlexStocks added the 1.5.1 v1.5.1 release tracking label Nov 4, 2026

@hidb4ai hidb4ai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The checkout prerequisites and newline issues are addressed. The example modules start from a synced checkout, and the offline example tests pass. The current GitHub Actions run still requires action and has not run its jobs.

@DoubleCore

Copy link
Copy Markdown
Author

Closing this PR: the upstream issues it implements are both closed and already landed.

Keeping this open would only add review load on an already-resolved scope. Thanks to the maintainers for the review bandwidth.

@DoubleCore DoubleCore closed this Nov 4, 2026
@DoubleCore
DoubleCore deleted the issue-1365-native-sdk-doc branch November 7, 2026 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1.5.1 v1.5.1 release tracking

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Doc: example to use this repo via native SDK

5 participants