Skip to content

Commit 6a4cf2e

Browse files
saminacodesMananTank
authored andcommitted
update
1 parent 589dfc4 commit 6a4cf2e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1629
-1252
lines changed

apps/dashboard/src/app/nebula-app/(app)/api/chat.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export async function promptNebula(params: {
3030
body.context_filter = {
3131
chain_ids: params.contextFilters.chainIds || [],
3232
contract_addresses: params.contextFilters.contractAddresses || [],
33+
wallet_addresses: params.contextFilters.walletAddresses || [],
3334
};
3435
}
3536

apps/portal/mdx-components.tsx

Lines changed: 87 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { CodeBlock, InlineCode } from "@/components/Document/Code";
1+
import { CodeBlock } from "@/components/Document/Code";
22
import { DocLink } from "@/components/Document/DocLink";
33
import { Heading } from "@/components/Document/Heading";
44
import { OrderedList, UnorderedList } from "@/components/Document/List";
@@ -8,97 +8,98 @@ import { TBody, Table, Td, Th, Tr } from "@/components/Document/Table";
88
import GithubSlugger from "github-slugger";
99
import type { MDXComponents } from "mdx/types";
1010
import type { BuiltinLanguage } from "shiki";
11+
import { InlineCode } from "./src/components/Document";
1112

1213
export function useMDXComponents(components: MDXComponents): MDXComponents {
13-
const slugger = new GithubSlugger();
14+
const slugger = new GithubSlugger();
1415

15-
function nameToLink(name: React.ReactNode) {
16-
if (typeof name !== "string") {
17-
return undefined;
18-
}
16+
function nameToLink(name: React.ReactNode) {
17+
if (typeof name !== "string") {
18+
return undefined;
19+
}
1920

20-
return slugger.slug(name);
21-
}
21+
return slugger.slug(name);
22+
}
2223

23-
function getHeading(
24-
depth: number,
25-
props: {
26-
children?: React.ReactNode;
27-
id?: string;
28-
},
29-
) {
30-
return (
31-
<Heading level={depth} id={props.id || nameToLink(props.children) || ""}>
32-
{props.children}
33-
</Heading>
34-
);
35-
}
24+
function getHeading(
25+
depth: number,
26+
props: {
27+
children?: React.ReactNode;
28+
id?: string;
29+
},
30+
) {
31+
return (
32+
<Heading level={depth} id={props.id || nameToLink(props.children) || ""}>
33+
{props.children}
34+
</Heading>
35+
);
36+
}
3637

37-
return {
38-
...components,
39-
a(props) {
40-
const { href, children } = props;
41-
return <DocLink href={href || ""}>{children}</DocLink>;
42-
},
43-
h1(props) {
44-
return getHeading(1, props);
45-
},
46-
h2(props) {
47-
return getHeading(2, props);
48-
},
49-
h3(props) {
50-
return getHeading(3, props);
51-
},
52-
h4(props) {
53-
return getHeading(4, props);
54-
},
55-
h5(props) {
56-
return getHeading(5, props);
57-
},
58-
h6(props) {
59-
return getHeading(6, props);
60-
},
61-
code(props) {
62-
const code = props.children;
63-
const lang = props.className?.replace("language-", "");
38+
return {
39+
...components,
40+
a(props) {
41+
const { href, children } = props;
42+
return <DocLink href={href || ""}>{children}</DocLink>;
43+
},
44+
h1(props) {
45+
return getHeading(1, props);
46+
},
47+
h2(props) {
48+
return getHeading(2, props);
49+
},
50+
h3(props) {
51+
return getHeading(3, props);
52+
},
53+
h4(props) {
54+
return getHeading(4, props);
55+
},
56+
h5(props) {
57+
return getHeading(5, props);
58+
},
59+
h6(props) {
60+
return getHeading(6, props);
61+
},
62+
code(props) {
63+
const code = props.children;
64+
const lang = props.className?.replace("language-", "");
6465

65-
if (!props.className) {
66-
return <InlineCode code={typeof code === "string" ? code : ""} />;
67-
}
66+
if (!props.className) {
67+
return <InlineCode code={typeof code === "string" ? code : ""} />;
68+
}
6869

69-
return (
70-
<CodeBlock
71-
lang={lang as BuiltinLanguage}
72-
code={typeof code === "string" ? code : ""}
73-
/>
74-
);
75-
},
76-
p(props) {
77-
return <Paragraph>{props.children}</Paragraph>;
78-
},
79-
ul(props) {
80-
return <UnorderedList>{props.children}</UnorderedList>;
81-
},
82-
ol(props) {
83-
return <OrderedList>{props.children}</OrderedList>;
84-
},
85-
hr() {
86-
return <Separator />;
87-
},
88-
table(props) {
89-
return <Table>{props.children}</Table>;
90-
},
91-
th(props) {
92-
return <Th>{props.children}</Th>;
93-
},
94-
td(props) {
95-
return <Td>{props.children}</Td>;
96-
},
97-
tr(props) {
98-
return <Tr>{props.children}</Tr>;
99-
},
100-
tbody(props) {
101-
return <TBody>{props.children}</TBody>;
102-
},
103-
};
70+
return (
71+
<CodeBlock
72+
lang={lang as BuiltinLanguage}
73+
code={typeof code === "string" ? code : ""}
74+
/>
75+
);
76+
},
77+
p(props) {
78+
return <Paragraph>{props.children}</Paragraph>;
79+
},
80+
ul(props) {
81+
return <UnorderedList>{props.children}</UnorderedList>;
82+
},
83+
ol(props) {
84+
return <OrderedList>{props.children}</OrderedList>;
85+
},
86+
hr() {
87+
return <Separator />;
88+
},
89+
table(props) {
90+
return <Table>{props.children}</Table>;
91+
},
92+
th(props) {
93+
return <Th>{props.children}</Th>;
94+
},
95+
td(props) {
96+
return <Td>{props.children}</Td>;
97+
},
98+
tr(props) {
99+
return <Tr>{props.children}</Tr>;
100+
},
101+
tbody(props) {
102+
return <TBody>{props.children}</TBody>;
103+
},
104+
};
104105
}
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
import { ApiEndpoint } from "@/components/Document/APIEndpointMeta/ApiEndpoint";
2+
import {
3+
nebulaAPI401Response,
4+
nebulaAPI422Response,
5+
nebulaContextFilterPathParameter,
6+
nebulaExecuteConfigPathParameter,
7+
nebulaSecretKeyHeaderParameter,
8+
nebulaSessionIdPathParameter,
9+
} from "../common";
10+
11+
const response200Example = `\
12+
{
13+
"message": "string",
14+
"actions": [
15+
{
16+
"session_id": "string",
17+
"request_id": "string",
18+
"type": "init",
19+
"source": "string",
20+
"data": "string"
21+
}
22+
],
23+
"session_id": "string",
24+
"request_id": "string"
25+
}`;
26+
27+
export function EndpointMetadata() {
28+
return (
29+
<ApiEndpoint
30+
metadata={{
31+
title: "Send Message",
32+
description: "Process a chat message and return the response",
33+
origin: "https://nebula-api.thirdweb.com",
34+
path: "/chat",
35+
method: "POST",
36+
request: {
37+
pathParameters: [],
38+
headers: [nebulaSecretKeyHeaderParameter],
39+
bodyParameters: [
40+
{
41+
name: "message",
42+
required: true,
43+
description: "The message to be processed.",
44+
type: "string",
45+
example: "Hello",
46+
},
47+
{
48+
name: "stream",
49+
required: false,
50+
description: "Whether to stream the response or not",
51+
type: "boolean",
52+
example: false,
53+
},
54+
{
55+
...nebulaSessionIdPathParameter,
56+
required: false,
57+
description:
58+
"The session ID to associate with the message. If not provided, a new session will be created.",
59+
},
60+
nebulaExecuteConfigPathParameter,
61+
nebulaContextFilterPathParameter,
62+
],
63+
},
64+
responseExamples: {
65+
200: response200Example,
66+
401: nebulaAPI401Response,
67+
422: nebulaAPI422Response,
68+
},
69+
}}
70+
/>
71+
);
72+
}

apps/portal/src/app/nebula/api-reference/chat/data.jsx

Lines changed: 0 additions & 100 deletions
This file was deleted.

0 commit comments

Comments
 (0)