Skip to content
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

move execute out to be api endpoint #5766

Merged
merged 2 commits into from
Dec 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 10 additions & 14 deletions apps/portal/src/app/nebula/api-reference/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Nebula provides a conversational interface to interact with blockchain data and
- [Base URL](#base-url)
- [Authentication](#authentication)
- [Sessions](#sessions)
- [Context Filtering](#context-filtering)
- [Context Filters](#context-filtering)
- [Execute Configuration](#execute-configuration)
- [Response Handling](#response-handling)
- [API Endpoints](#api-endpoints)
Expand Down Expand Up @@ -57,22 +57,24 @@ Sessions maintain conversation threads with the AI and can be:

Sessions persist your conversation history and custom configurations for blockchain data and thirdweb tools interactions.

## Context Filtering
## Context Filters

Control what blockchain data informs AI responses through context filtering:

```json
{
"context_filter": {
"chain_ids": [1], // Ethereum mainnet
"contract_addresses": ["0x..."] // Target contract address
"chain_ids": [1], // comma delimited list of chain ID's
"contract_addresses": ["0x..."], // Comma delimited list of contract addresses
"wallet_addresses": ["0x..."] // Comma delimited list of wallet addresses
}
}
```

Benefits:
- Filter by blockchain networks using chain IDs
- Target specific contract addresses
- Target specific wallet addresses
- Control context scope for relevant responses
- Optimize token usage and response relevance

Expand Down Expand Up @@ -108,13 +110,7 @@ When `stream: false`, the API returns a single JSON response:
"result": {
"message": "The last 5 blocks on polygon are...",
"session_id": "abc",
"message_id": "1234",
"created_at": "2024-01-01T00:00:00Z",
"usage": {
"prompt_tokens": 10,
"completion_tokens": 15,
"total_tokens": 25
}
"message_id": "1234"
}
}
```
Expand Down Expand Up @@ -224,7 +220,8 @@ POST /chat
"stream": true,
"context_filter": {
"chain_ids": [137],
"contract_addresses": ["0x.."]
"contract_addresses": ["0x..."],
"wallet_addresses": ["0x..."]
},
"execute_config": {
"mode": "client",
Expand Down Expand Up @@ -405,8 +402,7 @@ const data = await response.json();
const result = await handleNebulaResponse(data);
```

#### Execute Command

### Execute


```bash
Expand Down
Loading