docs(integrations): add AI SDK C++ integration page - #2943
Conversation
Documents the new `ai::langfuse` tracing module added in ClickHouse/ai-sdk-cpp#42, which wraps `ai::Client::generate_text` calls and emits Langfuse traces for the LLM round-trip and each tool invocation. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Langfuse-Session: https://cloud.langfuse.com/project/cloramnkj0002jz088vzn1ja4/sessions/0513d864-5246-4f7c-ae5c-e95d55feb120
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@claude review |
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
- Close `<Steps>` before the Tracer configuration / Trace API reference sections so they no longer render as numbered walkthrough steps. - Guard `result.text` access in the Trace API snippet so users copying it do not access an unset field on failure. - Add Japan and HIPAA cloud regions to the LANGFUSE_HOST comment block to match the convention used on other integration pages. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Langfuse-Session: https://cloud.langfuse.com/project/cloramnkj0002jz088vzn1ja4/sessions/0513d864-5246-4f7c-ae5c-e95d55feb120
There was a problem hiding this comment.
All prior review feedback (Steps tag balance, reference sections outside Steps, error-guarded Trace API snippet, JP/HIPAA host regions) has been addressed in 67cef13.
Extended reasoning...
Overview
This is a docs-only PR adding a new integration page at content/integrations/frameworks/ai-sdk-cpp.mdx, registering its slug in content/integrations/frameworks/meta.json, and adding a ClickHouse SVG logo under public/images/integrations/. No application code, no build config, no runtime behavior is touched.
Security risks
None. The change is a static MDX page plus an SVG. The SVG was inspected — it contains only standard <svg>/<rect>/<path> elements with no <script>, <foreignObject>, or event handlers. The page references public URLs only (langfuse.com domains, GitHub).
Level of scrutiny
Low. This is a new, isolated documentation page that follows the established pattern of other entries in frameworks/ (e.g. koog.mdx, vercel-ai-sdk.mdx). The only correctness concerns were docs-rendering issues (Steps tag structure, region coverage, unsafe sample snippet) — all of which were raised by greptile and prior claude[bot] reviews and have now been resolved in commit 67cef13.
Other factors
Verified the current state of the file directly: <Steps> opens at line 25 and closes exactly once at line 126, with ## Tracer configuration and ## Trace API correctly outside the Steps block. The Trace API example (lines 158-162) now guards result.text access with if (result). The LANGFUSE_HOST comment block (lines 55-60) now lists all four regions plus self-host. The meta.json insertion preserves alphabetical ordering. No outstanding reviewer comments remain unaddressed.
There was a problem hiding this comment.
Docs-only addition for a new AI SDK C++ integration page; all prior review feedback (Steps boundary, error guard, cloud regions) has been incorporated.
Extended reasoning...
Overview
This PR adds a new docs page content/integrations/frameworks/ai-sdk-cpp.mdx for the AI SDK C++ Langfuse tracing module, registers its slug in content/integrations/frameworks/meta.json, and adds a ClickHouse SVG icon as the page logo. No application code is touched.
Security risks
None. The diff is markdown/MDX content, a JSON index entry, and a static SVG asset. The MDX page only documents env-var usage (placeholders, not real credentials) and external links to ClickHouse and Langfuse — no executed code, no auth/permission surface affected.
Level of scrutiny
Low — this is a content-only change to the docs site. The only build-time risk was an MDX parse error from unbalanced <Steps> tags, which was flagged on an earlier revision and has now been fixed (current file has exactly one <Steps> opener and one </Steps> closer, with reference sections correctly outside the Steps block).
Other factors
All prior feedback from greptile and my earlier reviews has been incorporated: the result.text access in the Trace API snippet is now guarded by if (result), the LANGFUSE_HOST comment now lists all four cloud regions (EU/US/JP/HIPAA), and the </Steps> placement is correct. No outstanding comments remain.
Summary
ai::langfusetracing module added in ClickHouse/ai-sdk-cpp#42.generate_textexample, theConfigfields, and the documented MVP limitations.meta.jsonand adds a ClickHouse icon underpublic/images/integrations/for the page logo (the SDK is maintained by ClickHouse).Test plan
pnpm devand verify the page renders at/integrations/frameworks/ai-sdk-cpp/integrations🤖 Generated with Claude Code
Greptile Summary
This PR adds a new documentation page for the AI SDK C++ integration with Langfuse, covering CMake setup, credential configuration, an end-to-end
generate_textexample, theConfigreference table, and theTraceAPI. The ClickHouse icon and themeta.jsonentry are also added correctly.result.textbehindif (result), but the shorter "Trace API" snippet accessesresult.textunconditionally — users who copy the snippet verbatim could ship code that silently produces wrong output or crashes on LLM errors.<Steps>component, so they render as numbered setup steps rather than reference material; moving them outside</Steps>would fix the visual structure.Confidence Score: 3/5
Safe to merge after addressing the incomplete error-handling pattern in the Trace API code snippet, which could lead users to write crash-prone code.
The Trace API section's code snippet calls
result.textwithout first checking whether the generate call succeeded — a pattern the very next section of the same page explicitly guards against. Documentation that ships unsafe example code is likely to be copy-pasted directly by users. The<Steps>structure issue is cosmetic but affects how readers interpret the reference material.content/integrations/frameworks/ai-sdk-cpp.mdx — the Trace API snippet and the Steps boundary both need attention.
Prompt To Fix All With AI
Reviews (1): Last reviewed commit: "docs(integrations): add AI SDK C++ integ..." | Re-trigger Greptile