From 409f4b69e0634875893ba18589db6e213636cc51 Mon Sep 17 00:00:00 2001 From: Brian Joseph Petro Date: Sun, 8 Dec 2024 16:09:58 -0500 Subject: [PATCH] init smart-templates new --- smart-templates-2/index.js | 0 smart-templates-2/package.json | 38 +++++++++++++++++++++++ smart-templates-2/smart_template.js | 0 smart-templates-2/smart_templates.js | 0 smart-templates-2/source_adapters/json.js | 0 smart-templates-2/templates/lookup.json | 35 +++++++++++++++++++++ smart-templates/templates/lookup.json | 5 --- 7 files changed, 73 insertions(+), 5 deletions(-) create mode 100644 smart-templates-2/index.js create mode 100644 smart-templates-2/package.json create mode 100644 smart-templates-2/smart_template.js create mode 100644 smart-templates-2/smart_templates.js create mode 100644 smart-templates-2/source_adapters/json.js create mode 100644 smart-templates-2/templates/lookup.json delete mode 100644 smart-templates/templates/lookup.json diff --git a/smart-templates-2/index.js b/smart-templates-2/index.js new file mode 100644 index 00000000..e69de29b diff --git a/smart-templates-2/package.json b/smart-templates-2/package.json new file mode 100644 index 00000000..8bd1c5cf --- /dev/null +++ b/smart-templates-2/package.json @@ -0,0 +1,38 @@ +{ + "name": "smart-templates", + "author": "Brian Joseph Petro (🌴 Brian)", + "license": "MIT", + "version": "1.0.2", + "type": "module", + "description": "Smart templates for generating content with AI.", + "main": "smart_templates.js", + "keywords": [ + "templates", + "ai" + ], + "repository": { + "type": "git", + "url": "brianpetro/jsbrains" + }, + "bugs": { + "url": "https://github.com/brianpetro/jsbrains/issues" + }, + "homepage": "https://jsbrains.org", + "dependencies": { + "smart-chat-model": "file:../smart-chat-model", + "smart-sources": "file:../smart-sources" + }, + "devDependencies": { + "ava": "^6.1.3", + "dotenv": "^16.4.5" + }, + "scripts": { + "test": "npx ava --verbose" + }, + "ava": { + "files": [ + "smart_templates.test.js", + "**/*.test.js" + ] + } +} diff --git a/smart-templates-2/smart_template.js b/smart-templates-2/smart_template.js new file mode 100644 index 00000000..e69de29b diff --git a/smart-templates-2/smart_templates.js b/smart-templates-2/smart_templates.js new file mode 100644 index 00000000..e69de29b diff --git a/smart-templates-2/source_adapters/json.js b/smart-templates-2/source_adapters/json.js new file mode 100644 index 00000000..e69de29b diff --git a/smart-templates-2/templates/lookup.json b/smart-templates-2/templates/lookup.json new file mode 100644 index 00000000..2f426e9d --- /dev/null +++ b/smart-templates-2/templates/lookup.json @@ -0,0 +1,35 @@ +{ + "opts": {}, + "tool": { + "lookup": { + "type": "function", + "function": { + "name": "lookup", + "description": "Performs a semantic search of the user's data. Use this function to respond to queries like 'Based on my notes...' or any other request that requires surfacing relevant content.", + "parameters": { + "type": "object", + "properties": { + "hypotheticals": { + "type": "object", + "description": "Short hypothetical notes predicted to be semantically similar to the notes necessary to fulfill the user's request. Provide at least three hypotheticals per request. The hypothetical notes may contain paragraphs, lists, or checklists in markdown format. Each hypothetical note should begin with breadcrumbs indicating the anticipated folder(s), file name, and relevant headings separated by ' > ' (no slashes). Example: PARENT FOLDER NAME > CHILD FOLDER NAME > FILE NAME > HEADING 1 > HEADING 2 > HEADING 3: HYPOTHETICAL NOTE CONTENTS.", + "properties": { + "1": { + "type": "string" + }, + "2": { + "type": "string" + }, + "3": { + "type": "string" + } + }, + "required": ["1", "2", "3"] + } + }, + "required": ["hypotheticals"] + } + } + } + }, + "output": {} +} \ No newline at end of file diff --git a/smart-templates/templates/lookup.json b/smart-templates/templates/lookup.json deleted file mode 100644 index 2df434b8..00000000 --- a/smart-templates/templates/lookup.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "opts": {}, - "tool": {}, - "output": {} -} \ No newline at end of file