From 3fcda1f9e49434c718a0e75ce9baf9b0921f801e Mon Sep 17 00:00:00 2001 From: Gabe Hamilton Date: Tue, 23 Apr 2024 16:01:14 -0600 Subject: [PATCH 1/3] Schema for training datasets --- nexus/components/src/AI/Schema/Nexus.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/nexus/components/src/AI/Schema/Nexus.jsx b/nexus/components/src/AI/Schema/Nexus.jsx index 86410ed..5ccefbd 100644 --- a/nexus/components/src/AI/Schema/Nexus.jsx +++ b/nexus/components/src/AI/Schema/Nexus.jsx @@ -60,6 +60,7 @@ const schema = { src="${REPL_ACCOUNT}/widget/Entities.Template.GenericEntityConfig" props={{ entityType: "trainingDataset", + schemaFile: "${REPL_ACCOUNT}/widget/AI.Schema.TrainingDataset", ...contentProps, }} /> From ad67dcfb352329e586232dcc1328d5282dc38f50 Mon Sep 17 00:00:00 2001 From: Gabe Hamilton Date: Tue, 23 Apr 2024 16:01:43 -0600 Subject: [PATCH 2/3] Schema for training datasets --- .../AI/Schema/{AlignmentDataset.jsx => TrainingDataset.jsx} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename nexus/components/src/AI/Schema/{AlignmentDataset.jsx => TrainingDataset.jsx} (86%) diff --git a/nexus/components/src/AI/Schema/AlignmentDataset.jsx b/nexus/components/src/AI/Schema/TrainingDataset.jsx similarity index 86% rename from nexus/components/src/AI/Schema/AlignmentDataset.jsx rename to nexus/components/src/AI/Schema/TrainingDataset.jsx index aa0e5f1..dedb1b3 100644 --- a/nexus/components/src/AI/Schema/AlignmentDataset.jsx +++ b/nexus/components/src/AI/Schema/TrainingDataset.jsx @@ -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 { From f61f5c11b3ab81ca5fd655582b23033f5746d212 Mon Sep 17 00:00:00 2001 From: Gabe Hamilton Date: Sat, 27 Apr 2024 17:34:51 -0600 Subject: [PATCH 3/3] Schema updates --- nexus/components/src/AI/Nexus.jsx | 2 +- nexus/components/src/AI/Overview.jsx | 37 +++++++++++-------- nexus/components/src/AI/Schema/Agent.jsx | 4 +- .../src/AI/Schema/AgentFramework.jsx | 27 ++++++++++++++ nexus/components/src/AI/Schema/ModelName.jsx | 4 +- .../{Provider.jsx => ModelProvider.jsx} | 14 +++---- nexus/components/src/AI/Schema/Nexus.jsx | 12 +++--- 7 files changed, 65 insertions(+), 35 deletions(-) create mode 100644 nexus/components/src/AI/Schema/AgentFramework.jsx rename nexus/components/src/AI/Schema/{Provider.jsx => ModelProvider.jsx} (70%) diff --git a/nexus/components/src/AI/Nexus.jsx b/nexus/components/src/AI/Nexus.jsx index f2e7241..b622f5c 100644 --- a/nexus/components/src/AI/Nexus.jsx +++ b/nexus/components/src/AI/Nexus.jsx @@ -30,7 +30,7 @@ useEffect(() => { const [activeTabs, setActiveTabs] = useState( storedTabs || { - datasets: "alignmentDataset", + datasets: "trainingDataset", models: "modelProvider", agents: "agent", agentTools: "contractTool", diff --git a/nexus/components/src/AI/Overview.jsx b/nexus/components/src/AI/Overview.jsx index fa6679b..50b4214 100644 --- a/nexus/components/src/AI/Overview.jsx +++ b/nexus/components/src/AI/Overview.jsx @@ -538,29 +538,36 @@ return ( title="Contribute to the NEAR AI Nexus" text={<>This directory is all on-chain.} > - - - +

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.

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. +

+ +

+ 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.

+
diff --git a/nexus/components/src/AI/Schema/Agent.jsx b/nexus/components/src/AI/Schema/Agent.jsx index efa86bb..4cd1e72 100644 --- a/nexus/components/src/AI/Schema/Agent.jsx +++ b/nexus/components/src/AI/Schema/Agent.jsx @@ -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); diff --git a/nexus/components/src/AI/Schema/AgentFramework.jsx b/nexus/components/src/AI/Schema/AgentFramework.jsx new file mode 100644 index 0000000..a575f3c --- /dev/null +++ b/nexus/components/src/AI/Schema/AgentFramework.jsx @@ -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 }; diff --git a/nexus/components/src/AI/Schema/ModelName.jsx b/nexus/components/src/AI/Schema/ModelName.jsx index 7ef05d0..7b88d3b 100644 --- a/nexus/components/src/AI/Schema/ModelName.jsx +++ b/nexus/components/src/AI/Schema/ModelName.jsx @@ -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); diff --git a/nexus/components/src/AI/Schema/Provider.jsx b/nexus/components/src/AI/Schema/ModelProvider.jsx similarity index 70% rename from nexus/components/src/AI/Schema/Provider.jsx rename to nexus/components/src/AI/Schema/ModelProvider.jsx index 28cd862..1d92c3c 100644 --- a/nexus/components/src/AI/Schema/Provider.jsx +++ b/nexus/components/src/AI/Schema/ModelProvider.jsx @@ -1,3 +1,5 @@ +// define apiSchema and credential types + const apiSchema = { chat: { type: "string", @@ -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, }, }; diff --git a/nexus/components/src/AI/Schema/Nexus.jsx b/nexus/components/src/AI/Schema/Nexus.jsx index 5ccefbd..eadcc57 100644 --- a/nexus/components/src/AI/Schema/Nexus.jsx +++ b/nexus/components/src/AI/Schema/Nexus.jsx @@ -20,7 +20,7 @@ const schema = { datasets: { title: "Datasets", icon: "ph ph-list-checks", - defaultValue: "alignmentDataset", + defaultValue: "trainingDataset", items: [ { name: "Crowdsourcing", @@ -82,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, }} /> @@ -153,7 +153,7 @@ const schema = { }} /> ), - icon: "ph ph-factory", // ph-blueprint after upgrade to 2.1.0 + icon: "ph ph-blueprint", }, { name: "Modules", @@ -219,7 +219,7 @@ const schema = { }} /> ), - icon: "ph ph-computer-tower", // ph-network after 2.1.0 upgrade + icon: "ph ph-network", }, ], }, @@ -291,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", @@ -305,7 +305,7 @@ const schema = { }} /> ), - icon: "ph ph-crown-simple", // ph-ranking after 2.1.0 upgrade + icon: "ph ph-ranking", }, { name: "Compliance Proofs",