Skip to content

Commit 5d9b23d

Browse files
[AI] Rename Chat API to Blockchain LLM and add transaction execution docs
1 parent bdcbe0e commit 5d9b23d

File tree

7 files changed

+62
-9
lines changed

7 files changed

+62
-9
lines changed

apps/playground-web/src/app/ai/chat/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ export default function ChatPage() {
1313
}
1414

1515
export const metadata = {
16-
title: "AI Chat API - Playground",
16+
title: "Blockchain LLM - Playground",
1717
description: "Chat with thirdweb AI for blockchain interactions",
1818
};

apps/playground-web/src/app/navLinks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const ai: ShadcnSidebarLink = {
1818
links: [
1919
{
2020
href: "/ai/chat",
21-
label: "Chat API",
21+
label: "Blockchain LLM",
2222
},
2323
],
2424
};

apps/portal/src/app/Header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ const apisLinks = [
144144
const aiLinks = [
145145
{
146146
href: "/ai/chat",
147-
name: "Chat API",
147+
name: "Blockchain LLM",
148148
},
149149
{
150150
href: "/ai/mcp",
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import {OpenApiEndpoint} from "@doc";
2+
3+
# Transaction Execution
4+
5+
thirdweb AI can either auto execute transactions or prepare them for signing.
6+
7+
- **Auto Execute**: The API will auto execute the transaction. Requires wallet authentication.
8+
- **Prepare for Signing**: The API will only prepare the transaction for signing. The user will need to sign the transaction manually.
9+
10+
## Auto Execute
11+
12+
Requirements:
13+
14+
- The context object must be set with:
15+
- `from` set to the wallet address to execute the transaction from
16+
- `auto_execute_transaction` set to `true`
17+
- (Optional) `chain_ids` set to the chain IDs to execute the transaction on
18+
- The API must be called with either:
19+
- your `x-secret-key` header for server wallet authentication
20+
- OR a `Authorization` header with a valid wallet JWT for user wallet authentication
21+
22+
### Example
23+
24+
<OpenApiEndpoint path="/ai/chat" method="POST" requestBodyOverride={{
25+
"messages": [
26+
{
27+
"role": "user",
28+
"content": "Transfer 10 USDC to vitalik.eth"
29+
}
30+
],
31+
"context": {
32+
"from": "0x...",
33+
"auto_execute_transaction": true,
34+
"chain_ids": [8453]
35+
}
36+
}} responseExampleOverride={{
37+
"message": "I've sent 10 USDC to Vitalik's wallet with transaction ID 0123-4567-9810. It should be confirmed in a few seconds.",
38+
"session_id": "123",
39+
"request_id": "456",
40+
"actions": []
41+
}} />
42+
43+
## Prepare for Signing
44+
45+
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.
46+
47+
### Example
48+
49+
<OpenApiEndpoint path="/ai/chat" method="POST" />

apps/portal/src/app/ai/chat/page.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import { Tabs, TabsContent, TabsList, TabsTrigger, OpenApiEndpoint } from "@doc";
22

3-
# Chat API
3+
# Blockchain LLM
44

5-
The thirdweb AI chat API is a standard OpenAI-compatible chat completion API that allows you to interact with the thirdweb AI model, optimized for blockchain interactions.
5+
The thirdweb API exposes a standard OpenAI-compatible chat completion API that allows you to interact with the thirdweb AI model, optimized for blockchain interactions.
66

77
- Query real-time data from the blockchain
88
- Analyze transactions
99
- Fetch token balances, prices and metadata
10-
- Prepare any contract call or transaction for signing
11-
- Prepare swaps from/to any token pair
10+
- Execute or prepare any contract call or transaction
11+
- Execute or prepare swaps from/to any token pair
1212
- Deploy contracts
1313
- Generate images
1414
- Search the web

apps/portal/src/app/ai/sidebar.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import type { SideBar } from "@/components/Layouts/DocLayout";
44
export const sidebar: SideBar = {
55
links: [
66
{
7-
name: "Chat API",
7+
name: "Blockchain LLM",
88
isCollapsible: false,
99
links: [
1010
{
@@ -21,6 +21,10 @@ export const sidebar: SideBar = {
2121
name: "Streaming Responses",
2222
href: "/ai/chat/streaming",
2323
},
24+
{
25+
name: "Transaction Execution",
26+
href: "/ai/chat/execution",
27+
},
2428
{
2529
name: "API Reference",
2630
href: "https://api.thirdweb.com/reference#tag/ai/post/ai/chat",

apps/portal/src/app/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ function AISection() {
8484
description="Integrate the most advanced blockchain model into your applications"
8585
href="/ai/chat"
8686
icon={MessageCircleIcon}
87-
title="Chat API"
87+
title="Blockchain LLM"
8888
/>
8989
<ArticleCardIndex
9090
description="For agents and humans. Use the thirdweb API with natural language"

0 commit comments

Comments
 (0)