Skip to content

Commit dc020fd

Browse files
authored
docs(python/callbacks): refresh BigQuery callback page for shipped API (#3809)
Refreshes [`/oss/python/integrations/callbacks/google_bigquery`](https://docs.langchain.com/oss/python/integrations/callbacks/google_bigquery) so it matches the ``BigQueryCallbackHandler`` API as it actually shipped in [langchain-ai/langchain-google#1721](langchain-ai/langchain-google#1721) and [langchain-ai/langchain-google#1740](langchain-ai/langchain-google#1740). Mirrors the README in the upstream package. ## Why Following along the published Python BigQuery callback page today drops users into stale APIs: - Event names: `GRAPH_START`/`GRAPH_END`/`GRAPH_ERROR` and `NODE_STARTING`/`NODE_COMPLETED`/`NODE_ERROR` (renamed to `INVOCATION_*` and `AGENT_*` in #1721 to match Google ADK's `BigQueryAgentAnalyticsPlugin`). - Default table: `agent_events_v2` (renamed to `agent_events` in #1740). - Six new `BigQueryLoggerConfig` options shipped in #1721 (`custom_tags`, `log_session_metadata`, `content_formatter`, `auto_schema_upgrade`, `create_views`, `view_prefix`) plus `skip_internal_chain_events` — none of which appeared on the page. - Auto-created `v_*` analytics views, sub-agent attribution, `flush()`, `model_version` / `usage_metadata` / `cache_metadata` / `llm_config` / `tools` enrichment — all ADK-parity features missing from the page. - One stale `USER_MESSAGE_RECEIVED` reference (an ADK-only event the LangChain handler doesn't emit). ## What changed | Section | Change | |---|---| | **Key features** | Rewritten to call out auto-views, auto schema upgrade, sub-agent attribution, rich LLM telemetry, `skip_internal_chain_events`, and `flush()`. | | **Use with LangGraph agent** | Code sample updated: drops the explicit `table_id="agent_events_v2"` (now the default), shows `custom_tags`, demonstrates `flush(timeout=5.0)` between requests. | | **Configuration options** | Extended with the 7 new options. `table_id` default updated to `agent_events`. | | **NEW: Auto-created analytics views** | Lists each `v_*` view and the typed columns it exposes. | | **NEW: Auto schema upgrade** | Documents the additive `ALTER TABLE ADD COLUMN` behavior gated by the `langchain_bq_schema_version` table label. | | **NEW: Sub-agent attribution** | Documents the `agent → langgraph_node → checkpoint_ns → graph_name` fallback chain. | | **Event types and payloads** | LLM_RESPONSE attributes now mention `usage`, `model_version`, `usage_metadata`, `cache_metadata`. LLM_REQUEST mentions `llm_config` + `tools`. New AGENT_* / INVOCATION_* table. Tool usage table fixed to show the actual `{tool, input/result}` JSON shape. | | **Advanced SQL examples** | Sweep stale event names. Sessionize-conversation view fixed (no more `USER_MESSAGE_RECEIVED`). Tool-name path fixed (`$.tool` not `$.tool_name` in content). | | **LangGraph integration** | Event-type table updated to `AGENT_*` / `INVOCATION_*`. Code sample uses the renamed events. | Total: **172 insertions, 53 deletions** in one file. Net 25 stale tokens swept (`GRAPH_*`, `NODE_*`, `agent_events_v2`, `USER_MESSAGE_RECEIVED`). ## Test plan - [x] Page renders as valid MDX (no broken frontmatter, code fences, or tables). - [x] All `JSON_VALUE` paths in the SQL examples match the actual JSON shape the handler emits (verified against `_build_content` in `bigquery_callback.py`). - [x] All `event_type` literals in code/SQL examples are types the handler actually emits. - [x] Zero remaining stale references (`grep -cE "GRAPH_(START|END|ERROR)|NODE_(STARTING|COMPLETED|ERROR)|agent_events_v2|USER_MESSAGE_RECEIVED"` returns 0).
1 parent 481397c commit dc020fd

1 file changed

Lines changed: 205 additions & 66 deletions

File tree

0 commit comments

Comments
 (0)