@aj-archipelago/cortex 1.3.47 → 1.3.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config.js +1 -1
- package/lib/pathwayTools.js +2 -2
- package/package.json +1 -1
- package/pathways/system/entity/sys_entity_agent.js +3 -0
- package/pathways/system/entity/tools/sys_tool_coding.js +3 -0
- package/pathways/system/entity/tools/sys_tool_cognitive_search.js +4 -4
- package/pathways/system/entity/tools/sys_tool_readfile.js +2 -2
- package/pathways/system/entity/tools/sys_tool_remember.js +23 -1
package/config.js
CHANGED
|
@@ -138,7 +138,7 @@ var config = convict({
|
|
|
138
138
|
|
|
139
139
|
AI_EXPERTISE: "Your expertise includes journalism, journalistic ethics, researching and composing documents, writing code, solving math problems, logical analysis, and technology. You have access to real-time data and the ability to search the internet, news, wires, look at files or documents, watch and analyze video, examine images, take screenshots, generate images, solve hard math and logic problems, write code, and execute code in a sandboxed environment.",
|
|
140
140
|
|
|
141
|
-
AI_GROUNDING_INSTRUCTIONS: "Grounding your response: If you base part or all of your response on one or more search results, you MUST cite the source using a custom markdown directive of the form :cd_source[searchResultId]. There is NO other valid way to cite a source and a good UX depends on you using this directive correctly. Do not include other clickable links to the sourcewhen using the :cd_source[searchResultId] directive. Every search result has a unique searchResultId. You must include it verbatim, copied directly from the search results. Place the directives at the end of the phrase, sentence or paragraph that is grounded in that particular search result. If you are citing multiple search results, use multiple individual:cd_source[searchResultId] directives (e.g. :cd_source[searchResultId1] :cd_source[searchResultId2] :cd_source[searchResultId3] etc.)",
|
|
141
|
+
AI_GROUNDING_INSTRUCTIONS: "Grounding your response: If you base part or all of your response on one or more search results, you MUST cite the source using a custom markdown directive of the form :cd_source[searchResultId]. There is NO other valid way to cite a source and a good UX depends on you using this directive correctly. Do not include other clickable links to the sourcewhen using the :cd_source[searchResultId] directive. Every search result has a unique searchResultId. You must include it verbatim, copied directly from the search results. Place the directives at the end of the phrase, sentence or paragraph that is grounded in that particular search result. If you are citing multiple search results, use multiple individual :cd_source[searchResultId] directives (e.g. :cd_source[searchResultId1] :cd_source[searchResultId2] :cd_source[searchResultId3] etc.)",
|
|
142
142
|
|
|
143
143
|
AI_STYLE_OPENAI: "oai-gpt41",
|
|
144
144
|
AI_STYLE_ANTHROPIC: "claude-35-sonnet-vertex",
|
package/lib/pathwayTools.js
CHANGED
|
@@ -178,12 +178,12 @@ const gpt3Decode = (text) => {
|
|
|
178
178
|
return decode(text);
|
|
179
179
|
}
|
|
180
180
|
|
|
181
|
-
const say = async (requestId, message, maxMessageLength = Infinity, voiceResponse = true) => {
|
|
181
|
+
const say = async (requestId, message, maxMessageLength = Infinity, voiceResponse = true, isEphemeral = true) => {
|
|
182
182
|
try {
|
|
183
183
|
const chunks = getSemanticChunks(message, maxMessageLength);
|
|
184
184
|
|
|
185
185
|
const info = JSON.stringify({
|
|
186
|
-
ephemeral:
|
|
186
|
+
ephemeral: isEphemeral,
|
|
187
187
|
});
|
|
188
188
|
|
|
189
189
|
for (let chunk of chunks) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aj-archipelago/cortex",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.48",
|
|
4
4
|
"description": "Cortex is a GraphQL API for AI. It provides a simple, extensible interface for using AI services from OpenAI, Azure and others.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"repository": {
|
|
@@ -209,6 +209,9 @@ export default {
|
|
|
209
209
|
// clear any accumulated pathwayResolver errors from the tools
|
|
210
210
|
pathwayResolver.errors = [];
|
|
211
211
|
|
|
212
|
+
// Add a line break to avoid running output together
|
|
213
|
+
await say(pathwayResolver.rootRequestId || pathwayResolver.requestId, `\n`, 1000, false, false);
|
|
214
|
+
|
|
212
215
|
return await pathwayResolver.promptAndParse({
|
|
213
216
|
...args,
|
|
214
217
|
tools: entityToolsOpenAiFormat,
|
|
@@ -22,6 +22,8 @@ export default {
|
|
|
22
22
|
useInputChunking: false,
|
|
23
23
|
enableDuplicateRequests: false,
|
|
24
24
|
timeout: 600,
|
|
25
|
+
// Tool disabled for now
|
|
26
|
+
/*
|
|
25
27
|
toolDefinition: [{
|
|
26
28
|
type: "function",
|
|
27
29
|
icon: "💻",
|
|
@@ -44,6 +46,7 @@ export default {
|
|
|
44
46
|
}
|
|
45
47
|
}
|
|
46
48
|
}],
|
|
49
|
+
*/
|
|
47
50
|
|
|
48
51
|
executePathway: async ({args, runAllPrompts, resolver}) => {
|
|
49
52
|
if (args.detailedInstructions) {
|
|
@@ -24,7 +24,7 @@ export default {
|
|
|
24
24
|
icon: "📂",
|
|
25
25
|
function: {
|
|
26
26
|
name: "SearchPersonal",
|
|
27
|
-
description: "Search through the user's index of personal documents and indexed uploaded files
|
|
27
|
+
description: "Search through the user's index of personal documents and indexed uploaded files and retrieve the content of the files. Use this tool if the user refers to a file or a document that you don't see uploaded elsewhere in your context. Some file types (e.g. Word documents, Excel documents, very large files, etc.) cannot be attached to a message and will be chunked and indexed and stored in the personal index.",
|
|
28
28
|
parameters: {
|
|
29
29
|
type: "object",
|
|
30
30
|
properties: {
|
|
@@ -58,7 +58,7 @@ export default {
|
|
|
58
58
|
icon: "📰",
|
|
59
59
|
function: {
|
|
60
60
|
name: "SearchAJA",
|
|
61
|
-
description: "Search
|
|
61
|
+
description: "Search Al Jazeera Arabic news articles. Use this for finding Arabic news content including the latest news and articles.",
|
|
62
62
|
parameters: {
|
|
63
63
|
type: "object",
|
|
64
64
|
properties: {
|
|
@@ -92,7 +92,7 @@ export default {
|
|
|
92
92
|
icon: "📰",
|
|
93
93
|
function: {
|
|
94
94
|
name: "SearchAJE",
|
|
95
|
-
description: "Search
|
|
95
|
+
description: "Search Al Jazeera English news articles. Use this for finding English news content including the latest news and articles.",
|
|
96
96
|
parameters: {
|
|
97
97
|
type: "object",
|
|
98
98
|
properties: {
|
|
@@ -126,7 +126,7 @@ export default {
|
|
|
126
126
|
icon: "⚡️",
|
|
127
127
|
function: {
|
|
128
128
|
name: "SearchWires",
|
|
129
|
-
description: "Search through news wires from
|
|
129
|
+
description: "Search through news wires from Reuters, AFP, AP, and other news agencies. Use this for finding the latest news and articles from the wires.",
|
|
130
130
|
parameters: {
|
|
131
131
|
type: "object",
|
|
132
132
|
properties: {
|
|
@@ -27,7 +27,7 @@ export default {
|
|
|
27
27
|
icon: "📄",
|
|
28
28
|
function: {
|
|
29
29
|
name: "PDF",
|
|
30
|
-
description: "Use specifically for analyzing and answering questions about PDF file content.",
|
|
30
|
+
description: "Use specifically for analyzing and answering questions about PDF file content. Do not use this tool for analyzing and answering questions about other file types.",
|
|
31
31
|
parameters: {
|
|
32
32
|
type: "object",
|
|
33
33
|
properties: {
|
|
@@ -49,7 +49,7 @@ export default {
|
|
|
49
49
|
icon: "📝",
|
|
50
50
|
function: {
|
|
51
51
|
name: "Text",
|
|
52
|
-
description: "Use specifically for analyzing and answering questions about text files.",
|
|
52
|
+
description: "Use specifically for analyzing and answering questions about text and csv files.",
|
|
53
53
|
parameters: {
|
|
54
54
|
type: "object",
|
|
55
55
|
properties: {
|
|
@@ -8,11 +8,33 @@ export default {
|
|
|
8
8
|
model: 'oai-gpt41-mini',
|
|
9
9
|
|
|
10
10
|
toolDefinition: [{
|
|
11
|
+
type: "function",
|
|
12
|
+
icon: "🧩",
|
|
13
|
+
function: {
|
|
14
|
+
name: "SearchMemory",
|
|
15
|
+
description: "Use this tool to search your memory and remember information or details that may not be present in your short term or contextual memory. You should always use this tool before you answer questions about remembered information. It's critical that you never fabricate memories.",
|
|
16
|
+
parameters: {
|
|
17
|
+
type: "object",
|
|
18
|
+
properties: {
|
|
19
|
+
detailedInstructions: {
|
|
20
|
+
type: "string",
|
|
21
|
+
description: "Detailed description of what you want to see if you remember"
|
|
22
|
+
},
|
|
23
|
+
userMessage: {
|
|
24
|
+
type: "string",
|
|
25
|
+
description: "A user-friendly message that describes what you're doing with this tool"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
required: ["detailedInstructions", "userMessage"]
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
{
|
|
11
33
|
type: "function",
|
|
12
34
|
icon: "🧩",
|
|
13
35
|
function: {
|
|
14
36
|
name: "Remember",
|
|
15
|
-
description: "
|
|
37
|
+
description: "When the user asks you if you remember something, you must use this tool before you answer. It's critical that you never fabricate memories.",
|
|
16
38
|
parameters: {
|
|
17
39
|
type: "object",
|
|
18
40
|
properties: {
|