-
Notifications
You must be signed in to change notification settings - Fork 619
[Docs] Rename Chat API to Blockchain LLM and add transaction execution docs #7904
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Docs] Rename Chat API to Blockchain LLM and add transaction execution docs #7904
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
WalkthroughUpdated UI labels from "Chat API" to "Blockchain LLM"; added a Transaction Execution docs page; renamed NebulaTxData.chainId → chain_id and made value required; removed runtime JSON.parse for action data and shifted SSE payloads to structured objects; propagated chain_id across client and UI code. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant C as Client (Playground)
participant API as AI Chat API (/ai/chat)
participant W as Wallet/Auth
participant CH as Blockchain
rect rgb(240,248,255)
note over C,API: Prepare for Signing (auto_execute=false/omitted)
C->>API: POST /ai/chat {messages, context}
API-->>C: 200 OK {actions: [sign_transaction (prepared data)...], message, session_id, request_id}
end
rect rgb(245,255,240)
note over C,CH: Auto Execute (auto_execute=true)
C->>API: POST /ai/chat {messages, context{from, auto_execute_transaction:true, chain_ids...}}
API->>W: Validate auth (x-secret-key or Authorization)
API->>CH: Submit transaction(s)
CH-->>API: Tx result(s)
API-->>C: 200 OK {actions: [monitor_transaction{transaction_id}...], message, session_id, request_id}
alt auth error or execution failure
API-->>C: 4xx/5xx {error}
end
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~30 minutes Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. Warning Review ran into problems🔥 ProblemsErrors were encountered while retrieving linked issues. Errors (1)
✨ Finishing Touches
🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7904 +/- ##
=======================================
Coverage 56.53% 56.53%
=======================================
Files 904 904
Lines 58592 58592
Branches 4143 4143
=======================================
Hits 33126 33126
Misses 25360 25360
Partials 106 106
🚀 New features to boost your workflow:
|
size-limit report 📦
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
🧹 Nitpick comments (10)
apps/playground-web/src/app/navLinks.ts (1)
13-24: Avoid drift by centralizing the AI route/label.This label/href pair is duplicated across multiple files in this PR. Consider exporting a shared constant (e.g., AI_CHAT = { href: "/ai/chat", name: "Blockchain LLM" }) from a small routes module used by both portal and playground to keep labels in sync.
- links: [ - { - href: "/ai/chat", - label: "Blockchain LLM", - }, - ], + links: [ + { + href: AI_CHAT.href, + label: AI_CHAT.name, + }, + ],If helpful, I can draft a tiny shared routes file under apps/*/src/app/ai/routes.ts to house this.
apps/portal/src/app/Header.tsx (2)
144-158: Deduplicate AI menu source to prevent future inconsistencies.aiLinks is defined here, while similar labels/links live in other files (sidebar, homepage, playground). Consider centralizing in a shared nav config.
-const aiLinks = [ +import { AI_CHAT } from "../ai/routes"; // example shared module +const aiLinks = [ { - href: "/ai/chat", - name: "Blockchain LLM", + href: AI_CHAT.href, + name: AI_CHAT.name, },I can follow up with a small shared module PR if you want.
154-156: Inconsistent capitalization with “LLMs.txt”.Header uses “LLMs.txt” (capitalized), while apps/portal/src/app/ai/sidebar.tsx uses “llms.txt”. Standardize one variant sitewide.
- name: "LLMs.txt", + name: "llms.txt",Or update the sidebar to “LLMs.txt” instead.
apps/portal/src/app/ai/sidebar.tsx (1)
41-44: Standardize “llms.txt” label capitalization with Header menu.Header uses “LLMs.txt”; here it’s “llms.txt”. Pick one and apply everywhere.
- name: "llms.txt", + name: "LLMs.txt",apps/playground-web/src/app/ai/chat/page.tsx (1)
15-18: Metadata title updated to “Blockchain LLM - Playground” — OK.Consider typing Next.js metadata for clarity and editor hints.
-export const metadata = { +export const metadata: Metadata = { title: "Blockchain LLM - Playground", description: "Chat with thirdweb AI for blockchain interactions", };Add import at top of file:
import type { Metadata } from "next";apps/portal/src/app/ai/chat/page.mdx (1)
10-11: Align bullets with new execution docs by adding a direct linkSince you now support “Execute or prepare …” flows and added a dedicated Execution page, add a quick cross-link here to aid discovery.
Apply this diff near “Going further”:
### Going further -- [Handle streaming responses](/ai/chat/streaming) -- [Full API Reference](https://api.thirdweb.com/reference#tag/ai/post/ai/chat) +- [Handle streaming responses](/ai/chat/streaming) +- [Transaction Execution](/ai/chat/execution) +- [Full API Reference](https://api.thirdweb.com/reference#tag/ai/post/ai/chat)apps/portal/src/app/ai/chat/execution/page.mdx (4)
18-21: Tighten auth wording and fix article “a” → “an” before AuthorizationClarifies headers, fixes grammar, and adds explicit Bearer usage.
Apply this diff:
-- The API must be called with either: - - your `x-secret-key` header for server wallet authentication - - OR a `Authorization` header with a valid wallet JWT for user wallet authentication +- Call the API with either: + - `x-secret-key: <PROJECT_SECRET_KEY>` (server-side only) + - or `Authorization: Bearer <WALLET_JWT>` (user wallet) + +> Warning: Never expose `x-secret-key` in client-side code or browsers. Use it only from trusted server environments.
24-41: Example LGTM, minor suggestion: clarify empty actions on auto-executeFor auto-execute responses, consider a one-liner note that
actionswill typically be empty because the transaction was already submitted.You can append a short note after the example: “Note: In auto-execute mode, the actions array is often empty because the transaction has been submitted.”
49-49: Add a concrete “Prepare for Signing” example with a prepared actionShowing the shape of a prepared action reduces guesswork for integrators.
Apply this diff:
-<OpenApiEndpoint path="/ai/chat" method="POST" /> +<OpenApiEndpoint + path="/ai/chat" + method="POST" + requestBodyOverride={{ + "messages": [ + { "role": "user", "content": "Prepare a USDC transfer of 10 to vitalik.eth" } + ], + "context": { + "from": "0x...", + "auto_execute_transaction": false, + "chain_ids": [8453] + } + }} + responseExampleOverride={{ + "message": "Prepared a transaction for your review.", + "session_id": "123", + "request_id": "456", + "actions": [ + { + "type": "transaction", + "chain_id": 8453, + "to": "0x...", + "data": "0x...", + "value": "0x0", + "description": "USDC transfer to vitalik.eth (10 USDC)" + } + ] + }} +/>
14-17: Minor editorial cleanups
- Consider “(optional)” lowercase for consistency with your other docs.
- “chain IDs to execute the transaction on” could be “chain IDs to execute on” for brevity.
Would you like me to sweep adjacent AI docs for these micro-edits to keep tone/terminology consistent?
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (7)
apps/playground-web/src/app/ai/chat/page.tsx(1 hunks)apps/playground-web/src/app/navLinks.ts(1 hunks)apps/portal/src/app/Header.tsx(1 hunks)apps/portal/src/app/ai/chat/execution/page.mdx(1 hunks)apps/portal/src/app/ai/chat/page.mdx(1 hunks)apps/portal/src/app/ai/sidebar.tsx(2 hunks)apps/portal/src/app/page.tsx(1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.{ts,tsx}: Write idiomatic TypeScript with explicit function declarations and return types
Limit each file to one stateless, single-responsibility function for clarity
Re-use shared types from@/typesor localtypes.tsbarrels
Prefer type aliases over interface except for nominal shapes
Avoidanyandunknownunless unavoidable; narrow generics when possible
Choose composition over inheritance; leverage utility types (Partial,Pick, etc.)
Comment only ambiguous logic; avoid restating TypeScript in prose
Files:
apps/portal/src/app/page.tsxapps/playground-web/src/app/navLinks.tsapps/portal/src/app/ai/sidebar.tsxapps/playground-web/src/app/ai/chat/page.tsxapps/portal/src/app/Header.tsx
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (CLAUDE.md)
Load heavy dependencies inside async paths to keep initial bundle lean (lazy loading)
Files:
apps/portal/src/app/page.tsxapps/playground-web/src/app/navLinks.tsapps/portal/src/app/ai/sidebar.tsxapps/playground-web/src/app/ai/chat/page.tsxapps/portal/src/app/Header.tsx
apps/{dashboard,playground-web}/**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
apps/{dashboard,playground-web}/**/*.{ts,tsx}: Import UI primitives from@/components/ui/*(Button, Input, Select, Tabs, Card, Sidebar, Badge, Separator) in dashboard and playground apps
UseNavLinkfor internal navigation with automatic active states in dashboard and playground apps
Use Tailwind CSS only – no inline styles or CSS modules
Usecn()from@/lib/utilsfor conditional class logic
Use design system tokens (e.g.,bg-card,border-border,text-muted-foreground)
Server Components (Node edge): Start files withimport "server-only";
Client Components (browser): Begin files with'use client';
Always callgetAuthToken()to retrieve JWT from cookies on server side
UseAuthorization: Bearerheader – never embed tokens in URLs
Return typed results (e.g.,Project[],User[]) – avoidany
Wrap client-side data fetching calls in React Query (@tanstack/react-query)
Use descriptive, stablequeryKeysfor React Query cache hits
ConfigurestaleTime/cacheTimein React Query based on freshness (default ≥ 60s)
Keep tokens secret via internal API routes or server actions
Never importposthog-jsin server components
Files:
apps/playground-web/src/app/navLinks.tsapps/playground-web/src/app/ai/chat/page.tsx
🧠 Learnings (1)
📚 Learning: 2025-07-18T19:19:55.613Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to apps/{dashboard,playground-web}/**/*.{ts,tsx} : Use `NavLink` for internal navigation with automatic active states in dashboard and playground apps
Applied to files:
apps/playground-web/src/app/navLinks.ts
🪛 LanguageTool
apps/portal/src/app/ai/chat/execution/page.mdx
[grammar] ~16-~16: There might be a mistake here.
Context: ...m - auto_execute_transaction set to true - (Optional) chain_ids set to the chain ...
(QB_NEW_EN)
[grammar] ~17-~17: There might be a mistake here.
Context: ... chain IDs to execute the transaction on - The API must be called with either: - ...
(QB_NEW_EN)
[grammar] ~18-~18: There might be a mistake here.
Context: ...on - The API must be called with either: - your x-secret-key header for server wa...
(QB_NEW_EN)
[grammar] ~19-~19: There might be a mistake here.
Context: ... header for server wallet authentication - OR a Authorization header with a valid...
(QB_NEW_EN)
[grammar] ~38-~38: There might be a mistake here.
Context: ... a few seconds.", "session_id": "123", "request_id": "456", "actions": [] }} ...
(QB_NEW_EN)
[grammar] ~39-~39: There might be a mistake here.
Context: ...ssion_id": "123", "request_id": "456", "actions": [] }} /> ## Prepare for Sign...
(QB_NEW_EN)
[grammar] ~40-~40: There might be a mistake here.
Context: ..., "request_id": "456", "actions": [] }} /> ## Prepare for Signing When the ...
(QB_NEW_EN)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Size
- GitHub Check: Analyze (javascript)
🔇 Additional comments (6)
apps/playground-web/src/app/navLinks.ts (1)
20-23: Rename to “Blockchain LLM” is correct and consistent with PR scope.Href remains /ai/chat and only the label changed. Looks good.
apps/portal/src/app/page.tsx (1)
83-89: Homepage card title updated to “Blockchain LLM” — OK.Copy, href (/ai/chat), and icon remain aligned. No issues.
apps/portal/src/app/Header.tsx (1)
144-149: Header AI menu label updated to “Blockchain LLM” — OK.The rename matches sidebar and cards. Href unchanged.
apps/portal/src/app/ai/sidebar.tsx (1)
5-12: Top-level rename to “Blockchain LLM” — OK.Matches Header and homepage. Non-collapsible group is fine.
apps/portal/src/app/ai/chat/page.mdx (2)
3-3: Rename to “Blockchain LLM” approved and no lingering “Chat API” references found– The page title in apps/portal/src/app/ai/chat/page.mdx has been updated to
# Blockchain LLMas intended.
– Ran a case-insensitive search for “Chat API” across the repo (excluding lockfiles and node_modules); no occurrences remain.Everything looks good—no further action needed.
54-55: Please verify the “Full API Reference” link for the POST /ai/chat endpointI wasn’t able to confirm whether the current docs slug for POST /ai/chat on api.thirdweb.com changed after the recent reorganization. Before merging, please:
- Open
apps/portal/src/app/ai/chat/page.mdxat lines 54–55- Ensure the URL in the “Full API Reference” link matches the live documentation path
- If the slug has changed (e.g. moved under
/docsor renamed), update the markdown accordinglyOnce you’ve confirmed the correct URL, please update or approve this link.
| - The context object must be set with: | ||
| - `from` set to the wallet address to execute the transaction from | ||
| - `auto_execute_transaction` set to `true` | ||
| - (Optional) `chain_ids` set to the chain IDs to execute the transaction on | ||
| - The API must be called with either: | ||
| - your `x-secret-key` header for server wallet authentication | ||
| - OR a `Authorization` header with a valid wallet JWT for user wallet authentication | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Confirm header names and JWT format across the codebase
Ensure you’re consistently using exactly x-secret-key and Authorization: Bearer <token> in all AI docs and examples (Playground, Portal, SDK README).
🏁 Script executed:
#!/usr/bin/env bash
# Verify consistent header naming across docs and app sources
rg -nP -C2 '(x-secret-key|Authorization:?\s*Bearer)' apps/portal apps/playground-web packages --type-not=lock --hiddenLength of output: 74588
🏁 Script executed:
#!/usr/bin/env bash
# Show first 40 lines of the execution docs to confirm how Authorization is described
sed -n '1,40p' apps/portal/src/app/ai/chat/execution/page.mdx
# Show the streaming docs to see if JWT auth is mentioned or needs to be added
sed -n '60,100p' apps/portal/src/app/ai/chat/streaming/page.mdxLength of output: 2494
Consistent Authorization: Bearer header in AI chat docs
The AI chat execution docs still reference a generic Authorization header without the Bearer prefix, and the code examples don’t explicitly show it. Please update the following:
- apps/portal/src/app/ai/chat/execution/page.mdx
• Change “OR aAuthorizationheader with a valid wallet JWT”
to
“OR anAuthorization: Bearer <YOUR_WALLET_JWT>header with a valid wallet JWT”
• In the<OpenApiEndpoint>example, add a headers override:<OpenApiEndpoint path="/ai/chat" method="POST" requestBodyOverride={…} responseExampleOverride={…} -> + components={{ + request: { + headers: { + "x-secret-key": "<YOUR_SECRET_KEY>", + "Authorization": "Bearer <YOUR_WALLET_JWT>" + } + } + }} /> - apps/portal/src/app/ai/chat/streaming/page.mdx
• If the streaming endpoint supports user‐wallet authentication, add a note and example:- Headers: - - `x-secret-key`: `<your-secret-key>` + Headers (server OR user auth): + - `x-secret-key`: `<your-secret-key>` + OR + - `Authorization: Bearer <YOUR_WALLET_JWT>`
- Playground and SDK README
• Verify that all AI/chat examples use exactly
x-secret-keyfor server calls
and
Authorization: Bearer <token>for user calls.
This will ensure all AI docs and samples are aligned.
🧰 Tools
🪛 LanguageTool
[grammar] ~16-~16: There might be a mistake here.
Context: ...m - auto_execute_transaction set to true - (Optional) chain_ids set to the chain ...
(QB_NEW_EN)
[grammar] ~17-~17: There might be a mistake here.
Context: ... chain IDs to execute the transaction on - The API must be called with either: - ...
(QB_NEW_EN)
[grammar] ~18-~18: There might be a mistake here.
Context: ...on - The API must be called with either: - your x-secret-key header for server wa...
(QB_NEW_EN)
[grammar] ~19-~19: There might be a mistake here.
Context: ... header for server wallet authentication - OR a Authorization header with a valid...
(QB_NEW_EN)
🤖 Prompt for AI Agents
In apps/portal/src/app/ai/chat/execution/page.mdx around lines 14-21, the docs
reference a generic Authorization header and lack explicit examples; update the
sentence to read “OR an Authorization: Bearer <YOUR_WALLET_JWT> header with a
valid wallet JWT”, and modify the <OpenApiEndpoint> example to include a headers
override that demonstrates either x-secret-key or Authorization: Bearer
<YOUR_WALLET_JWT>; also update apps/portal/src/app/ai/chat/streaming/page.mdx to
note support for user-wallet authentication and replace the headers block with a
“Headers (server OR user auth):” example showing x-secret-key OR Authorization:
Bearer <YOUR_WALLET_JWT>; finally, scan Playground and SDK README examples to
ensure all AI/chat samples consistently use x-secret-key for server calls and
Authorization: Bearer <token> for user calls, correcting any mismatches.
5d9b23d to
69c2064
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
♻️ Duplicate comments (2)
apps/portal/src/app/ai/chat/execution/page.mdx (2)
14-21: Use “Authorization: Bearer …” and fix the article “an”, plus show headers in the exampleThese lines should explicitly show the Bearer scheme and correct grammar. Also mirror the headers in the example for copy-pasteability. This aligns with prior guidance and existing comments.
- The API must be called with either: - your `x-secret-key` header for server wallet authentication - - OR a `Authorization` header with a valid wallet JWT for user wallet authentication + - OR an `Authorization: Bearer <YOUR_WALLET_JWT>` header for user wallet authentication @@ -<OpenApiEndpoint path="/ai/chat" method="POST" requestBodyOverride={{ +<OpenApiEndpoint + path="/ai/chat" + method="POST" + components={{ + request: { + headers: { + "x-secret-key": "<YOUR_SECRET_KEY>", + "Authorization": "Bearer <YOUR_WALLET_JWT>" + } + } + }} + requestBodyOverride={{ "messages": [ { "role": "user", "content": "Transfer 10 USDC to vitalik.eth" } ], "context": { "from": "0x...", "auto_execute_transaction": true, "chain_ids": [8453] } -}} responseExampleOverride={{ +}} + responseExampleOverride={{ "message": "I've sent 10 USDC to Vitalik's wallet with transaction ID 11cd95e3-c0ee-4468-97c1-fd05dc919cdb. It should be confirmed in a few seconds.", "session_id": "123", "request_id": "456", "actions": [{ "session_id": "8d1bfac4-e6c0-473b-bbb6-649f459d37e6", "request_id": "79066871-b86f-4814-8027-5f34d99df389", "source": "model", "type": "monitor_transaction", "data": { "transaction_id": "11cd95e3-c0ee-4468-97c1-fd05dc919cdb" } }] -}} /> +}} +/>
55-57: Use the same parameter name:auto_execute_transactionThis line uses
auto_execute, which diverges from the rest of the page and the examples.-When the `auto_execute` parameter is set to `false` or omitted, the API will prepare the transaction for signing and return the transaction data in the `actions` array as a 'sign_transaction' action type. +When the `auto_execute_transaction` parameter is set to `false` or omitted, the API will prepare the transaction for signing and return the transaction data in the `actions` array as a `sign_transaction` action type.
🧹 Nitpick comments (5)
apps/portal/src/app/ai/chat/page.mdx (3)
9-9: Tighten copy for clarity and consistency
- Prefer “between any token pair” over “from/to any token pair”.
- Add the serial comma in “balances, prices, and metadata” (house style consistency with other docs).
- - Fetch token balances, prices and metadata + - Fetch token balances, prices, and metadata @@ - - Execute or prepare swaps from/to any token pair + - Execute or prepare swaps between any token pairAlso applies to: 11-11
33-45: Optionally show auto-execute in the quick-start sampleGiven this page now advertises “Execute or prepare…”, consider demonstrating auto-execution by including the flag in the OpenAI client example. Readers who only skim this page will succeed without having to discover the execution subpage.
chat_completion = client.chat.completions.create( model="t0", messages=[{"role": "user", "content": "Transfer 10 USDC to vitalik.eth"}], stream=False, - extra_body={ "context": { "from": "0x...", "chain_ids": [8453] }} + extra_body={ "context": { "from": "0x...", "chain_ids": [8453], "auto_execute_transaction": True } } )Note: The execution page already documents auth requirements; a brief inline note such as “Requires x-secret-key or Authorization: Bearer ” below the snippet would further set expectations.
52-55: Cross-link to the new Transaction Execution docsAdd a “Transaction Execution” bullet so users can discover the deeper flow from here.
### Going further +- [Transaction Execution](/ai/chat/execution) - [Handle streaming responses](/ai/chat/streaming) - [Full API Reference](https://api.thirdweb.com/reference#tag/ai/post/ai/chat)apps/portal/src/app/ai/chat/execution/page.mdx (2)
5-8: Hyphenate “auto‑execute” for readabilityMinor copy polish: “auto‑execute” as a compound verb is easier to scan; likewise “auto‑execution” when used as a noun.
-thirdweb AI can either auto execute transactions or prepare them for signing. +thirdweb AI can either auto‑execute transactions or prepare them for signing. @@ -- **Auto Execute**: The API will auto execute the transaction. Requires wallet authentication. +- **Auto‑execute**: The API will auto‑execute the transaction. Requires wallet authentication. -- **Prepare for Signing**: The API will only prepare the transaction for signing. The user will need to sign the transaction manually. +- **Prepare for signing**: The API will only prepare the transaction for signing. The user will need to sign the transaction manually.
59-59: Show a concrete prepare‑for‑signing responseAdd a response example so users can see what to pass to their signer. This reduces guesswork and support load.
-<OpenApiEndpoint path="/ai/chat" method="POST" /> +<OpenApiEndpoint + path="/ai/chat" + method="POST" + requestBodyOverride={{ + "messages": [ + { "role": "user", "content": "Transfer 10 USDC to vitalik.eth" } + ], + "context": { + "from": "0x...", + "auto_execute_transaction": false, + "chain_ids": [8453] + } + }} + responseExampleOverride={{ + "message": "I prepared a transaction to send 10 USDC to Vitalik. Please review and sign.", + "session_id": "abc", + "request_id": "def", + "actions": [ + { + "source": "model", + "type": "sign_transaction", + "data": { + "to": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", + "value": "0", + "data": "0x095ea7b3...", + "chain_id": 8453 + } + } + ] + }} +/>
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (7)
apps/playground-web/src/app/ai/chat/page.tsx(1 hunks)apps/playground-web/src/app/navLinks.ts(1 hunks)apps/portal/src/app/Header.tsx(1 hunks)apps/portal/src/app/ai/chat/execution/page.mdx(1 hunks)apps/portal/src/app/ai/chat/page.mdx(1 hunks)apps/portal/src/app/ai/sidebar.tsx(2 hunks)apps/portal/src/app/page.tsx(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (5)
- apps/playground-web/src/app/ai/chat/page.tsx
- apps/portal/src/app/page.tsx
- apps/playground-web/src/app/navLinks.ts
- apps/portal/src/app/ai/sidebar.tsx
- apps/portal/src/app/Header.tsx
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-07-18T19:19:55.613Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to apps/{dashboard,playground-web}/**/*.{ts,tsx} : Use `Authorization: Bearer` header – never embed tokens in URLs
Applied to files:
apps/portal/src/app/ai/chat/execution/page.mdx
🪛 LanguageTool
apps/portal/src/app/ai/chat/execution/page.mdx
[grammar] ~16-~16: There might be a mistake here.
Context: ...m - auto_execute_transaction set to true - (Optional) chain_ids set to the chain ...
(QB_NEW_EN)
[grammar] ~17-~17: There might be a mistake here.
Context: ... chain IDs to execute the transaction on - The API must be called with either: - ...
(QB_NEW_EN)
[grammar] ~18-~18: There might be a mistake here.
Context: ...on - The API must be called with either: - your x-secret-key header for server wa...
(QB_NEW_EN)
[grammar] ~19-~19: There might be a mistake here.
Context: ... header for server wallet authentication - OR a Authorization header with a valid...
(QB_NEW_EN)
[grammar] ~51-~51: There might be a mistake here.
Context: ...d95e3-c0ee-4468-97c1-fd05dc919cdb" } }] }} /> ## Prepare for Signing When t...
(QB_NEW_EN)
[grammar] ~52-~52: There might be a mistake here.
Context: ...e3-c0ee-4468-97c1-fd05dc919cdb" } }] }} /> ## Prepare for Signing When the ...
(QB_NEW_EN)
apps/portal/src/app/ai/chat/page.mdx
[grammar] ~7-~7: There might be a mistake here.
Context: ...Query real-time data from the blockchain - Analyze transactions - Fetch token balances, pr...
(QB_NEW_EN)
[grammar] ~11-~11: There might be a mistake here.
Context: ... or prepare swaps from/to any token pair - Deploy contracts - Generate images - Search th...
(QB_NEW_EN)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- GitHub Check: E2E Tests (pnpm, webpack)
- GitHub Check: Size
- GitHub Check: E2E Tests (pnpm, esbuild)
- GitHub Check: Unit Tests
- GitHub Check: Lint Packages
- GitHub Check: Analyze (javascript)
🔇 Additional comments (2)
apps/portal/src/app/ai/chat/page.mdx (1)
3-3: Rename looks good and matches PR intentTitle update to “Blockchain LLM” aligns with the branding changes across the PR.
apps/portal/src/app/ai/chat/execution/page.mdx (1)
3-9: Solid structure and scopingClear separation of the two modes with a concise intro. This page rounds out the rename nicely.
69c2064 to
32584b3
Compare
32584b3 to
b1f20d0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (3)
apps/portal/src/app/Header.tsx (2)
470-481: Prevent reverse‑tabnabbing on external linksExternal links opened with target="_blank" should also set rel="noopener noreferrer". Also, pass undefined instead of an empty string for the non-external case to avoid emitting an empty target attribute.
Apply this diff:
<Link className="before:absolute before:inset-0" href={info.href} prefetch={false} - target={info.href.startsWith("http") ? "_blank" : ""} + target={info.href.startsWith("http") ? "_blank" : undefined} + rel={info.href.startsWith("http") ? "noopener noreferrer" : undefined} > {info.name} </Link>
526-537: Do the same for NavLink’s external targetsMirror the security fix in NavLink so all external links are protected.
<Link className={clsx( "font-medium text-base transition-colors hover:text-foreground xl:text-sm", pathname.startsWith(props.href) ? "text-foreground" : "text-muted-foreground", props.icon ? "flex flex-row gap-3" : "", )} href={props.href} onClick={props.onClick} - target={props.href.startsWith("http") ? "_blank" : ""} + target={props.href.startsWith("http") ? "_blank" : undefined} + rel={props.href.startsWith("http") ? "noopener noreferrer" : undefined} >apps/portal/src/app/ai/chat/streaming/page.mdx (1)
98-154: Unified event parsing is great – just one more refactor neededSwitching to a single
parsedEventDataand branching onparsedEventData.typegreatly improves clarity and eliminates double parsing. The newmonitor_transactionbranch aligns perfectly with our execution docs.Before approving, please remove the remaining hard-coded chain ID in the AI streaming example:
• In
apps/portal/src/app/ai/chat/streaming/page.mdxat line 62:"data": { - "chainId": 11155111, + "chainId": parsedEventData.data.chainId, // or use a placeholder like {{chainId}} "to": parsedEventData.data.to, "data": parsedEventData.data.data, }Replace the literal
11155111with the dynamic value fromparsedEventData.data.chainId(or a template placeholder) so the example reflects the actual runtime chain.
♻️ Duplicate comments (4)
apps/portal/src/app/ai/chat/execution/page.mdx (3)
18-21: Use the exact Authorization: Bearer header, per policyChange “a Authorization header” to “an Authorization: Bearer <YOUR_WALLET_JWT> header” and show the Bearer prefix explicitly. This aligns with our documented guidance to use Authorization: Bearer and never put tokens in URLs. (Using learnings: Authorization: Bearer header – never embed tokens in URLs.)
- - OR a `Authorization` header with a valid wallet JWT for user wallet authentication + - OR an `Authorization: Bearer <YOUR_WALLET_JWT>` header with a valid wallet JWT for user wallet authentication
28-53: Show auth headers in the interactive exampleDemonstrate either server key or user JWT in the props so readers don’t miss the required headers.
-<OpenApiEndpoint path="/ai/chat" method="POST" requestBodyOverride={{ +<OpenApiEndpoint + path="/ai/chat" + method="POST" + components={{ + request: { + headers: { + "x-secret-key": "<YOUR_SECRET_KEY>", + // OR use user-wallet auth: + // "Authorization": "Bearer <YOUR_WALLET_JWT>", + }, + }, + }} + requestBodyOverride={{ "messages": [ { "role": "user", "content": "Transfer 10 USDC to vitalik.eth" } ], "context": { "from": "0x...", "auto_execute_transaction": true, "chain_ids": [8453] } -}} responseExampleOverride={{ +}} + responseExampleOverride={{ "message": "I've sent 10 USDC to Vitalik's wallet with transaction ID 11cd95e3-c0ee-4468-97c1-fd05dc919cdb. It should be confirmed in a few seconds.", "session_id": "123", "request_id": "456", "actions": [{ "session_id": "8d1bfac4-e6c0-473b-bbb6-649f459d37e6", "request_id": "79066871-b86f-4814-8027-5f34d99df389", "source": "model", "type": "monitor_transaction", "data": { "transaction_id": "11cd95e3-c0ee-4468-97c1-fd05dc919cdb" } }] -}} /> +}} +/>
57-57: Use the correct parameter name: auto_execute_transactionEarlier you require context.auto_execute_transaction; keep the same name here to avoid confusion.
-When the `auto_execute` parameter is set to `false` or omitted, the API will prepare the transaction for signing and return the transaction data in the `actions` array as a 'sign_transaction' action type. +When the `auto_execute_transaction` parameter is set to `false` or omitted, the API will prepare the transaction for signing and return the transaction data in the `actions` array as a 'sign_transaction' action type.apps/portal/src/app/ai/chat/streaming/page.mdx (1)
86-90: Document both auth options (server OR user) in the TS exampleShow Authorization: Bearer as an alternative to x-secret-key in headers. This keeps streaming docs consistent with execution docs.
headers: { "Content-Type": "application/json", - "x-secret-key": "<your-secret-key>", + // Choose ONE of the following auth headers: + "x-secret-key": "<your-secret-key>", + // "Authorization": "Bearer <YOUR_WALLET_JWT>", },
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (11)
apps/playground-web/src/app/ai/api/chat.ts(2 hunks)apps/playground-web/src/app/ai/api/types.ts(1 hunks)apps/playground-web/src/app/ai/chat/page.tsx(1 hunks)apps/playground-web/src/app/ai/components/ChatPageContent.tsx(4 hunks)apps/playground-web/src/app/navLinks.ts(1 hunks)apps/portal/src/app/Header.tsx(1 hunks)apps/portal/src/app/ai/chat/execution/page.mdx(1 hunks)apps/portal/src/app/ai/chat/page.mdx(1 hunks)apps/portal/src/app/ai/chat/streaming/page.mdx(2 hunks)apps/portal/src/app/ai/sidebar.tsx(2 hunks)apps/portal/src/app/page.tsx(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (8)
- apps/portal/src/app/page.tsx
- apps/portal/src/app/ai/sidebar.tsx
- apps/playground-web/src/app/navLinks.ts
- apps/playground-web/src/app/ai/chat/page.tsx
- apps/playground-web/src/app/ai/api/chat.ts
- apps/playground-web/src/app/ai/api/types.ts
- apps/portal/src/app/ai/chat/page.mdx
- apps/playground-web/src/app/ai/components/ChatPageContent.tsx
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.{ts,tsx}: Write idiomatic TypeScript with explicit function declarations and return types
Limit each file to one stateless, single-responsibility function for clarity
Re-use shared types from@/typesor localtypes.tsbarrels
Prefer type aliases over interface except for nominal shapes
Avoidanyandunknownunless unavoidable; narrow generics when possible
Choose composition over inheritance; leverage utility types (Partial,Pick, etc.)
Comment only ambiguous logic; avoid restating TypeScript in prose
Files:
apps/portal/src/app/Header.tsx
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (CLAUDE.md)
Load heavy dependencies inside async paths to keep initial bundle lean (lazy loading)
Files:
apps/portal/src/app/Header.tsx
🧠 Learnings (1)
📚 Learning: 2025-07-18T19:19:55.613Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to apps/{dashboard,playground-web}/**/*.{ts,tsx} : Use `Authorization: Bearer` header – never embed tokens in URLs
Applied to files:
apps/portal/src/app/ai/chat/execution/page.mdx
🪛 LanguageTool
apps/portal/src/app/ai/chat/execution/page.mdx
[grammar] ~16-~16: There might be a mistake here.
Context: ...m - auto_execute_transaction set to true - (Optional) chain_ids set to the chain ...
(QB_NEW_EN)
[grammar] ~17-~17: There might be a mistake here.
Context: ... chain IDs to execute the transaction on - The API must be called with either: - ...
(QB_NEW_EN)
[grammar] ~18-~18: There might be a mistake here.
Context: ...on - The API must be called with either: - your x-secret-key header for server wa...
(QB_NEW_EN)
[grammar] ~19-~19: There might be a mistake here.
Context: ... header for server wallet authentication - OR a Authorization header with a valid...
(QB_NEW_EN)
[grammar] ~51-~51: There might be a mistake here.
Context: ...d95e3-c0ee-4468-97c1-fd05dc919cdb" } }] }} /> ## Prepare for Signing When t...
(QB_NEW_EN)
[grammar] ~52-~52: There might be a mistake here.
Context: ...e3-c0ee-4468-97c1-fd05dc919cdb" } }] }} /> ## Prepare for Signing When the ...
(QB_NEW_EN)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Size
🔇 Additional comments (2)
apps/portal/src/app/Header.tsx (1)
146-148: Rename to “Blockchain LLM” looks goodLabel change in aiLinks aligns with PR intent and the rest of the docs. No functional concerns.
apps/portal/src/app/ai/chat/execution/page.mdx (1)
1-1: Import Verified:OpenApiEndpointIs Correctly Exported from@docThe search confirms that
OpenApiEndpointis re-exported in
•apps/portal/src/components/Document/index.ts:6via
export { OpenApiEndpoint } from "./APIEndpointMeta/OpenApiEndpoint";Nearby MDX pages consistently import it from
@doc, so the alias is correct and no changes are needed.
b1f20d0 to
46ea117
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
♻️ Duplicate comments (3)
apps/portal/src/app/ai/chat/execution/page.mdx (3)
57-57: Use the correct parameter name:auto_execute_transaction(notauto_execute)This mismatches the rest of the doc and the API surface; will confuse users.
Apply this diff:
-When the `auto_execute` parameter is set to `false` or omitted, the API will prepare the transaction for signing and return the transaction data in the `actions` array as a 'sign_transaction' action type. +When the `auto_execute_transaction` parameter is set to `false` or omitted, the API will prepare the transaction for signing and return the transaction data in the `actions` array as a `sign_transaction` action type.
18-21: Fix auth header phrasing and include explicit Bearer schemeThe docs say “a Authorization header” and omit the Bearer scheme. This will lead to incorrect requests and confusion for wallet JWT usage.
Apply this diff:
-- The API must be called with either: - - your `x-secret-key` header for server wallet authentication - - OR a `Authorization` header with a valid wallet JWT for user wallet authentication +- The API must be called with either: + - your `x-secret-key` header for server wallet authentication + - OR an `Authorization: Bearer <YOUR_WALLET_JWT>` header for user wallet authentication
14-21: Ensure consistency forauto_execute_transactionand include the Bearer scheme in the auth snippetPlease address the following in apps/portal/src/app/ai/chat/execution/page.mdx:
- Line 57
- Update the stale parameter name:
- When the `auto_execute` parameter is set to `false` or omitted, … + When the `auto_execute_transaction` parameter is set to `false` or omitted, …- Lines 19–21
- Require the Bearer prefix for the Authorization header:
- The API must be called with either: - your `x-secret-key` header for server wallet authentication - OR a `Authorization` header with a valid wallet JWT for user wallet authentication + The API must be called with either: + your `x-secret-key` header for server wallet authentication + OR an `Authorization: Bearer <wallet_JWT>` header for user wallet authentication(Optional) The scan also surfaced other docs and code locations where “Authorization” is mentioned without explicitly showing the “Bearer” prefix (e.g. in OpenApiEndpoint.tsx and various MDX pages). You may want to plan a follow-up PR to sweep those for consistency.
🧹 Nitpick comments (5)
apps/portal/src/app/ai/chat/page.mdx (2)
3-6: Rebrand copy reads well; consider a brief migration noteHeading and intro align with “Blockchain LLM.” Optionally add a one‑liner: “Formerly ‘Chat API’; no endpoint changes required,” to smooth migration for readers scanning for renamed concepts.
10-11: Micro copy polish for bullets“swaps from/to any token pair” is slightly awkward. Recommend “between any token pair.”
Apply this diff:
-- Execute or prepare swaps from/to any token pair +- Execute or prepare swaps between any token pairapps/portal/src/app/ai/chat/execution/page.mdx (3)
5-9: Hyphenate “auto‑execute” for clarity and consistencyMinor readability improvement; the term appears as a compound adjective.
Apply this diff:
-thirdweb AI can either auto execute transactions or prepare them for signing. +thirdweb AI can either auto-execute transactions or prepare them for signing.
28-53: Show headers in the example to disambiguate server vs user authSurface the required headers directly in the example so readers can copy-paste a working call.
Apply this diff:
-<OpenApiEndpoint path="/ai/chat" method="POST" requestBodyOverride={{ +<OpenApiEndpoint path="/ai/chat" method="POST" requestBodyOverride={{ "messages": [ { "role": "user", "content": "Transfer 10 USDC to vitalik.eth" } ], "context": { "from": "0x...", "auto_execute_transaction": true, "chain_ids": [8453] } -}} responseExampleOverride={{ +}} components={{ + request: { + headers: { + "x-secret-key": "<YOUR_SECRET_KEY>", + "Authorization": "Bearer <YOUR_WALLET_JWT>" + } + } +}} responseExampleOverride={{ "message": "I've sent 10 USDC to Vitalik's wallet with transaction ID 11cd95e3-c0ee-4468-97c1-fd05dc919cdb. It should be confirmed in a few seconds.", "session_id": "123", "request_id": "456", "actions": [{ "session_id": "8d1bfac4-e6c0-473b-bbb6-649f459d37e6", "request_id": "79066871-b86f-4814-8027-5f34d99df389", "source": "model", "type": "monitor_transaction", "data": { "transaction_id": "11cd95e3-c0ee-4468-97c1-fd05dc919cdb" } }] }} />If doesn’t support components.request.headers in your doc system, mirror the example with a fenced HTTP snippet showing both header options instead.
55-59: Optional: include a concrete example for “Prepare for Signing”Consider mirroring the Auto Execute block with a requestBodyOverride (auto_execute_transaction: false) and a minimal responseExampleOverride that shows a
sign_transactionaction with required fields.I can draft the exact example payloads if you share the latest action schema fields (e.g., to, data, value, chain_id, gas, nonce).
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (11)
apps/playground-web/src/app/ai/api/chat.ts(2 hunks)apps/playground-web/src/app/ai/api/types.ts(1 hunks)apps/playground-web/src/app/ai/chat/page.tsx(1 hunks)apps/playground-web/src/app/ai/components/ChatPageContent.tsx(4 hunks)apps/playground-web/src/app/navLinks.ts(1 hunks)apps/portal/src/app/Header.tsx(1 hunks)apps/portal/src/app/ai/chat/execution/page.mdx(1 hunks)apps/portal/src/app/ai/chat/page.mdx(1 hunks)apps/portal/src/app/ai/chat/streaming/page.mdx(2 hunks)apps/portal/src/app/ai/sidebar.tsx(2 hunks)apps/portal/src/app/page.tsx(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (8)
- apps/portal/src/app/page.tsx
- apps/playground-web/src/app/ai/chat/page.tsx
- apps/playground-web/src/app/ai/api/types.ts
- apps/portal/src/app/Header.tsx
- apps/playground-web/src/app/navLinks.ts
- apps/playground-web/src/app/ai/api/chat.ts
- apps/playground-web/src/app/ai/components/ChatPageContent.tsx
- apps/portal/src/app/ai/chat/streaming/page.mdx
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.{ts,tsx}: Write idiomatic TypeScript with explicit function declarations and return types
Limit each file to one stateless, single-responsibility function for clarity
Re-use shared types from@/typesor localtypes.tsbarrels
Prefer type aliases over interface except for nominal shapes
Avoidanyandunknownunless unavoidable; narrow generics when possible
Choose composition over inheritance; leverage utility types (Partial,Pick, etc.)
Comment only ambiguous logic; avoid restating TypeScript in prose
Files:
apps/portal/src/app/ai/sidebar.tsx
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (CLAUDE.md)
Load heavy dependencies inside async paths to keep initial bundle lean (lazy loading)
Files:
apps/portal/src/app/ai/sidebar.tsx
🧠 Learnings (1)
📚 Learning: 2025-07-18T19:19:55.613Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to apps/{dashboard,playground-web}/**/*.{ts,tsx} : Use `Authorization: Bearer` header – never embed tokens in URLs
Applied to files:
apps/portal/src/app/ai/chat/execution/page.mdx
🪛 LanguageTool
apps/portal/src/app/ai/chat/execution/page.mdx
[grammar] ~16-~16: There might be a mistake here.
Context: ...m - auto_execute_transaction set to true - (Optional) chain_ids set to the chain ...
(QB_NEW_EN)
[grammar] ~17-~17: There might be a mistake here.
Context: ... chain IDs to execute the transaction on - The API must be called with either: - ...
(QB_NEW_EN)
[grammar] ~18-~18: There might be a mistake here.
Context: ...on - The API must be called with either: - your x-secret-key header for server wa...
(QB_NEW_EN)
[grammar] ~19-~19: There might be a mistake here.
Context: ... header for server wallet authentication - OR a Authorization header with a valid...
(QB_NEW_EN)
[grammar] ~51-~51: There might be a mistake here.
Context: ...d95e3-c0ee-4468-97c1-fd05dc919cdb" } }] }} /> ## Prepare for Signing When t...
(QB_NEW_EN)
[grammar] ~52-~52: There might be a mistake here.
Context: ...e3-c0ee-4468-97c1-fd05dc919cdb" } }] }} /> ## Prepare for Signing When the ...
(QB_NEW_EN)
apps/portal/src/app/ai/chat/page.mdx
[grammar] ~7-~7: There might be a mistake here.
Context: ...Query real-time data from the blockchain - Analyze transactions - Fetch token balances, pr...
(QB_NEW_EN)
[grammar] ~11-~11: There might be a mistake here.
Context: ... or prepare swaps from/to any token pair - Deploy contracts - Generate images - Search th...
(QB_NEW_EN)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: E2E Tests (pnpm, esbuild)
- GitHub Check: Size
- GitHub Check: Lint Packages
- GitHub Check: Analyze (javascript)
🔇 Additional comments (1)
apps/portal/src/app/ai/sidebar.tsx (1)
7-7: Rename to “Blockchain LLM” looks correct and consistent with PR scopeGood alignment with the rebrand in navigation. No issues spotted here.
| { | ||
| name: "Transaction Execution", | ||
| href: "/ai/chat/execution", | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
New “Transaction Execution” doc link — verify route exists and is indexed
The link points to /ai/chat/execution. It looks like the MDX page was added in this PR; please also ensure it’s discoverable (sitemap/search index) and that the frontmatter includes title/description so it renders well in listings.
Run this quick check from repo root:
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
# 1) Route file presence
test -f apps/portal/src/app/ai/chat/execution/page.mdx && echo "OK: execution page exists"
# 2) Basic frontmatter or H1
rg -n --hidden -C2 -S $'^---\\n|^title:\\s*|^#\\s*' apps/portal/src/app/ai/chat/execution/page.mdx || {
echo "WARN: frontmatter/H1 not found (ensure title/description or a top-level heading exist)"; exit 1;
}
# 3) Optional: Confirm any sitemap or sidebar ordering includes the new path (heuristic)
rg -nS "/ai/chat/execution" apps/portal || echo "NOTE: /ai/chat/execution not referenced outside sidebar"Length of output: 618
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
echo "----- Head of page.mdx -----"
head -n20 apps/portal/src/app/ai/chat/execution/page.mdx
echo "----- Frontmatter start lines -----"
grep -n -E '^---' apps/portal/src/app/ai/chat/execution/page.mdx || true
echo "----- Title lines -----"
grep -n -E '^\s*title:' apps/portal/src/app/ai/chat/execution/page.mdx || true
echo "----- Description lines -----"
grep -n -E '^\s*description:' apps/portal/src/app/ai/chat/execution/page.mdx || true
echo "----- H1 lines -----"
grep -n -E '^# ' apps/portal/src/app/ai/chat/execution/page.mdx || true
echo "----- References to /ai/chat/execution in apps/portal -----"
rg -n "/ai/chat/execution" apps/portal || trueLength of output: 1805
Add frontmatter and ensure indexing for “Transaction Execution” page
The new MDX page exists and includes a top-level heading, but it currently lacks frontmatter metadata and isn’t referenced in any sitemap or search‐index configuration. To ensure this doc is discoverable and renders properly in listings:
• apps/portal/src/app/ai/chat/execution/page.mdx
– Add frontmatter at the very top, for example:
diff +--- +title: "Transaction Execution" +description: "Use thirdweb AI to auto-execute or prepare transactions for signing." +---
– This will provide explicit title/description for sitemap generators and search indexers.
– Retain or move the existing # Transaction Execution H1 below the frontmatter.
• Sitemap/search index configuration
– Verify that /ai/chat/execution is included in your sitemap (e.g., via next-sitemap or other routing exports).
– Ensure your search indexing process (DocSearch, Lunr, etc.) picks up MDX files under apps/portal/src/app/ai/chat.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| { | |
| name: "Transaction Execution", | |
| href: "/ai/chat/execution", | |
| }, | |
| file=apps/portal/src/app/ai/chat/execution/page.mdx | |
| --- | |
| title: "Transaction Execution" | |
| description: "Use thirdweb AI to auto-execute or prepare transactions for signing." | |
| --- | |
| # Transaction Execution | |
| <!-- rest of the MDX content follows --> |

PR-Codex overview
This PR focuses on renaming and updating references from "Chat API" to "Blockchain LLM" across multiple files, as well as making changes to the data structure of
NebulaTxDataand enhancing the transaction execution features in the application.Detailed summary
labelandnamefrom "Chat API" to "Blockchain LLM" innavLinks.ts,Header.tsx, andsidebar.tsx.chainIdtochain_idinNebulaTxDatatype intypes.tsandChatPageContent.tsx.execution/page.mdx.streaming/page.mdxto use parsed event data.Summary by CodeRabbit
Documentation
Style
Compatibility