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

Release schema updates #52

Merged
merged 3 commits into from
Apr 27, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion nexus/components/src/AI/Nexus.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ useEffect(() => {

const [activeTabs, setActiveTabs] = useState(
storedTabs || {
datasets: "alignmentDataset",
datasets: "trainingDataset",
models: "modelProvider",
agents: "agent",
agentTools: "contractTool",
Expand Down
37 changes: 22 additions & 15 deletions nexus/components/src/AI/Overview.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -538,29 +538,36 @@ return (
title="Contribute to the NEAR AI Nexus"
text={<>This directory is all on-chain.</>}
>
<Grid $gap="20px" $columns="1fr 1fr">
<TrendingApp
href="https://github.com/near/ai-platform/tree/develop/nexus/components/src/AI/Schema"
url="https://near.org/_next/static/media/near-icon.2e682d59.svg"
name="ai-platform"
loading={false}
/>
<TrendingApp
href="https://github.com/near/near-discovery-components/tree/develop/src/Entities/Template"
url="https://near.org/_next/static/media/near-icon.2e682d59.svg"
name="entity-components"
loading={false}
/>
<Grid $gap="20px" $columns="1fr">
<p>
Here at the NEAR AI Nexus you can find AI projects from across the
NEAR ecosystem then compose them into new combinations. Sign in to
add or fork any of the existing resource types.
add or fork any of the existing resource types. It's easy to upload
Datasets, Models, Agent Frameworks, and more.
</p>
<p>
If you need more, this UI is composed of React-on-Chain components
as is the schema for each type of resource. You can add new fields
to resources and add whole new types of resources.
to resources and add new types of resources. To do so, open a PR on
ai-platform.
</p>
<TrendingApp
href="https://github.com/near/ai-platform/tree/develop/nexus/components/src/AI/Schema"
url="https://near.org/_next/static/media/near-icon.2e682d59.svg"
name="ai-platform"
loading={false}
/>
<p>
If you'd like to build a similar UI for your own project, you can
use the same Entity Framework of React-on-Chain components to launch
a production site in under a minute.
</p>
<TrendingApp
href="https://github.com/near/near-discovery-components/tree/develop/src/Entities/Examples"
url="https://near.org/_next/static/media/near-icon.2e682d59.svg"
name="entity-components"
loading={false}
/>
</Grid>
</Card>
</Section>
Expand Down
4 changes: 1 addition & 3 deletions nexus/components/src/AI/Schema/Agent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ const { genSchema: genericGenSchema } = VM.require(
"${REPL_ACCOUNT}/widget/Entities.Template.GenericSchema",
);

const genSchema = (ignored) => {
const namespace = "near";
const entityType = "agent";
const genSchema = (namespace, entityType, title) => {
const entityTitle = "Agent";

const genericSchema = genericGenSchema(namespace, entityType, entityTitle);
Expand Down
27 changes: 27 additions & 0 deletions nexus/components/src/AI/Schema/AgentFramework.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
const { genSchema: genericGenSchema } = VM.require(
"${REPL_ACCOUNT}/widget/Entities.Template.GenericSchema",
);

const genSchema = (ignored) => {
const namespace = "near";
const entityType = "trainingDataset";
const entityTitle = "Training Dataset";

const genericSchema = genericGenSchema(namespace, entityType, entityTitle);
return {
...genericSchema,
code: {
type: "string",
inputProps: {
min: 0,
max: 2048,
placeholder: `https://github.com/... or other repository url`,
required: false,
},
label: "Repository url",
order: 10,
},
};
};

return { genSchema };
4 changes: 1 addition & 3 deletions nexus/components/src/AI/Schema/ModelName.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ const { genSchema: genericGenSchema } = VM.require(
"${REPL_ACCOUNT}/widget/Entities.Template.GenericSchema",
);

const genSchema = (ignored) => {
const namespace = "near";
const entityType = "modelName";
const genSchema = (namespace, entityType, title) => {
const entityTitle = "Model Name";

const genericSchema = genericGenSchema(namespace, entityType, entityTitle);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// define apiSchema and credential types

const apiSchema = {
chat: {
type: "string",
Expand All @@ -23,23 +25,21 @@ const { genSchema: genericGenSchema } = VM.require(
"${REPL_ACCOUNT}/widget/Entities.Template.GenericSchema",
);

const genSchema = (ignored) => {
const namespace = "near";
const entityType = "provider";
const entityTitle = "Provider";
const genSchema = (namespace, entityType, title) => {
const entityTitle = title ?? "Provider";

const genericSchema = genericGenSchema(namespace, entityType, entityTitle);
return {
...genericSchema,
category: {
documentationUrl: {
type: "string",
inputProps: {
min: 4,
max: 255,
placeholder: `Category: Compute marketplace, Provable training, Distributed training, Provable Inference`,
placeholder: `https://...`,
required: false,
},
label: "Category",
label: "Documentation URL",
order: 10,
},
};
Expand Down
13 changes: 7 additions & 6 deletions nexus/components/src/AI/Schema/Nexus.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const schema = {
datasets: {
title: "Datasets",
icon: "ph ph-list-checks",
defaultValue: "alignmentDataset",
defaultValue: "trainingDataset",
items: [
{
name: "Crowdsourcing",
Expand Down Expand Up @@ -60,6 +60,7 @@ const schema = {
src="${REPL_ACCOUNT}/widget/Entities.Template.GenericEntityConfig"
props={{
entityType: "trainingDataset",
schemaFile: "${REPL_ACCOUNT}/widget/AI.Schema.TrainingDataset",
...contentProps,
}}
/>
Expand All @@ -81,7 +82,7 @@ const schema = {
src="${REPL_ACCOUNT}/widget/Entities.Template.GenericEntityConfig"
props={{
entityType: "modelProvider",
schemaFile: "${REPL_ACCOUNT}/widget/AI.Schema.Provider",
schemaFile: "${REPL_ACCOUNT}/widget/AI.Schema.ModelProvider",
...contentProps,
}}
/>
Expand Down Expand Up @@ -152,7 +153,7 @@ const schema = {
}}
/>
),
icon: "ph ph-factory", // ph-blueprint after upgrade to 2.1.0
icon: "ph ph-blueprint",
},
{
name: "Modules",
Expand Down Expand Up @@ -218,7 +219,7 @@ const schema = {
}}
/>
),
icon: "ph ph-computer-tower", // ph-network after 2.1.0 upgrade
icon: "ph ph-network",
},
],
},
Expand Down Expand Up @@ -290,7 +291,7 @@ const schema = {
}}
/>
),
icon: "ph ph-seal-question", // ph-seal-percent after 2.1.0 upgrade
icon: "ph ph-seal-percent",
},
{
name: "Agent Reputation",
Expand All @@ -304,7 +305,7 @@ const schema = {
}}
/>
),
icon: "ph ph-crown-simple", // ph-ranking after 2.1.0 upgrade
icon: "ph ph-ranking",
},
{
name: "Compliance Proofs",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ const { genSchema: genericGenSchema } = VM.require(

const genSchema = (ignored) => {
const namespace = "near";
const entityType = "alignmentDataset";
const entityTitle = "Alignment Dataset";
const entityType = "trainingDataset";
const entityTitle = "Training Dataset";

const genericSchema = genericGenSchema(namespace, entityType, entityTitle);
return {
Expand Down
Loading