@@ -5,7 +5,7 @@ import { type Input, type Output, nebulaFetch } from "./common.js";
55 *
66 * @param input - The input for the chat.
77 * @returns The chat response.
8- * @beta
8+ * @beta This API is in early access and might change in the future.
99 * @nebula
1010 *
1111 * @example
@@ -14,12 +14,38 @@ import { type Input, type Output, nebulaFetch } from "./common.js";
1414 *
1515 * const response = await Nebula.chat({
1616 * client: TEST_CLIENT,
17- * prompt : "What's the symbol of this contract: 0xe2cb0eb5147b42095c2FfA6F7ec953bb0bE347D8",
18- * context : {
17+ * message : "What's the symbol of this contract: 0xe2cb0eb5147b42095c2FfA6F7ec953bb0bE347D8",
18+ * contextFilter : {
1919 * chains: [sepolia],
2020 * },
2121 * });
2222 * ```
23+ *
24+ * Multi message prompt:
25+ *
26+ * ```ts
27+ * const response = await Nebula.chat({
28+ * client,
29+ * messages: [
30+ * { role: "user", content: "What's my balance?" },
31+ * { role: "assistant", content: "Your balance is 0.023 ETH" },
32+ * { role: "user", content: "What about my NFTs?" },
33+ * ],
34+ * contextFilter: {
35+ * chains: [sepolia],
36+ * },
37+ * });
38+ * ```
39+ *
40+ * Extracting and sending transactions from a chat response:
41+ *
42+ * ```ts
43+ * const response = await Nebula.chat({ ... });
44+ * const transactions = response.transactions;
45+ * for (const transaction of transactions) {
46+ * await sendTransaction({ transaction, account });
47+ * }
48+ * ```
2349 */
2450export async function chat ( input : Input ) : Promise < Output > {
2551 return nebulaFetch ( "chat" , input ) ;
0 commit comments