chat

Chat with Nebula.

Example

import { Nebula } from "thirdweb/ai";
const response = await Nebula.chat({
client: TEST_CLIENT,
messages: [
{
role: "user",
content:
"What's the symbol of this contract: 0xe2cb0eb5147b42095c2FfA6F7ec953bb0bE347D8",
},
],
contextFilter: {
chains: [sepolia],
},
});
function chat(input: Input): Promise<Output>;

Parameters

The input for the chat.

Type

let input: {
account?: Account;
client: ThirdwebClient;
contextFilter?: {
chains?: Array<Chain>;
contractAddresses?: Array<string>;
walletAddresses?: Array<string>;
};
messages: Array<{ content: string; role: "user" | "assistant" }>;
sessionId?: string;
};

Returns

let returnType: {
message: string;
sessionId: string;
transactions: Array<PreparedTransaction>;
};

The chat response. This API is in early access and might change in the future.