Skip to content

docs(genai): clarify standalone library usage and manual examples - #294

Merged
sipercai merged 2 commits into
mainfrom
liuyu/fix/genai-util-manual-docs
Oct 29, 2026
Merged

sipercai merged 2 commits into
mainfrom
liuyu/fix/genai-util-manual-docs

Conversation

@sipercai

@sipercai sipercai commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Manual rerank examples assigned unknown Python attributes, so document inputs, outputs, and counts could be silently omitted. Correct the field names and consistently construct Invocation objects before starting Handler lifecycles.

Present GenAI Utils as a standalone open-source library: the application installs the library and configures standard OpenTelemetry SDK providers/exporters before creating a Handler. Remove launcher, commercial-bridge, and platform-injection guidance from the usage flow; retain storage backends as optional extensions. Clarify existing content/event coverage, field mappings, context lifetimes, and troubleshooting, and expose the extended public API in the documentation.

This change is limited to four documentation files and preserves runtime code and telemetry field definitions.

Fixes # (N/A)

Type of change

  • This change requires a documentation update

How Has This Been Tested?

  • tox -e precommit with a fresh hook cache; all four hooks passed.
  • python -m sphinx -E -W -b html -C -D extensions=sphinx.ext.autodoc,sphinx.ext.napoleon -D autodoc_typehints=none -D root_doc=instrumentation-genai/util -D include_patterns=instrumentation-genai/util.rst docs /tmp/loongsuite-genai-api
  • Both READMEs parsed with docutils and rendered with readme_renderer.rst.render; embedded Python snippets passed syntax checks.
  • Executed the complete local example in fresh SPAN_ONLY and NO_CONTENT processes; verified parent/child IDs, typed document count, model/provider attributes, and document content visibility.
  • Confirmed the standalone example runs in an environment without the opentelemetry.instrumentation package.
  • API page build with the repository's autodoc defaults; private implementation inheritance is omitted from the public Handler documentation.
  • git diff --check

Validation used Python 3.14.8, OpenTelemetry SDK 1.45.1, and Sphinx 9.2.0.

Validation Evidence

  • Scope: exactly four documentation files; no source, test, dependency, workflow, or cassette changes.
  • Static readiness: passed; the no-changed-plugin warning is expected for this documentation-only change.
  • Reference comparison: N/A for implementation research; examples use the current util APIs and serializers.
  • Runtime regression matrix, fail-open/stream/concurrency tests, and backend ingestion checks: N/A because no instrumentation or telemetry behavior changed. The local example checks documentation correctness only.
  • VCR privacy scan: N/A because no recordings or fixtures changed.
  • CI: the previous head reported Google GenAI latest interaction-test failures (response.id remained a MagicMock after model_copy()). Those source/test files are unchanged by this documentation PR; updated-head checks will rerun.

Does This PR Require a Core Repo Change?

  • Yes. - Link to PR:
  • No.

Checklist:

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added (N/A: documentation-only change)
  • Documentation has been updated

@sipercai sipercai changed the title docs(genai): fix and clarify manual instrumentation examples docs(genai): clarify standalone library usage and manual examples Oct 29, 2026
@sipercai
sipercai merged commit 20a781d into main Oct 29, 2026
272 of 278 checks passed
@sipercai
sipercai deleted the liuyu/fix/genai-util-manual-docs branch October 29, 2026 11:46
pylaterreur added a commit to pylaterreur/loongsuite-python that referenced this pull request Oct 30, 2026
alibaba#294 added extended_types to the API docs. Napoleon reads the first
line of an attribute docstring written as "Name: text" as "type:
description", so the "Streaming:" prefix of
InvokeAgentInvocation.monotonic_first_token_s became a py:class
reference to "Streaming". Nitpicky mode reports it and -W makes it an
error, so the docs job fails on every pull request since alibaba#294. Reword
the docstring.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GwUvhmzgfkiZ6vo4uGyesN
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.

3 participants