@olane/o-tool-registry 0.6.11 → 0.6.12

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.
Files changed (136) hide show
  1. package/package.json +6 -6
  2. package/dist/auth/index.d.ts +0 -4
  3. package/dist/auth/index.d.ts.map +0 -1
  4. package/dist/auth/index.js +0 -3
  5. package/dist/auth/interfaces/index.d.ts +0 -4
  6. package/dist/auth/interfaces/index.d.ts.map +0 -1
  7. package/dist/auth/interfaces/index.js +0 -3
  8. package/dist/auth/interfaces/oAuth-tokens.interface.d.ts +0 -9
  9. package/dist/auth/interfaces/oAuth-tokens.interface.d.ts.map +0 -1
  10. package/dist/auth/interfaces/oAuth-tokens.interface.js +0 -1
  11. package/dist/auth/interfaces/oAuth-user-info.interface.d.ts +0 -8
  12. package/dist/auth/interfaces/oAuth-user-info.interface.d.ts.map +0 -1
  13. package/dist/auth/interfaces/oAuth-user-info.interface.js +0 -1
  14. package/dist/auth/interfaces/oAuth.config.d.ts +0 -14
  15. package/dist/auth/interfaces/oAuth.config.d.ts.map +0 -1
  16. package/dist/auth/interfaces/oAuth.config.js +0 -1
  17. package/dist/auth/methods/auth.methods.d.ts +0 -5
  18. package/dist/auth/methods/auth.methods.d.ts.map +0 -1
  19. package/dist/auth/methods/auth.methods.js +0 -302
  20. package/dist/auth/oAuth.tool.d.ts +0 -20
  21. package/dist/auth/oAuth.tool.d.ts.map +0 -1
  22. package/dist/auth/oAuth.tool.js +0 -419
  23. package/dist/embeddings/embeddings.tool.d.ts +0 -6
  24. package/dist/embeddings/embeddings.tool.d.ts.map +0 -1
  25. package/dist/embeddings/embeddings.tool.js +0 -11
  26. package/dist/embeddings/huggingface-text-embeddings.tool.d.ts +0 -9
  27. package/dist/embeddings/huggingface-text-embeddings.tool.d.ts.map +0 -1
  28. package/dist/embeddings/huggingface-text-embeddings.tool.js +0 -21
  29. package/dist/embeddings/index.d.ts +0 -4
  30. package/dist/embeddings/index.d.ts.map +0 -1
  31. package/dist/embeddings/index.js +0 -3
  32. package/dist/embeddings/methods/text-embeddings.method.d.ts +0 -5
  33. package/dist/embeddings/methods/text-embeddings.method.d.ts.map +0 -1
  34. package/dist/embeddings/methods/text-embeddings.method.js +0 -29
  35. package/dist/embeddings/text-embeddings.tool.d.ts +0 -9
  36. package/dist/embeddings/text-embeddings.tool.d.ts.map +0 -1
  37. package/dist/embeddings/text-embeddings.tool.js +0 -13
  38. package/dist/index.d.ts +0 -7
  39. package/dist/index.d.ts.map +0 -1
  40. package/dist/index.js +0 -6
  41. package/dist/init.d.ts +0 -3
  42. package/dist/init.d.ts.map +0 -1
  43. package/dist/init.js +0 -36
  44. package/dist/intelligence/anthropic-intelligence.tool.d.ts +0 -224
  45. package/dist/intelligence/anthropic-intelligence.tool.d.ts.map +0 -1
  46. package/dist/intelligence/anthropic-intelligence.tool.js +0 -477
  47. package/dist/intelligence/gemini-intelligence.tool.d.ts +0 -29
  48. package/dist/intelligence/gemini-intelligence.tool.d.ts.map +0 -1
  49. package/dist/intelligence/gemini-intelligence.tool.js +0 -267
  50. package/dist/intelligence/index.d.ts +0 -6
  51. package/dist/intelligence/index.d.ts.map +0 -1
  52. package/dist/intelligence/index.js +0 -5
  53. package/dist/intelligence/intelligence.tool.d.ts +0 -11
  54. package/dist/intelligence/intelligence.tool.d.ts.map +0 -1
  55. package/dist/intelligence/intelligence.tool.js +0 -120
  56. package/dist/intelligence/methods/intelligence.methods.d.ts +0 -5
  57. package/dist/intelligence/methods/intelligence.methods.d.ts.map +0 -1
  58. package/dist/intelligence/methods/intelligence.methods.js +0 -98
  59. package/dist/intelligence/ollama-intelligence.tool.d.ts +0 -36
  60. package/dist/intelligence/ollama-intelligence.tool.d.ts.map +0 -1
  61. package/dist/intelligence/ollama-intelligence.tool.js +0 -312
  62. package/dist/intelligence/openai-intelligence.tool.d.ts +0 -30
  63. package/dist/intelligence/openai-intelligence.tool.d.ts.map +0 -1
  64. package/dist/intelligence/openai-intelligence.tool.js +0 -255
  65. package/dist/intelligence/perplexity-intelligence.tool.d.ts +0 -27
  66. package/dist/intelligence/perplexity-intelligence.tool.d.ts.map +0 -1
  67. package/dist/intelligence/perplexity-intelligence.tool.js +0 -309
  68. package/dist/mcp/index.d.ts +0 -3
  69. package/dist/mcp/index.d.ts.map +0 -1
  70. package/dist/mcp/index.js +0 -2
  71. package/dist/mcp/mcp-bridge.tool.d.ts +0 -12
  72. package/dist/mcp/mcp-bridge.tool.d.ts.map +0 -1
  73. package/dist/mcp/mcp-bridge.tool.js +0 -126
  74. package/dist/mcp/mcp.tool.d.ts +0 -14
  75. package/dist/mcp/mcp.tool.d.ts.map +0 -1
  76. package/dist/mcp/mcp.tool.js +0 -83
  77. package/dist/mcp/methods/mcp-bridge.methods.d.ts +0 -5
  78. package/dist/mcp/methods/mcp-bridge.methods.d.ts.map +0 -1
  79. package/dist/mcp/methods/mcp-bridge.methods.js +0 -79
  80. package/dist/nlp/index.d.ts +0 -2
  81. package/dist/nlp/index.d.ts.map +0 -1
  82. package/dist/nlp/index.js +0 -1
  83. package/dist/nlp/methods/nlp.methods.d.ts +0 -5
  84. package/dist/nlp/methods/nlp.methods.d.ts.map +0 -1
  85. package/dist/nlp/methods/nlp.methods.js +0 -15
  86. package/dist/nlp/ner.tool.d.ts +0 -7
  87. package/dist/nlp/ner.tool.d.ts.map +0 -1
  88. package/dist/nlp/ner.tool.js +0 -25
  89. package/dist/src/intelligence/anthropic-intelligence.tool.d.ts +0 -224
  90. package/dist/src/intelligence/anthropic-intelligence.tool.d.ts.map +0 -1
  91. package/dist/src/intelligence/anthropic-intelligence.tool.js +0 -477
  92. package/dist/src/intelligence/gemini-intelligence.tool.d.ts +0 -29
  93. package/dist/src/intelligence/gemini-intelligence.tool.d.ts.map +0 -1
  94. package/dist/src/intelligence/gemini-intelligence.tool.js +0 -267
  95. package/dist/src/intelligence/index.d.ts +0 -6
  96. package/dist/src/intelligence/index.d.ts.map +0 -1
  97. package/dist/src/intelligence/index.js +0 -5
  98. package/dist/src/intelligence/intelligence.tool.d.ts +0 -11
  99. package/dist/src/intelligence/intelligence.tool.d.ts.map +0 -1
  100. package/dist/src/intelligence/intelligence.tool.js +0 -134
  101. package/dist/src/intelligence/methods/intelligence.methods.d.ts +0 -5
  102. package/dist/src/intelligence/methods/intelligence.methods.d.ts.map +0 -1
  103. package/dist/src/intelligence/methods/intelligence.methods.js +0 -132
  104. package/dist/src/intelligence/ollama-intelligence.tool.d.ts +0 -36
  105. package/dist/src/intelligence/ollama-intelligence.tool.d.ts.map +0 -1
  106. package/dist/src/intelligence/ollama-intelligence.tool.js +0 -312
  107. package/dist/src/intelligence/openai-intelligence.tool.d.ts +0 -30
  108. package/dist/src/intelligence/openai-intelligence.tool.d.ts.map +0 -1
  109. package/dist/src/intelligence/openai-intelligence.tool.js +0 -255
  110. package/dist/src/intelligence/perplexity-intelligence.tool.d.ts +0 -28
  111. package/dist/src/intelligence/perplexity-intelligence.tool.d.ts.map +0 -1
  112. package/dist/src/intelligence/perplexity-intelligence.tool.js +0 -310
  113. package/dist/src/mcp/index.d.ts +0 -3
  114. package/dist/src/mcp/index.d.ts.map +0 -1
  115. package/dist/src/mcp/index.js +0 -2
  116. package/dist/src/mcp/mcp-bridge.tool.d.ts +0 -12
  117. package/dist/src/mcp/mcp-bridge.tool.d.ts.map +0 -1
  118. package/dist/src/mcp/mcp-bridge.tool.js +0 -107
  119. package/dist/src/mcp/mcp.tool.d.ts +0 -15
  120. package/dist/src/mcp/mcp.tool.d.ts.map +0 -1
  121. package/dist/src/mcp/mcp.tool.js +0 -85
  122. package/dist/src/mcp/methods/mcp-bridge.methods.d.ts +0 -5
  123. package/dist/src/mcp/methods/mcp-bridge.methods.d.ts.map +0 -1
  124. package/dist/src/mcp/methods/mcp-bridge.methods.js +0 -58
  125. package/dist/vector-store/index.d.ts +0 -3
  126. package/dist/vector-store/index.d.ts.map +0 -1
  127. package/dist/vector-store/index.js +0 -2
  128. package/dist/vector-store/langchain-memory.vector-store.tool.d.ts +0 -14
  129. package/dist/vector-store/langchain-memory.vector-store.tool.d.ts.map +0 -1
  130. package/dist/vector-store/langchain-memory.vector-store.tool.js +0 -60
  131. package/dist/vector-store/methods/vector-store.methods.d.ts +0 -5
  132. package/dist/vector-store/methods/vector-store.methods.d.ts.map +0 -1
  133. package/dist/vector-store/methods/vector-store.methods.js +0 -60
  134. package/dist/vector-store/vector-memory.tool.d.ts +0 -11
  135. package/dist/vector-store/vector-memory.tool.d.ts.map +0 -1
  136. package/dist/vector-store/vector-memory.tool.js +0 -13
