@aj-archipelago/cortex 1.3.62 → 1.3.63
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/.github/workflows/cortex-file-handler-test.yml +61 -0
- package/README.md +31 -7
- package/config/default.example.json +15 -0
- package/config.js +133 -12
- package/helper-apps/cortex-autogen2/DigiCertGlobalRootCA.crt.pem +22 -0
- package/helper-apps/cortex-autogen2/Dockerfile +31 -0
- package/helper-apps/cortex-autogen2/Dockerfile.worker +41 -0
- package/helper-apps/cortex-autogen2/README.md +183 -0
- package/helper-apps/cortex-autogen2/__init__.py +1 -0
- package/helper-apps/cortex-autogen2/agents.py +131 -0
- package/helper-apps/cortex-autogen2/docker-compose.yml +20 -0
- package/helper-apps/cortex-autogen2/function_app.py +55 -0
- package/helper-apps/cortex-autogen2/host.json +15 -0
- package/helper-apps/cortex-autogen2/main.py +126 -0
- package/helper-apps/cortex-autogen2/poetry.lock +3652 -0
- package/helper-apps/cortex-autogen2/pyproject.toml +36 -0
- package/helper-apps/cortex-autogen2/requirements.txt +20 -0
- package/helper-apps/cortex-autogen2/send_task.py +105 -0
- package/helper-apps/cortex-autogen2/services/__init__.py +1 -0
- package/helper-apps/cortex-autogen2/services/azure_queue.py +85 -0
- package/helper-apps/cortex-autogen2/services/redis_publisher.py +153 -0
- package/helper-apps/cortex-autogen2/task_processor.py +488 -0
- package/helper-apps/cortex-autogen2/tools/__init__.py +24 -0
- package/helper-apps/cortex-autogen2/tools/azure_blob_tools.py +175 -0
- package/helper-apps/cortex-autogen2/tools/azure_foundry_agents.py +601 -0
- package/helper-apps/cortex-autogen2/tools/coding_tools.py +72 -0
- package/helper-apps/cortex-autogen2/tools/download_tools.py +48 -0
- package/helper-apps/cortex-autogen2/tools/file_tools.py +545 -0
- package/helper-apps/cortex-autogen2/tools/search_tools.py +646 -0
- package/helper-apps/cortex-azure-cleaner/README.md +36 -0
- package/helper-apps/cortex-file-converter/README.md +93 -0
- package/helper-apps/cortex-file-converter/key_to_pdf.py +104 -0
- package/helper-apps/cortex-file-converter/list_blob_extensions.py +89 -0
- package/helper-apps/cortex-file-converter/process_azure_keynotes.py +181 -0
- package/helper-apps/cortex-file-converter/requirements.txt +1 -0
- package/helper-apps/cortex-file-handler/.env.test.azure.ci +7 -0
- package/helper-apps/cortex-file-handler/.env.test.azure.sample +1 -1
- package/helper-apps/cortex-file-handler/.env.test.gcs.ci +10 -0
- package/helper-apps/cortex-file-handler/.env.test.gcs.sample +2 -2
- package/helper-apps/cortex-file-handler/INTERFACE.md +41 -0
- package/helper-apps/cortex-file-handler/package.json +1 -1
- package/helper-apps/cortex-file-handler/scripts/setup-azure-container.js +41 -17
- package/helper-apps/cortex-file-handler/scripts/setup-test-containers.js +30 -15
- package/helper-apps/cortex-file-handler/scripts/test-azure.sh +32 -6
- package/helper-apps/cortex-file-handler/scripts/test-gcs.sh +24 -2
- package/helper-apps/cortex-file-handler/scripts/validate-env.js +128 -0
- package/helper-apps/cortex-file-handler/src/blobHandler.js +161 -51
- package/helper-apps/cortex-file-handler/src/constants.js +3 -0
- package/helper-apps/cortex-file-handler/src/fileChunker.js +10 -8
- package/helper-apps/cortex-file-handler/src/index.js +116 -9
- package/helper-apps/cortex-file-handler/src/redis.js +61 -1
- package/helper-apps/cortex-file-handler/src/services/ConversionService.js +11 -8
- package/helper-apps/cortex-file-handler/src/services/FileConversionService.js +2 -2
- package/helper-apps/cortex-file-handler/src/services/storage/AzureStorageProvider.js +88 -6
- package/helper-apps/cortex-file-handler/src/services/storage/GCSStorageProvider.js +58 -0
- package/helper-apps/cortex-file-handler/src/services/storage/StorageFactory.js +25 -5
- package/helper-apps/cortex-file-handler/src/services/storage/StorageProvider.js +9 -0
- package/helper-apps/cortex-file-handler/src/services/storage/StorageService.js +120 -16
- package/helper-apps/cortex-file-handler/src/start.js +27 -17
- package/helper-apps/cortex-file-handler/tests/FileConversionService.test.js +52 -1
- package/helper-apps/cortex-file-handler/tests/blobHandler.test.js +40 -0
- package/helper-apps/cortex-file-handler/tests/checkHashShortLived.test.js +553 -0
- package/helper-apps/cortex-file-handler/tests/cleanup.test.js +46 -52
- package/helper-apps/cortex-file-handler/tests/containerConversionFlow.test.js +451 -0
- package/helper-apps/cortex-file-handler/tests/containerNameParsing.test.js +229 -0
- package/helper-apps/cortex-file-handler/tests/containerParameterFlow.test.js +392 -0
- package/helper-apps/cortex-file-handler/tests/conversionResilience.test.js +7 -2
- package/helper-apps/cortex-file-handler/tests/deleteOperations.test.js +348 -0
- package/helper-apps/cortex-file-handler/tests/fileChunker.test.js +23 -2
- package/helper-apps/cortex-file-handler/tests/fileUpload.test.js +11 -5
- package/helper-apps/cortex-file-handler/tests/getOperations.test.js +58 -24
- package/helper-apps/cortex-file-handler/tests/postOperations.test.js +11 -4
- package/helper-apps/cortex-file-handler/tests/shortLivedUrlConversion.test.js +225 -0
- package/helper-apps/cortex-file-handler/tests/start.test.js +8 -12
- package/helper-apps/cortex-file-handler/tests/storage/StorageFactory.test.js +80 -0
- package/helper-apps/cortex-file-handler/tests/storage/StorageService.test.js +388 -22
- package/helper-apps/cortex-file-handler/tests/testUtils.helper.js +74 -0
- package/lib/cortexResponse.js +153 -0
- package/lib/entityConstants.js +21 -3
- package/lib/logger.js +21 -4
- package/lib/pathwayTools.js +28 -9
- package/lib/util.js +49 -0
- package/package.json +1 -1
- package/pathways/basePathway.js +1 -0
- package/pathways/bing_afagent.js +54 -1
- package/pathways/call_tools.js +2 -3
- package/pathways/chat_jarvis.js +1 -1
- package/pathways/google_cse.js +27 -0
- package/pathways/grok_live_search.js +18 -0
- package/pathways/system/entity/memory/sys_memory_lookup_required.js +1 -0
- package/pathways/system/entity/memory/sys_memory_required.js +1 -0
- package/pathways/system/entity/memory/sys_search_memory.js +1 -0
- package/pathways/system/entity/sys_entity_agent.js +56 -4
- package/pathways/system/entity/sys_generator_quick.js +1 -0
- package/pathways/system/entity/tools/sys_tool_bing_search_afagent.js +26 -0
- package/pathways/system/entity/tools/sys_tool_google_search.js +141 -0
- package/pathways/system/entity/tools/sys_tool_grok_x_search.js +237 -0
- package/pathways/system/entity/tools/sys_tool_image.js +1 -1
- package/pathways/system/rest_streaming/sys_claude_37_sonnet.js +21 -0
- package/pathways/system/rest_streaming/sys_claude_41_opus.js +21 -0
- package/pathways/system/rest_streaming/sys_claude_4_sonnet.js +21 -0
- package/pathways/system/rest_streaming/sys_google_gemini_25_flash.js +25 -0
- package/pathways/system/rest_streaming/{sys_google_gemini_chat.js → sys_google_gemini_25_pro.js} +6 -4
- package/pathways/system/rest_streaming/sys_grok_4.js +23 -0
- package/pathways/system/rest_streaming/sys_grok_4_fast_non_reasoning.js +23 -0
- package/pathways/system/rest_streaming/sys_grok_4_fast_reasoning.js +23 -0
- package/pathways/system/rest_streaming/sys_openai_chat.js +3 -0
- package/pathways/system/rest_streaming/sys_openai_chat_gpt41.js +22 -0
- package/pathways/system/rest_streaming/sys_openai_chat_gpt41_mini.js +21 -0
- package/pathways/system/rest_streaming/sys_openai_chat_gpt41_nano.js +21 -0
- package/pathways/system/rest_streaming/{sys_claude_35_sonnet.js → sys_openai_chat_gpt4_omni.js} +6 -4
- package/pathways/system/rest_streaming/sys_openai_chat_gpt4_omni_mini.js +21 -0
- package/pathways/system/rest_streaming/{sys_claude_3_haiku.js → sys_openai_chat_gpt5.js} +7 -5
- package/pathways/system/rest_streaming/sys_openai_chat_gpt5_chat.js +21 -0
- package/pathways/system/rest_streaming/sys_openai_chat_gpt5_mini.js +21 -0
- package/pathways/system/rest_streaming/sys_openai_chat_gpt5_nano.js +21 -0
- package/pathways/system/rest_streaming/{sys_openai_chat_o1.js → sys_openai_chat_o3.js} +6 -3
- package/pathways/system/rest_streaming/sys_openai_chat_o3_mini.js +3 -0
- package/pathways/system/workspaces/run_workspace_prompt.js +99 -0
- package/pathways/vision.js +1 -1
- package/server/graphql.js +1 -1
- package/server/modelExecutor.js +8 -0
- package/server/pathwayResolver.js +166 -16
- package/server/pathwayResponseParser.js +16 -8
- package/server/plugins/azureFoundryAgentsPlugin.js +1 -1
- package/server/plugins/claude3VertexPlugin.js +193 -45
- package/server/plugins/gemini15ChatPlugin.js +21 -0
- package/server/plugins/gemini15VisionPlugin.js +360 -0
- package/server/plugins/googleCsePlugin.js +94 -0
- package/server/plugins/grokVisionPlugin.js +365 -0
- package/server/plugins/modelPlugin.js +3 -1
- package/server/plugins/openAiChatPlugin.js +106 -13
- package/server/plugins/openAiVisionPlugin.js +42 -30
- package/server/resolver.js +28 -4
- package/server/rest.js +270 -53
- package/server/typeDef.js +1 -0
- package/tests/{mocks.js → helpers/mocks.js} +5 -2
- package/tests/{server.js → helpers/server.js} +2 -2
- package/tests/helpers/sseAssert.js +23 -0
- package/tests/helpers/sseClient.js +73 -0
- package/tests/helpers/subscriptionAssert.js +11 -0
- package/tests/helpers/subscriptions.js +113 -0
- package/tests/{sublong.srt → integration/features/translate/sublong.srt} +4543 -4543
- package/tests/integration/features/translate/translate_chunking_stream.test.js +100 -0
- package/tests/{translate_srt.test.js → integration/features/translate/translate_srt.test.js} +2 -2
- package/tests/integration/graphql/async/stream/agentic.test.js +477 -0
- package/tests/integration/graphql/async/stream/subscription_streaming.test.js +62 -0
- package/tests/integration/graphql/async/stream/sys_entity_start_streaming.test.js +71 -0
- package/tests/integration/graphql/async/stream/vendors/claude_streaming.test.js +56 -0
- package/tests/integration/graphql/async/stream/vendors/gemini_streaming.test.js +66 -0
- package/tests/integration/graphql/async/stream/vendors/grok_streaming.test.js +56 -0
- package/tests/integration/graphql/async/stream/vendors/openai_streaming.test.js +72 -0
- package/tests/integration/graphql/features/google/sysToolGoogleSearch.test.js +96 -0
- package/tests/integration/graphql/features/grok/grok.test.js +688 -0
- package/tests/integration/graphql/features/grok/grok_x_search_tool.test.js +354 -0
- package/tests/{main.test.js → integration/graphql/features/main.test.js} +1 -1
- package/tests/{call_tools.test.js → integration/graphql/features/tools/call_tools.test.js} +2 -2
- package/tests/{vision.test.js → integration/graphql/features/vision/vision.test.js} +1 -1
- package/tests/integration/graphql/subscriptions/connection.test.js +26 -0
- package/tests/{openai_api.test.js → integration/rest/oai/openai_api.test.js} +63 -238
- package/tests/integration/rest/oai/tool_calling_api.test.js +343 -0
- package/tests/integration/rest/oai/tool_calling_streaming.test.js +85 -0
- package/tests/integration/rest/vendors/claude_streaming.test.js +47 -0
- package/tests/integration/rest/vendors/claude_tool_calling_streaming.test.js +75 -0
- package/tests/integration/rest/vendors/gemini_streaming.test.js +47 -0
- package/tests/integration/rest/vendors/gemini_tool_calling_streaming.test.js +75 -0
- package/tests/integration/rest/vendors/grok_streaming.test.js +55 -0
- package/tests/integration/rest/vendors/grok_tool_calling_streaming.test.js +75 -0
- package/tests/{azureAuthTokenHelper.test.js → unit/core/azureAuthTokenHelper.test.js} +1 -1
- package/tests/{chunkfunction.test.js → unit/core/chunkfunction.test.js} +2 -2
- package/tests/{config.test.js → unit/core/config.test.js} +3 -3
- package/tests/{encodeCache.test.js → unit/core/encodeCache.test.js} +1 -1
- package/tests/{fastLruCache.test.js → unit/core/fastLruCache.test.js} +1 -1
- package/tests/{handleBars.test.js → unit/core/handleBars.test.js} +1 -1
- package/tests/{memoryfunction.test.js → unit/core/memoryfunction.test.js} +2 -2
- package/tests/unit/core/mergeResolver.test.js +952 -0
- package/tests/{parser.test.js → unit/core/parser.test.js} +3 -3
- package/tests/unit/core/pathwayResolver.test.js +187 -0
- package/tests/{requestMonitor.test.js → unit/core/requestMonitor.test.js} +1 -1
- package/tests/{requestMonitorDurationEstimator.test.js → unit/core/requestMonitorDurationEstimator.test.js} +1 -1
- package/tests/{truncateMessages.test.js → unit/core/truncateMessages.test.js} +3 -3
- package/tests/{util.test.js → unit/core/util.test.js} +1 -1
- package/tests/{apptekTranslatePlugin.test.js → unit/plugins/apptekTranslatePlugin.test.js} +3 -3
- package/tests/{azureFoundryAgents.test.js → unit/plugins/azureFoundryAgents.test.js} +136 -1
- package/tests/{claude3VertexPlugin.test.js → unit/plugins/claude3VertexPlugin.test.js} +32 -10
- package/tests/{claude3VertexToolConversion.test.js → unit/plugins/claude3VertexToolConversion.test.js} +3 -3
- package/tests/unit/plugins/googleCsePlugin.test.js +111 -0
- package/tests/unit/plugins/grokVisionPlugin.test.js +1392 -0
- package/tests/{modelPlugin.test.js → unit/plugins/modelPlugin.test.js} +3 -3
- package/tests/{multimodal_conversion.test.js → unit/plugins/multimodal_conversion.test.js} +4 -4
- package/tests/{openAiChatPlugin.test.js → unit/plugins/openAiChatPlugin.test.js} +13 -4
- package/tests/{openAiToolPlugin.test.js → unit/plugins/openAiToolPlugin.test.js} +35 -27
- package/tests/{tokenHandlingTests.test.js → unit/plugins/tokenHandlingTests.test.js} +5 -5
- package/tests/{translate_apptek.test.js → unit/plugins/translate_apptek.test.js} +3 -3
- package/tests/{streaming.test.js → unit/plugins.streaming/plugin_stream_events.test.js} +19 -58
- package/helper-apps/mogrt-handler/tests/test-files/test.gif +0 -1
- package/helper-apps/mogrt-handler/tests/test-files/test.mogrt +0 -1
- package/helper-apps/mogrt-handler/tests/test-files/test.mp4 +0 -1
- package/pathways/system/rest_streaming/sys_openai_chat_gpt4.js +0 -19
- package/pathways/system/rest_streaming/sys_openai_chat_gpt4_32.js +0 -19
- package/pathways/system/rest_streaming/sys_openai_chat_gpt4_turbo.js +0 -19
- package/pathways/system/workspaces/run_claude35_sonnet.js +0 -21
- package/pathways/system/workspaces/run_claude3_haiku.js +0 -20
- package/pathways/system/workspaces/run_gpt35turbo.js +0 -20
- package/pathways/system/workspaces/run_gpt4.js +0 -20
- package/pathways/system/workspaces/run_gpt4_32.js +0 -20
- package/tests/agentic.test.js +0 -256
- package/tests/pathwayResolver.test.js +0 -78
- package/tests/subscription.test.js +0 -387
- /package/tests/{subchunk.srt → integration/features/translate/subchunk.srt} +0 -0
- /package/tests/{subhorizontal.srt → integration/features/translate/subhorizontal.srt} +0 -0
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
// sys_tool_google_search.js
|
|
2
|
+
// Tool pathway that handles Google Custom Search functionality
|
|
3
|
+
import { callPathway } from '../../../../lib/pathwayTools.js';
|
|
4
|
+
import logger from '../../../../lib/logger.js';
|
|
5
|
+
import { config } from '../../../../config.js';
|
|
6
|
+
import { getSearchResultId } from '../../../../lib/util.js';
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
prompt: [],
|
|
10
|
+
timeout: 300,
|
|
11
|
+
toolDefinition: {
|
|
12
|
+
type: "function",
|
|
13
|
+
icon: "🔎",
|
|
14
|
+
function: {
|
|
15
|
+
name: "SearchInternetGoogle",
|
|
16
|
+
description: "Search the web using Google Custom Search (CSE). This is a simple pass-through tool: it calls Google CSE with your parameters and returns normalized results with unique IDs for citation. Prefer strict time filters and reputable sources via CSE parameters.",
|
|
17
|
+
parameters: {
|
|
18
|
+
type: "object",
|
|
19
|
+
properties: {
|
|
20
|
+
q: {
|
|
21
|
+
type: "string",
|
|
22
|
+
description: "The complete query to pass to Google CSE using Google's search syntax."
|
|
23
|
+
},
|
|
24
|
+
num: {
|
|
25
|
+
type: "integer",
|
|
26
|
+
description: "Number of results to return (1-10). Default 10."
|
|
27
|
+
},
|
|
28
|
+
start: {
|
|
29
|
+
type: "integer",
|
|
30
|
+
description: "The index of the first result to return for pagination (1-based)."
|
|
31
|
+
},
|
|
32
|
+
safe: {
|
|
33
|
+
type: "string",
|
|
34
|
+
description: "SafeSearch setting: 'off' or 'active'."
|
|
35
|
+
},
|
|
36
|
+
dateRestrict: {
|
|
37
|
+
type: "string",
|
|
38
|
+
description: "Restrict results to recent content (e.g., 'd1' for past day, 'w1' week, 'm1' month, 'y1' year)."
|
|
39
|
+
},
|
|
40
|
+
siteSearch: {
|
|
41
|
+
type: "string",
|
|
42
|
+
description: "Restrict results to a specific site or domain."
|
|
43
|
+
},
|
|
44
|
+
siteSearchFilter: {
|
|
45
|
+
type: "string",
|
|
46
|
+
description: "'e' to exclude or 'i' to include the siteSearch restriction."
|
|
47
|
+
},
|
|
48
|
+
cx: {
|
|
49
|
+
type: "string",
|
|
50
|
+
description: "Optional: override the default Google Custom Search Engine ID for this call."
|
|
51
|
+
},
|
|
52
|
+
searchType: {
|
|
53
|
+
type: "string",
|
|
54
|
+
description: "Set to 'image' to search for images."
|
|
55
|
+
},
|
|
56
|
+
gl: {
|
|
57
|
+
type: "string",
|
|
58
|
+
description: "Country code for results (geolocation)."
|
|
59
|
+
},
|
|
60
|
+
hl: {
|
|
61
|
+
type: "string",
|
|
62
|
+
description: "Interface language."
|
|
63
|
+
},
|
|
64
|
+
lr: {
|
|
65
|
+
type: "string",
|
|
66
|
+
description: "Restrict results by language (e.g., 'lang_en')."
|
|
67
|
+
},
|
|
68
|
+
sort: {
|
|
69
|
+
type: "string",
|
|
70
|
+
description: "Sorting expression (e.g., 'date')."
|
|
71
|
+
},
|
|
72
|
+
exactTerms: {
|
|
73
|
+
type: "string",
|
|
74
|
+
description: "Terms that must appear in the results."
|
|
75
|
+
},
|
|
76
|
+
excludeTerms: {
|
|
77
|
+
type: "string",
|
|
78
|
+
description: "Terms to exclude from results."
|
|
79
|
+
},
|
|
80
|
+
orTerms: {
|
|
81
|
+
type: "string",
|
|
82
|
+
description: "Alternative terms; results must include at least one."
|
|
83
|
+
},
|
|
84
|
+
fileType: {
|
|
85
|
+
type: "string",
|
|
86
|
+
description: "Restrict results by file type (e.g., 'pdf')."
|
|
87
|
+
},
|
|
88
|
+
userMessage: {
|
|
89
|
+
type: "string",
|
|
90
|
+
description: "A user-friendly message that describes what you're doing with this tool"
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
required: ["q", "userMessage"]
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
|
|
98
|
+
executePathway: async ({args, runAllPrompts, resolver}) => {
|
|
99
|
+
// Check if Google CSE credentials are available
|
|
100
|
+
const env = config.getEnv();
|
|
101
|
+
const googleKey = env["GOOGLE_CSE_KEY"];
|
|
102
|
+
const googleCx = env["GOOGLE_CSE_CX"];
|
|
103
|
+
if (!googleKey || !googleCx) {
|
|
104
|
+
throw new Error("Google Custom Search is not available - missing GOOGLE_CSE_KEY and/or GOOGLE_CSE_CX");
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
try {
|
|
108
|
+
// Pass-through: call Google CSE with provided args
|
|
109
|
+
const response = await callPathway('google_cse', {
|
|
110
|
+
...args
|
|
111
|
+
}, resolver);
|
|
112
|
+
|
|
113
|
+
if (resolver.errors && resolver.errors.length > 0) {
|
|
114
|
+
const errorMessages = Array.isArray(resolver.errors)
|
|
115
|
+
? resolver.errors.map(err => err.message || err)
|
|
116
|
+
: [resolver.errors.message || resolver.errors];
|
|
117
|
+
return JSON.stringify({ _type: "SearchError", value: errorMessages, recoveryMessage: "This tool failed. You should try the backup tool for this function." });
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
const parsedResponse = JSON.parse(response);
|
|
121
|
+
|
|
122
|
+
const results = [];
|
|
123
|
+
const items = parsedResponse.items || [];
|
|
124
|
+
// Normalize results from Google CSE items
|
|
125
|
+
for (const item of items) {
|
|
126
|
+
results.push({
|
|
127
|
+
searchResultId: getSearchResultId(),
|
|
128
|
+
title: item.title || item.htmlTitle || '',
|
|
129
|
+
url: item.link || item.formattedUrl || '',
|
|
130
|
+
content: item.snippet || item.htmlSnippet || ''
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
resolver.tool = JSON.stringify({ toolUsed: "GoogleSearch" });
|
|
135
|
+
return JSON.stringify({ _type: "SearchResponse", value: results });
|
|
136
|
+
} catch (e) {
|
|
137
|
+
logger.error(`Error in Google CSE search: ${e}`);
|
|
138
|
+
throw e;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
};
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
// sys_tool_grok_x_search.js
|
|
2
|
+
// Tool pathway that handles Grok Live Search functionality specifically for X platform search
|
|
3
|
+
import { callPathway } from '../../../../lib/pathwayTools.js';
|
|
4
|
+
import logger from '../../../../lib/logger.js';
|
|
5
|
+
import { getSearchResultId, extractCitationTitle } from '../../../../lib/util.js';
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
prompt: [],
|
|
9
|
+
timeout: 300,
|
|
10
|
+
inputParameters: {
|
|
11
|
+
text: '',
|
|
12
|
+
userMessage: '',
|
|
13
|
+
includedHandles: [''],
|
|
14
|
+
excludedHandles: [''],
|
|
15
|
+
minFavorites: 0,
|
|
16
|
+
minViews: 0,
|
|
17
|
+
maxResults: 10
|
|
18
|
+
},
|
|
19
|
+
toolDefinition: {
|
|
20
|
+
type: "function",
|
|
21
|
+
icon: "🔍",
|
|
22
|
+
function: {
|
|
23
|
+
name: "SearchXPlatform",
|
|
24
|
+
description: "This tool allows you to search the X platform (formerly Twitter) for current posts, discussions, and real-time information. Use this for finding recent social media content, trending topics, public opinions, and real-time updates. Always call this tool in parallel rather than serially if you have several searches to do as it will be faster.",
|
|
25
|
+
parameters: {
|
|
26
|
+
type: "object",
|
|
27
|
+
properties: {
|
|
28
|
+
text: {
|
|
29
|
+
type: "string",
|
|
30
|
+
description: "The complete natural language prompt describing what you want to search for on X platform. This can include topics, hashtags, usernames, or general queries about current events and discussions."
|
|
31
|
+
},
|
|
32
|
+
userMessage: {
|
|
33
|
+
type: "string",
|
|
34
|
+
description: "A user-friendly message that describes what you're doing with this tool"
|
|
35
|
+
},
|
|
36
|
+
includedHandles: {
|
|
37
|
+
type: "array",
|
|
38
|
+
items: { type: "string" },
|
|
39
|
+
description: "Optional array of X handles to include in search (e.g., ['OpenAI', 'AnthropicAI', 'xai']). Maximum 10 handles.",
|
|
40
|
+
maxItems: 10
|
|
41
|
+
},
|
|
42
|
+
excludedHandles: {
|
|
43
|
+
type: "array",
|
|
44
|
+
items: { type: "string" },
|
|
45
|
+
description: "Optional array of X handles to exclude from search. Maximum 10 handles. Cannot be used in conjunction with includedHandles.",
|
|
46
|
+
maxItems: 10
|
|
47
|
+
},
|
|
48
|
+
minFavorites: {
|
|
49
|
+
type: "number",
|
|
50
|
+
description: "Popularity filter: Minimum number of favorites (likes) for posts to include",
|
|
51
|
+
minimum: 0
|
|
52
|
+
},
|
|
53
|
+
minViews: {
|
|
54
|
+
type: "number",
|
|
55
|
+
description: "Popularity filter: Minimum number of views for posts to include",
|
|
56
|
+
minimum: 0
|
|
57
|
+
},
|
|
58
|
+
maxResults: {
|
|
59
|
+
type: "number",
|
|
60
|
+
description: "Maximum number of search results to return (default: 10, max: 50)",
|
|
61
|
+
minimum: 1,
|
|
62
|
+
maximum: 50,
|
|
63
|
+
default: 10
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
required: ["text", "userMessage"]
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
|
|
71
|
+
executePathway: async ({args, runAllPrompts, resolver}) => {
|
|
72
|
+
|
|
73
|
+
try {
|
|
74
|
+
// Build search parameters for X platform search
|
|
75
|
+
const searchParameters = {
|
|
76
|
+
mode: 'auto',
|
|
77
|
+
return_citations: true,
|
|
78
|
+
max_search_results: args.maxResults || 10,
|
|
79
|
+
sources: [{
|
|
80
|
+
type: 'x',
|
|
81
|
+
...(args.includedHandles && args.includedHandles.length > 0 && {
|
|
82
|
+
included_x_handles: args.includedHandles
|
|
83
|
+
}),
|
|
84
|
+
...(args.excludedHandles && args.excludedHandles.length > 0 && {
|
|
85
|
+
excluded_x_handles: args.excludedHandles
|
|
86
|
+
}),
|
|
87
|
+
...(args.minFavorites && {
|
|
88
|
+
post_favorite_count: args.minFavorites
|
|
89
|
+
}),
|
|
90
|
+
...(args.minViews && {
|
|
91
|
+
post_view_count: args.minViews
|
|
92
|
+
})
|
|
93
|
+
}]
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
// Call the Grok Live Search pathway
|
|
97
|
+
const { model, ...restArgs } = args;
|
|
98
|
+
const result = await callPathway('grok_live_search', {
|
|
99
|
+
...restArgs,
|
|
100
|
+
search_parameters: JSON.stringify(searchParameters)
|
|
101
|
+
}, resolver);
|
|
102
|
+
|
|
103
|
+
if (resolver.errors && resolver.errors.length > 0) {
|
|
104
|
+
const errorMessages = Array.isArray(resolver.errors)
|
|
105
|
+
? resolver.errors.map(err => err.message || err)
|
|
106
|
+
: [resolver.errors.message || resolver.errors];
|
|
107
|
+
return JSON.stringify({ _type: "SearchError", value: errorMessages });
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// Transform response to match expected SearchResponse format
|
|
111
|
+
function transformToSearchResponse(resultData, result) {
|
|
112
|
+
// Extract text and citations from CortexResponse
|
|
113
|
+
const valueText = result || '';
|
|
114
|
+
const citations = resultData.citations || [];
|
|
115
|
+
|
|
116
|
+
// Create a mapping from citation URLs to search result IDs
|
|
117
|
+
const citationToIdMap = new Map();
|
|
118
|
+
const finalSearchResults = [];
|
|
119
|
+
|
|
120
|
+
// Process citations array
|
|
121
|
+
if (Array.isArray(citations)) {
|
|
122
|
+
citations.forEach(citation => {
|
|
123
|
+
const searchResultId = citation.searchResultId || getSearchResultId();
|
|
124
|
+
|
|
125
|
+
// Check if we already have this URL in searchResults
|
|
126
|
+
const existingResult = finalSearchResults.find(r => r.url === citation.url);
|
|
127
|
+
if (!existingResult) {
|
|
128
|
+
finalSearchResults.push({
|
|
129
|
+
searchResultId: searchResultId,
|
|
130
|
+
title: citation.title || extractCitationTitle(citation.url),
|
|
131
|
+
url: citation.url,
|
|
132
|
+
content: citation.content || citation.title || extractCitationTitle(citation.url),
|
|
133
|
+
path: '',
|
|
134
|
+
wireid: '',
|
|
135
|
+
source: 'X Platform',
|
|
136
|
+
slugline: '',
|
|
137
|
+
date: ''
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// Create mapping for URL replacement
|
|
142
|
+
if (citation.url) {
|
|
143
|
+
citationToIdMap.set(citation.url, searchResultId);
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// Extract inline citations from the text in format [1](https://example.com) or [1(https://example.com)]
|
|
149
|
+
const inlineCitationPattern = /\[(\d+)\]\(([^)]+)\)|\[(\d+)\(([^)]+)\)\]/g;
|
|
150
|
+
let match;
|
|
151
|
+
const inlineCitations = new Set();
|
|
152
|
+
|
|
153
|
+
while ((match = inlineCitationPattern.exec(valueText)) !== null) {
|
|
154
|
+
// Handle both formats: [1](url) and [1(url)]
|
|
155
|
+
const citationNumber = match[1] || match[3];
|
|
156
|
+
const citationUrl = match[2] || match[4];
|
|
157
|
+
inlineCitations.add(citationUrl);
|
|
158
|
+
|
|
159
|
+
// If we haven't already processed this URL, add it to search results
|
|
160
|
+
if (!citationToIdMap.has(citationUrl)) {
|
|
161
|
+
const searchResultId = getSearchResultId();
|
|
162
|
+
citationToIdMap.set(citationUrl, searchResultId);
|
|
163
|
+
|
|
164
|
+
finalSearchResults.push({
|
|
165
|
+
searchResultId: searchResultId,
|
|
166
|
+
title: extractCitationTitle(citationUrl),
|
|
167
|
+
url: citationUrl,
|
|
168
|
+
content: extractCitationTitle(citationUrl),
|
|
169
|
+
path: '',
|
|
170
|
+
wireid: '',
|
|
171
|
+
source: 'X Platform',
|
|
172
|
+
slugline: '',
|
|
173
|
+
date: ''
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
// Replace inline citations with our standard format
|
|
179
|
+
let transformedText = valueText.replace(inlineCitationPattern, (match, num1, url1, num2, url2) => {
|
|
180
|
+
const url = url1 || url2;
|
|
181
|
+
const searchResultId = citationToIdMap.get(url);
|
|
182
|
+
return searchResultId ? `:cd_source[${searchResultId}]` : match;
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
// Also handle simple numbered citations [1] format
|
|
186
|
+
transformedText = transformedText.replace(/\[(\d+)\]/g, (match, num) => {
|
|
187
|
+
const citationIndex = parseInt(num) - 1;
|
|
188
|
+
if (citations[citationIndex]) {
|
|
189
|
+
const citation = citations[citationIndex];
|
|
190
|
+
// If citation is already in searchResults format, use its searchResultId
|
|
191
|
+
if (citation.searchResultId) {
|
|
192
|
+
return `:cd_source[${citation.searchResultId}]`;
|
|
193
|
+
}
|
|
194
|
+
// Otherwise, try to find by URL
|
|
195
|
+
const url = typeof citation === 'string' ? citation : citation.url;
|
|
196
|
+
const searchResultId = citationToIdMap.get(url);
|
|
197
|
+
return searchResultId ? `:cd_source[${searchResultId}]` : match;
|
|
198
|
+
}
|
|
199
|
+
return match;
|
|
200
|
+
});
|
|
201
|
+
|
|
202
|
+
// If no citations found anywhere, create a single search result with the content
|
|
203
|
+
if (finalSearchResults.length === 0) {
|
|
204
|
+
finalSearchResults.push({
|
|
205
|
+
searchResultId: getSearchResultId(),
|
|
206
|
+
title: 'X Platform Search Results',
|
|
207
|
+
url: 'https://x.com/search', // Provide a valid URL for X platform search
|
|
208
|
+
content: transformedText,
|
|
209
|
+
path: '',
|
|
210
|
+
wireid: '',
|
|
211
|
+
source: 'X Platform',
|
|
212
|
+
slugline: '',
|
|
213
|
+
date: ''
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
return {
|
|
218
|
+
transformedText: transformedText,
|
|
219
|
+
searchResults: finalSearchResults
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
resolver.pathwayResultData.toolUsed = 'SearchXPlatform';
|
|
224
|
+
|
|
225
|
+
// Transform the CortexResponse and return the search response
|
|
226
|
+
const transformedData = transformToSearchResponse(resolver.pathwayResultData, result);
|
|
227
|
+
return JSON.stringify({
|
|
228
|
+
_type: "SearchResponse",
|
|
229
|
+
value: transformedData.searchResults,
|
|
230
|
+
text: transformedData.transformedText
|
|
231
|
+
});
|
|
232
|
+
} catch (e) {
|
|
233
|
+
logger.error(`Error in Grok X Platform search: ${e}`);
|
|
234
|
+
throw e;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
};
|
|
@@ -15,7 +15,7 @@ export default {
|
|
|
15
15
|
icon: "🎨",
|
|
16
16
|
function: {
|
|
17
17
|
name: "GenerateImage",
|
|
18
|
-
description: "Use when asked to create, generate, or generate revisions of visual content. Any time the user asks you for a picture, a selfie, artwork, a drawing or if you want to illustrate something for the user, you can use this tool to generate any sort of image from cartoon to photo realistic.",
|
|
18
|
+
description: "Use when asked to create, generate, or generate revisions of visual content. Any time the user asks you for a picture, a selfie, artwork, a drawing or if you want to illustrate something for the user, you can use this tool to generate any sort of image from cartoon to photo realistic. After you have generated the image, you must include the image in your response to show it to the user.",
|
|
19
19
|
parameters: {
|
|
20
20
|
type: "object",
|
|
21
21
|
properties: {
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// sys_claude_37_sonnet.js
|
|
2
|
+
// override handler for claude-37-sonnet
|
|
3
|
+
|
|
4
|
+
import { Prompt } from '../../../server/prompt.js';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
prompt:
|
|
8
|
+
[
|
|
9
|
+
new Prompt({ messages: [
|
|
10
|
+
"{{messages}}",
|
|
11
|
+
]}),
|
|
12
|
+
],
|
|
13
|
+
inputParameters: {
|
|
14
|
+
messages: [{role: '', content: []}],
|
|
15
|
+
tools: '',
|
|
16
|
+
tool_choice: 'auto',
|
|
17
|
+
},
|
|
18
|
+
model: 'claude-37-sonnet-vertex',
|
|
19
|
+
useInputChunking: false,
|
|
20
|
+
emulateOpenAIChatModel: 'claude-3.7-sonnet',
|
|
21
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// sys_claude_41_opus.js
|
|
2
|
+
// override handler for claude-41-opus
|
|
3
|
+
|
|
4
|
+
import { Prompt } from '../../../server/prompt.js';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
prompt:
|
|
8
|
+
[
|
|
9
|
+
new Prompt({ messages: [
|
|
10
|
+
"{{messages}}",
|
|
11
|
+
]}),
|
|
12
|
+
],
|
|
13
|
+
inputParameters: {
|
|
14
|
+
messages: [{role: '', content: []}],
|
|
15
|
+
tools: '',
|
|
16
|
+
tool_choice: 'auto',
|
|
17
|
+
},
|
|
18
|
+
model: 'claude-41-opus-vertex',
|
|
19
|
+
useInputChunking: false,
|
|
20
|
+
emulateOpenAIChatModel: 'claude-4.1-opus',
|
|
21
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// sys_claude_4_sonnet.js
|
|
2
|
+
// override handler for claude-4-sonnet
|
|
3
|
+
|
|
4
|
+
import { Prompt } from '../../../server/prompt.js';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
prompt:
|
|
8
|
+
[
|
|
9
|
+
new Prompt({ messages: [
|
|
10
|
+
"{{messages}}",
|
|
11
|
+
]}),
|
|
12
|
+
],
|
|
13
|
+
inputParameters: {
|
|
14
|
+
messages: [{role: '', content: []}],
|
|
15
|
+
tools: '',
|
|
16
|
+
tool_choice: 'auto',
|
|
17
|
+
},
|
|
18
|
+
model: 'claude-4-sonnet-vertex',
|
|
19
|
+
useInputChunking: false,
|
|
20
|
+
emulateOpenAIChatModel: 'claude-4-sonnet',
|
|
21
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// sys_google_gemini_25_flash.js
|
|
2
|
+
// override handler for gemini-flash-25-vision
|
|
3
|
+
|
|
4
|
+
import { Prompt } from '../../../server/prompt.js';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
prompt:
|
|
8
|
+
[
|
|
9
|
+
new Prompt({ messages: [
|
|
10
|
+
"{{messages}}",
|
|
11
|
+
]}),
|
|
12
|
+
],
|
|
13
|
+
inputParameters: {
|
|
14
|
+
messages: [{role: '', content: []}],
|
|
15
|
+
tools: '',
|
|
16
|
+
tool_choice: 'auto',
|
|
17
|
+
},
|
|
18
|
+
model: 'gemini-flash-25-vision',
|
|
19
|
+
useInputChunking: false,
|
|
20
|
+
emulateOpenAIChatModel: 'gemini-flash-25',
|
|
21
|
+
geminiSafetySettings: [{category: 'HARM_CATEGORY_DANGEROUS_CONTENT', threshold: 'BLOCK_ONLY_HIGH'},
|
|
22
|
+
{category: 'HARM_CATEGORY_SEXUALLY_EXPLICIT', threshold: 'BLOCK_ONLY_HIGH'},
|
|
23
|
+
{category: 'HARM_CATEGORY_HARASSMENT', threshold: 'BLOCK_ONLY_HIGH'},
|
|
24
|
+
{category: 'HARM_CATEGORY_HATE_SPEECH', threshold: 'BLOCK_ONLY_HIGH'}],
|
|
25
|
+
}
|
package/pathways/system/rest_streaming/{sys_google_gemini_chat.js → sys_google_gemini_25_pro.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
//
|
|
2
|
-
// override handler for gemini-
|
|
1
|
+
// sys_google_gemini_25_pro.js
|
|
2
|
+
// override handler for gemini-pro-25-vision
|
|
3
3
|
|
|
4
4
|
import { Prompt } from '../../../server/prompt.js';
|
|
5
5
|
|
|
@@ -12,10 +12,12 @@ export default {
|
|
|
12
12
|
],
|
|
13
13
|
inputParameters: {
|
|
14
14
|
messages: [{role: '', content: []}],
|
|
15
|
+
tools: '',
|
|
16
|
+
tool_choice: 'auto',
|
|
15
17
|
},
|
|
16
|
-
model: 'gemini-pro-
|
|
18
|
+
model: 'gemini-pro-25-vision',
|
|
17
19
|
useInputChunking: false,
|
|
18
|
-
emulateOpenAIChatModel: 'gemini-pro-
|
|
20
|
+
emulateOpenAIChatModel: 'gemini-pro-25',
|
|
19
21
|
geminiSafetySettings: [{category: 'HARM_CATEGORY_DANGEROUS_CONTENT', threshold: 'BLOCK_ONLY_HIGH'},
|
|
20
22
|
{category: 'HARM_CATEGORY_SEXUALLY_EXPLICIT', threshold: 'BLOCK_ONLY_HIGH'},
|
|
21
23
|
{category: 'HARM_CATEGORY_HARASSMENT', threshold: 'BLOCK_ONLY_HIGH'},
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// sys_grok_4.js
|
|
2
|
+
// override handler for grok-4
|
|
3
|
+
|
|
4
|
+
import { Prompt } from '../../../server/prompt.js';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
prompt:
|
|
8
|
+
[
|
|
9
|
+
new Prompt({ messages: [
|
|
10
|
+
"{{messages}}",
|
|
11
|
+
]}),
|
|
12
|
+
],
|
|
13
|
+
inputParameters: {
|
|
14
|
+
messages: [{role: '', content: []}],
|
|
15
|
+
stream: false,
|
|
16
|
+
search_parameters: '',
|
|
17
|
+
tools: '',
|
|
18
|
+
tool_choice: 'auto',
|
|
19
|
+
},
|
|
20
|
+
model: 'xai-grok-4',
|
|
21
|
+
useInputChunking: false,
|
|
22
|
+
emulateOpenAIChatModel: 'grok-4'
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// sys_grok_4_fast_non_reasoning.js
|
|
2
|
+
// override handler for grok-4-fast-non-reasoning
|
|
3
|
+
|
|
4
|
+
import { Prompt } from '../../../server/prompt.js';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
prompt:
|
|
8
|
+
[
|
|
9
|
+
new Prompt({ messages: [
|
|
10
|
+
"{{messages}}",
|
|
11
|
+
]}),
|
|
12
|
+
],
|
|
13
|
+
inputParameters: {
|
|
14
|
+
messages: [{role: '', content: []}],
|
|
15
|
+
stream: false,
|
|
16
|
+
search_parameters: '',
|
|
17
|
+
tools: '',
|
|
18
|
+
tool_choice: 'auto',
|
|
19
|
+
},
|
|
20
|
+
model: 'xai-grok-4-fast-non-reasoning',
|
|
21
|
+
useInputChunking: false,
|
|
22
|
+
emulateOpenAIChatModel: 'grok-4-fast-non-reasoning'
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// sys_grok_4_fast_reasoning.js
|
|
2
|
+
// override handler for grok-4-fast-reasoning
|
|
3
|
+
|
|
4
|
+
import { Prompt } from '../../../server/prompt.js';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
prompt:
|
|
8
|
+
[
|
|
9
|
+
new Prompt({ messages: [
|
|
10
|
+
"{{messages}}",
|
|
11
|
+
]}),
|
|
12
|
+
],
|
|
13
|
+
inputParameters: {
|
|
14
|
+
messages: [{role: '', content: []}],
|
|
15
|
+
stream: false,
|
|
16
|
+
search_parameters: '',
|
|
17
|
+
tools: '',
|
|
18
|
+
tool_choice: 'auto',
|
|
19
|
+
},
|
|
20
|
+
model: 'xai-grok-4-fast-reasoning',
|
|
21
|
+
useInputChunking: false,
|
|
22
|
+
emulateOpenAIChatModel: 'grok-4-fast-reasoning'
|
|
23
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// sys_openai_chat_gpt41.js
|
|
2
|
+
// override handler for gpt-41
|
|
3
|
+
|
|
4
|
+
import { Prompt } from '../../../server/prompt.js';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
prompt:
|
|
8
|
+
[
|
|
9
|
+
new Prompt({ messages: [
|
|
10
|
+
"{{messages}}",
|
|
11
|
+
]}),
|
|
12
|
+
],
|
|
13
|
+
inputParameters: {
|
|
14
|
+
messages: [{role: '', content: []}],
|
|
15
|
+
tools: '',
|
|
16
|
+
functions: '',
|
|
17
|
+
tool_choice: 'auto',
|
|
18
|
+
},
|
|
19
|
+
model: 'oai-gpt41',
|
|
20
|
+
useInputChunking: false,
|
|
21
|
+
emulateOpenAIChatModel: 'gpt-4.1',
|
|
22
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// sys_openai_chat_gpt41_mini.js
|
|
2
|
+
// override handler for gpt-41-mini
|
|
3
|
+
|
|
4
|
+
import { Prompt } from '../../../server/prompt.js';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
prompt:
|
|
8
|
+
[
|
|
9
|
+
new Prompt({ messages: [
|
|
10
|
+
"{{messages}}",
|
|
11
|
+
]}),
|
|
12
|
+
],
|
|
13
|
+
inputParameters: {
|
|
14
|
+
messages: [{role: '', content: []}],
|
|
15
|
+
tools: '',
|
|
16
|
+
tool_choice: 'auto',
|
|
17
|
+
},
|
|
18
|
+
model: 'oai-gpt41-mini',
|
|
19
|
+
useInputChunking: false,
|
|
20
|
+
emulateOpenAIChatModel: 'gpt-4.1-mini',
|
|
21
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// sys_openai_chat_gpt41_nano.js
|
|
2
|
+
// override handler for gpt-41-nano
|
|
3
|
+
|
|
4
|
+
import { Prompt } from '../../../server/prompt.js';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
prompt:
|
|
8
|
+
[
|
|
9
|
+
new Prompt({ messages: [
|
|
10
|
+
"{{messages}}",
|
|
11
|
+
]}),
|
|
12
|
+
],
|
|
13
|
+
inputParameters: {
|
|
14
|
+
messages: [{role: '', content: []}],
|
|
15
|
+
tools: '',
|
|
16
|
+
tool_choice: 'auto',
|
|
17
|
+
},
|
|
18
|
+
model: 'oai-gpt41-nano',
|
|
19
|
+
useInputChunking: false,
|
|
20
|
+
emulateOpenAIChatModel: 'gpt-4.1-nano',
|
|
21
|
+
}
|