@@ -1,29 +0,0 @@
1
- import { oRequest } from '@olane/o-core';
2
- import { oToolConfig, oVirtualTool, ToolResult } from '@olane/o-tool';
3
- export declare class GeminiIntelligenceTool extends oVirtualTool {
4
- private apiKey;
5
- private baseUrl;
6
- private defaultModel;
7
- constructor(config: oToolConfig);
8
- /**
9
- * Chat completion with Gemini
10
- */
11
- _tool_completion(request: oRequest): Promise<ToolResult>;
12
- /**
13
- * Generate text with Gemini
14
- */
15
- _tool_generate(request: oRequest): Promise<ToolResult>;
16
- /**
17
- * List available models
18
- */
19
- _tool_list_models(request: oRequest): Promise<ToolResult>;
20
- /**
21
- * Get model information
22
- */
23
- _tool_model_info(request: oRequest): Promise<ToolResult>;
24
- /**
25
- * Check Gemini API status
26
- */
27
- _tool_status(request: oRequest): Promise<ToolResult>;
28
- }
29
- //# sourceMappingURL=gemini-intelligence.tool.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"gemini-intelligence.tool.d.ts","sourceRoot":"","sources":["../../src/intelligence/gemini-intelligence.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,QAAQ,EAAgB,MAAM,eAAe,CAAC;AACjE,OAAO,EAAS,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAiH7E,qBAAa,sBAAuB,SAAQ,YAAY;IACtD,OAAO,CAAC,MAAM,CAAU;IACxB,OAAO,CAAC,OAAO,CAAU;IACzB,OAAO,CAAC,YAAY,CAAU;gBAElB,MAAM,EAAE,WAAW;IAU/B;;OAEG;IACG,gBAAgB,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IAkF9D;;OAEG;IACG,cAAc,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IAmF5D;;OAEG;IACG,iBAAiB,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IA0C/D;;OAEG;IACG,gBAAgB,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IA4C9D;;OAEG;IACG,YAAY,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;CAiC3D"}
@@ -1,267 +0,0 @@
1
- import { oAddress } from '@olane/o-core';
2
- import { oVirtualTool } from '@olane/o-tool';
3
- import { INTELLIGENCE_PARAMS } from './methods/intelligence.methods.js';
4
- export class GeminiIntelligenceTool extends oVirtualTool {
5
- constructor(config) {
6
- super({
7
- ...config,
8
- address: new oAddress('o://gemini'),
9
- description: 'Intelligence tool using Google Gemini suite of models',
10
- methods: INTELLIGENCE_PARAMS,
11
- dependencies: [],
12
- });
13
- }
14
- /**
15
- * Chat completion with Gemini
16
- */
17
- async _tool_completion(request) {
18
- try {
19
- const params = request.params;
20
- const { model = this.defaultModel, messages, ...options } = params;
21
- if (!this.apiKey) {
22
- return {
23
- success: false,
24
- error: 'Gemini API key is required',
25
- };
26
- }
27
- if (!messages || !Array.isArray(messages)) {
28
- return {
29
- success: false,
30
- error: '"messages" array is required',
31
- };
32
- }
33
- // Convert messages to Gemini format
34
- const contents = messages.map((msg) => ({
35
- role: msg.role === 'assistant' ? 'model' : 'user',
36
- parts: [{ text: msg.content }],
37
- }));
38
- const chatRequest = {
39
- contents,
40
- generationConfig: {
41
- temperature: options.temperature,
42
- topK: options.topK,
43
- topP: options.topP,
44
- maxOutputTokens: options.maxOutputTokens,
45
- stopSequences: options.stopSequences,
46
- },
47
- safetySettings: options.safetySettings,
48
- };
49
- const response = await fetch(`${this.baseUrl}/models/${model}:generateContent?key=${this.apiKey}`, {
50
- method: 'POST',
51
- headers: {
52
- 'Content-Type': 'application/json',
53
- },
54
- body: JSON.stringify(chatRequest),
55
- });
56
- if (!response.ok) {
57
- const errorText = await response.text();
58
- return {
59
- success: false,
60
- error: `Gemini API error: ${response.status} - ${errorText}`,
61
- };
62
- }
63
- const result = (await response.json());
64
- if (!result.candidates || result.candidates.length === 0) {
65
- return {
66
- success: false,
67
- error: 'No response generated from Gemini',
68
- };
69
- }
70
- return {
71
- success: true,
72
- response: result.candidates[0].content.parts[0]?.text || '',
73
- model: model,
74
- usage: result.usageMetadata,
75
- finish_reason: result.candidates[0].finishReason,
76
- safety_ratings: result.candidates[0].safetyRatings,
77
- };
78
- }
79
- catch (error) {
80
- return {
81
- success: false,
82
- error: `Failed to complete chat: ${error.message}`,
83
- };
84
- }
85
- }
86
- /**
87
- * Generate text with Gemini
88
- */
89
- async _tool_generate(request) {
90
- try {
91
- const params = request.params;
92
- const { model = this.defaultModel, prompt, system, ...options } = params;
93
- if (!this.apiKey) {
94
- return {
95
- success: false,
96
- error: 'Gemini API key is required',
97
- };
98
- }
99
- if (!prompt) {
100
- return {
101
- success: false,
102
- error: 'Prompt is required',
103
- };
104
- }
105
- // Combine system and user prompt
106
- const fullPrompt = system ? `${system}\n\n${prompt}` : prompt;
107
- const generateRequest = {
108
- contents: [
109
- {
110
- parts: [{ text: fullPrompt }],
111
- },
112
- ],
113
- generationConfig: {
114
- temperature: options.temperature,
115
- topK: options.topK,
116
- topP: options.topP,
117
- maxOutputTokens: options.maxOutputTokens,
118
- stopSequences: options.stopSequences,
119
- },
120
- safetySettings: options.safetySettings,
121
- };
122
- const response = await fetch(`${this.baseUrl}/models/${model}:generateContent?key=${this.apiKey}`, {
123
- method: 'POST',
124
- headers: {
125
- 'Content-Type': 'application/json',
126
- },
127
- body: JSON.stringify(generateRequest),
128
- });
129
- if (!response.ok) {
130
- const errorText = await response.text();
131
- return {
132
- success: false,
133
- error: `Gemini API error: ${response.status} - ${errorText}`,
134
- };
135
- }
136
- const result = (await response.json());
137
- if (!result.candidates || result.candidates.length === 0) {
138
- return {
139
- success: false,
140
- error: 'No response generated from Gemini',
141
- };
142
- }
143
- return {
144
- success: true,
145
- response: result.candidates[0].content.parts[0]?.text || '',
146
- model: model,
147
- usage: result.usageMetadata,
148
- finish_reason: result.candidates[0].finishReason,
149
- safety_ratings: result.candidates[0].safetyRatings,
150
- };
151
- }
152
- catch (error) {
153
- return {
154
- success: false,
155
- error: `Failed to generate text: ${error.message}`,
156
- };
157
- }
158
- }
159
- /**
160
- * List available models
161
- */
162
- async _tool_list_models(request) {
163
- try {
164
- if (!this.apiKey) {
165
- return {
166
- success: false,
167
- error: 'Gemini API key is required',
168
- };
169
- }
170
- const response = await fetch(`${this.baseUrl}/models?key=${this.apiKey}`, {
171
- method: 'GET',
172
- headers: {
173
- 'Content-Type': 'application/json',
174
- },
175
- });
176
- if (!response.ok) {
177
- const errorText = await response.text();
178
- return {
179
- success: false,
180
- error: `Gemini API error: ${response.status} - ${errorText}`,
181
- };
182
- }
183
- const result = (await response.json());
184
- return {
185
- success: true,
186
- models: result.models,
187
- };
188
- }
189
- catch (error) {
190
- return {
191
- success: false,
192
- error: `Failed to list models: ${error.message}`,
193
- };
194
- }
195
- }
196
- /**
197
- * Get model information
198
- */
199
- async _tool_model_info(request) {
200
- try {
201
- const params = request.params;
202
- const { model = this.defaultModel } = params;
203
- if (!this.apiKey) {
204
- return {
205
- success: false,
206
- error: 'Gemini API key is required',
207
- };
208
- }
209
- const response = await fetch(`${this.baseUrl}/models/${model}?key=${this.apiKey}`, {
210
- method: 'GET',
211
- headers: {
212
- 'Content-Type': 'application/json',
213
- },
214
- });
215
- if (!response.ok) {
216
- const errorText = await response.text();
217
- return {
218
- success: false,
219
- error: `Gemini API error: ${response.status} - ${errorText}`,
220
- };
221
- }
222
- const result = (await response.json());
223
- return {
224
- success: true,
225
- model_info: result,
226
- };
227
- }
228
- catch (error) {
229
- return {
230
- success: false,
231
- error: `Failed to get model info: ${error.message}`,
232
- };
233
- }
234
- }
235
- /**
236
- * Check Gemini API status
237
- */
238
- async _tool_status(request) {
239
- try {
240
- if (!this.apiKey) {
241
- return {
242
- success: false,
243
- status: 'offline',
244
- error: 'Gemini API key is required',
245
- };
246
- }
247
- const response = await fetch(`${this.baseUrl}/models?key=${this.apiKey}`, {
248
- method: 'GET',
249
- headers: {
250
- 'Content-Type': 'application/json',
251
- },
252
- });
253
- return {
254
- success: response.ok,
255
- status: response.ok ? 'online' : 'offline',
256
- status_code: response.status,
257
- };
258
- }
259
- catch (error) {
260
- return {
261
- success: false,
262
- status: 'offline',
263
- error: `Connection failed: ${error.message}`,
264
- };
265
- }
266
- }
267
- }
@@ -1,6 +0,0 @@
1
- export * from './ollama-intelligence.tool.js';
2
- export * from './openai-intelligence.tool.js';
3
- export * from './anthropic-intelligence.tool.js';
4
- export * from './gemini-intelligence.tool.js';
5
- export * from './intelligence.tool.js';
6
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/intelligence/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,kCAAkC,CAAC;AACjD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,wBAAwB,CAAC"}
@@ -1,5 +0,0 @@
1
- export * from './ollama-intelligence.tool.js';
2
- export * from './openai-intelligence.tool.js';
3
- export * from './anthropic-intelligence.tool.js';
4
- export * from './gemini-intelligence.tool.js';
5
- export * from './intelligence.tool.js';
@@ -1,11 +0,0 @@
1
- import { oToolConfig, oVirtualTool } from '@olane/o-tool';
2
- import { oRequest } from '@olane/o-core';
3
- import { ToolResult } from '@olane/o-tool';
4
- export declare class IntelligenceTool extends oVirtualTool {
5
- private roundRobinIndex;
6
- constructor(config: oToolConfig);
7
- requestMissingData(): Promise<ToolResult>;
8
- chooseIntelligence(request: oRequest): Promise<ToolResult>;
9
- _tool_prompt(request: oRequest): Promise<ToolResult>;
10
- }
11
- //# sourceMappingURL=intelligence.tool.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"intelligence.tool.d.ts","sourceRoot":"","sources":["../../src/intelligence/intelligence.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE1D,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAM3C,qBAAa,gBAAiB,SAAQ,YAAY;IAChD,OAAO,CAAC,eAAe,CAAK;gBAChB,MAAM,EAAE,WAAW;IAkDzB,kBAAkB,IAAI,OAAO,CAAC,UAAU,CAAC;IAmCzC,kBAAkB,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IAwB1D,YAAY,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;CAkB3D"}
@@ -1,120 +0,0 @@
1
- import { oVirtualTool } from '@olane/o-tool';
2
- import { oAddress } from '@olane/o-core';
3
- import { AnthropicIntelligenceTool } from './anthropic-intelligence.tool.js';
4
- import { OpenAIIntelligenceTool } from './openai-intelligence.tool.js';
5
- import { OllamaIntelligenceTool } from './ollama-intelligence.tool.js';
6
- import { PerplexityIntelligenceTool } from './perplexity-intelligence.tool.js';
7
- export class IntelligenceTool extends oVirtualTool {
8
- constructor(config) {
9
- super({
10
- ...config,
11
- address: new oAddress('o://intelligence'),
12
- description: config.description ||
13
- 'Tool to help route LLM requests to the best intelligence tool',
14
- dependencies: [
15
- {
16
- address: 'o://setup',
17
- parameters: [
18
- {
19
- name: 'intelligence',
20
- type: 'string',
21
- description: 'The intelligence tool to use',
22
- },
23
- ],
24
- },
25
- ],
26
- });
27
- this.roundRobinIndex = 0;
28
- this.addChildNode(new AnthropicIntelligenceTool({
29
- ...config,
30
- parent: null,
31
- leader: null,
32
- }));
33
- this.addChildNode(new OpenAIIntelligenceTool({
34
- ...config,
35
- parent: null,
36
- leader: null,
37
- }));
38
- this.addChildNode(new OllamaIntelligenceTool({
39
- ...config,
40
- parent: null,
41
- leader: null,
42
- }));
43
- this.addChildNode(new PerplexityIntelligenceTool({
44
- ...config,
45
- parent: null,
46
- leader: null,
47
- }));
48
- }
49
- async requestMissingData() {
50
- // check to see if the anthropic key is provided in the ENV vars
51
- if (process.env.ANTHROPIC_API_KEY) {
52
- return {
53
- choice: 'o://anthropic',
54
- apiKey: process.env.ANTHROPIC_API_KEY,
55
- };
56
- }
57
- // if the anthropic key is not in the vault, ask the human
58
- this.logger.info('Anthropic API key not found in vault, asking human');
59
- const humanResponse = await this.use(new oAddress('o://human'), {
60
- method: 'question',
61
- params: {
62
- question: 'Enter the anthropic api key',
63
- },
64
- });
65
- // process the human response
66
- const { answer } = humanResponse.result.data;
67
- this.logger.info('Human answer: ', answer);
68
- await this.use(new oAddress('o://memory'), {
69
- method: 'put',
70
- params: {
71
- key: 'anthropic-api-key',
72
- value: answer,
73
- },
74
- });
75
- return {
76
- choice: 'o://anthropic',
77
- apiKey: answer,
78
- };
79
- }
80
- async chooseIntelligence(request) {
81
- // check to see if anthropic key is in vault
82
- const response = await this.use(new oAddress('o://memory'), {
83
- method: 'get',
84
- params: {
85
- key: 'anthropic-api-key',
86
- },
87
- });
88
- // if the anthropic key is in the vault, use it
89
- if (response.result.data) {
90
- const { value } = response.result.data;
91
- if (value) {
92
- return {
93
- choice: 'o://anthropic',
94
- apiKey: value,
95
- };
96
- }
97
- }
98
- const result = await this.requestMissingData();
99
- return result;
100
- }
101
- // we cannot wrap this tool use in a plan because it is a core dependency in all planning
102
- async _tool_prompt(request) {
103
- const { prompt } = request.params;
104
- const intelligence = await this.chooseIntelligence(request);
105
- const response = await this.use(new oAddress(intelligence.choice), {
106
- method: 'completion',
107
- params: {
108
- model: 'claude-sonnet-4-20250514',
109
- apiKey: intelligence.apiKey,
110
- messages: [
111
- {
112
- role: 'user',
113
- content: prompt,
114
- },
115
- ],
116
- },
117
- });
118
- return response.result.data;
119
- }
120
- }
@@ -1,5 +0,0 @@
1
- import { oMethod } from '@olane/o-protocol';
2
- export declare const INTELLIGENCE_PARAMS: {
3
- [key: string]: oMethod;
4
- };
5
- //# sourceMappingURL=intelligence.methods.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"intelligence.methods.d.ts","sourceRoot":"","sources":["../../../src/intelligence/methods/intelligence.methods.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,eAAO,MAAM,mBAAmB,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAiGzD,CAAC"}
@@ -1,98 +0,0 @@
1
- export const INTELLIGENCE_PARAMS = {
2
- completion: {
3
- name: 'completion',
4
- description: 'Completion',
5
- dependencies: [],
6
- parameters: [
7
- {
8
- name: 'model',
9
- type: 'string',
10
- value: 'string',
11
- description: 'The model to use for generation',
12
- },
13
- {
14
- name: 'messages',
15
- type: 'array',
16
- value: 'string[]',
17
- description: 'The messages to use for generation',
18
- },
19
- {
20
- name: 'options',
21
- type: 'object',
22
- value: 'object',
23
- description: 'The options to use for generation',
24
- required: false,
25
- },
26
- ],
27
- },
28
- generate: {
29
- name: 'generate',
30
- description: 'Generate',
31
- dependencies: [],
32
- parameters: [
33
- {
34
- name: 'model',
35
- type: 'string',
36
- value: 'string',
37
- description: 'The model to use for generation',
38
- },
39
- ],
40
- },
41
- list_models: {
42
- name: 'list_models',
43
- description: 'List models',
44
- dependencies: [],
45
- parameters: [],
46
- },
47
- pull_model: {
48
- name: 'pull_model',
49
- description: 'Pull model',
50
- dependencies: [],
51
- parameters: [
52
- {
53
- name: 'model',
54
- type: 'string',
55
- value: 'string',
56
- description: 'The model to pull',
57
- },
58
- {
59
- name: 'insecure',
60
- type: 'boolean',
61
- value: 'boolean',
62
- description: 'Whether to allow insecure connections',
63
- },
64
- ],
65
- },
66
- delete_model: {
67
- name: 'delete_model',
68
- description: 'Delete model',
69
- dependencies: [],
70
- parameters: [
71
- {
72
- name: 'model',
73
- type: 'string',
74
- value: 'string',
75
- description: 'The model to delete',
76
- },
77
- ],
78
- },
79
- model_info: {
80
- name: 'model_info',
81
- description: 'Model info',
82
- dependencies: [],
83
- parameters: [
84
- {
85
- name: 'model',
86
- type: 'string',
87
- value: 'string',
88
- description: 'The model to get info for',
89
- },
90
- ],
91
- },
92
- status: {
93
- name: 'status',
94
- description: 'Status',
95
- dependencies: [],
96
- parameters: [],
97
- },
98
- };
@@ -1,36 +0,0 @@
1
- import { oRequest } from '@olane/o-core';
2
- import { oToolConfig, oVirtualTool, ToolResult } from '@olane/o-tool';
3
- export declare class OllamaIntelligenceTool extends oVirtualTool {
4
- static defaultModel: string;
5
- static defaultUrl: string;
6
- constructor(config: oToolConfig);
7
- /**
8
- * Chat completion with Ollama
9
- */
10
- _tool_completion(request: oRequest): Promise<ToolResult>;
11
- /**
12
- * Generate text with Ollama
13
- */
14
- _tool_generate(request: oRequest): Promise<ToolResult>;
15
- /**
16
- * List available models
17
- */
18
- _tool_list_models(request: oRequest): Promise<ToolResult>;
19
- /**
20
- * Pull a model from Ollama library
21
- */
22
- _tool_pull_model(request: oRequest): Promise<ToolResult>;
23
- /**
24
- * Delete a model
25
- */
26
- _tool_delete_model(request: oRequest): Promise<ToolResult>;
27
- /**
28
- * Get model information
29
- */
30
- _tool_model_info(request: oRequest): Promise<ToolResult>;
31
- /**
32
- * Check Ollama server status
33
- */
34
- _tool_status(request: oRequest): Promise<ToolResult>;
35
- }
36
- //# sourceMappingURL=ollama-intelligence.tool.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ollama-intelligence.tool.d.ts","sourceRoot":"","sources":["../../src/intelligence/ollama-intelligence.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,QAAQ,EAAgB,MAAM,eAAe,CAAC;AACjE,OAAO,EAAS,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AA+G7E,qBAAa,sBAAuB,SAAQ,YAAY;IACtD,MAAM,CAAC,YAAY,SAAqB;IACxC,MAAM,CAAC,UAAU,SAA4B;gBAEjC,MAAM,EAAE,WAAW;IAY/B;;OAEG;IACG,gBAAgB,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IA4D9D;;OAEG;IACG,cAAc,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IAgE5D;;OAEG;IACG,iBAAiB,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IAmC/D;;OAEG;IACG,gBAAgB,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IAiE9D;;OAEG;IACG,kBAAkB,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IA6ChE;;OAEG;IACG,gBAAgB,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IAwC9D;;OAEG;IACG,YAAY,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;CAyB3D"}