@olane/o-intelligence 0.6.12 → 0.7.1
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/dist/src/anthropic-intelligence.tool.d.ts +5 -3
- package/dist/src/anthropic-intelligence.tool.d.ts.map +1 -1
- package/dist/src/anthropic-intelligence.tool.js +5 -5
- package/dist/src/gemini-intelligence.tool.d.ts +5 -3
- package/dist/src/gemini-intelligence.tool.d.ts.map +1 -1
- package/dist/src/gemini-intelligence.tool.js +4 -4
- package/dist/src/grok-intelligence.tool.d.ts +5 -3
- package/dist/src/grok-intelligence.tool.d.ts.map +1 -1
- package/dist/src/grok-intelligence.tool.js +4 -4
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/intelligence.tool.d.ts +1 -0
- package/dist/src/intelligence.tool.d.ts.map +1 -1
- package/dist/src/intelligence.tool.js +8 -2
- package/dist/src/methods/intelligence.methods.d.ts.map +1 -1
- package/dist/src/methods/intelligence.methods.js +0 -117
- package/dist/src/methods/llm.methods.d.ts +5 -0
- package/dist/src/methods/llm.methods.d.ts.map +1 -0
- package/dist/src/methods/llm.methods.js +99 -0
- package/dist/src/o-intelligence.tool.d.ts +27 -0
- package/dist/src/o-intelligence.tool.d.ts.map +1 -0
- package/dist/src/o-intelligence.tool.js +276 -0
- package/dist/src/ollama-intelligence.tool.d.ts +5 -3
- package/dist/src/ollama-intelligence.tool.d.ts.map +1 -1
- package/dist/src/ollama-intelligence.tool.js +4 -4
- package/dist/src/openai-intelligence.tool.d.ts +5 -3
- package/dist/src/openai-intelligence.tool.d.ts.map +1 -1
- package/dist/src/openai-intelligence.tool.js +5 -5
- package/dist/src/perplexity-intelligence.tool.d.ts +5 -3
- package/dist/src/perplexity-intelligence.tool.d.ts.map +1 -1
- package/dist/src/perplexity-intelligence.tool.js +6 -5
- package/dist/src/router/o-intelligence.olane-resolver.d.ts +9 -0
- package/dist/src/router/o-intelligence.olane-resolver.d.ts.map +1 -0
- package/dist/src/router/o-intelligence.olane-resolver.js +40 -0
- package/dist/src/router/o-intelligence.resolver.d.ts +15 -0
- package/dist/src/router/o-intelligence.resolver.d.ts.map +1 -0
- package/dist/src/router/o-intelligence.resolver.js +62 -0
- package/package.json +6 -5
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { oRequest } from '@olane/o-core';
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { ToolResult } from '@olane/o-tool';
|
|
3
|
+
import { oLaneTool } from '@olane/o-lane';
|
|
4
|
+
import { oNodeToolConfig } from '@olane/o-node';
|
|
5
|
+
export declare class AnthropicIntelligenceTool extends oLaneTool {
|
|
4
6
|
private defaultModel;
|
|
5
7
|
private apiKey;
|
|
6
|
-
constructor(config:
|
|
8
|
+
constructor(config: oNodeToolConfig);
|
|
7
9
|
/**
|
|
8
10
|
* Chat completion with Anthropic
|
|
9
11
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anthropic-intelligence.tool.d.ts","sourceRoot":"","sources":["../../src/anthropic-intelligence.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,QAAQ,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"anthropic-intelligence.tool.d.ts","sourceRoot":"","sources":["../../src/anthropic-intelligence.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,QAAQ,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAe,eAAe,EAAE,MAAM,eAAe,CAAC;AAkG7D,qBAAa,yBAA0B,SAAQ,SAAS;IACtD,OAAO,CAAC,YAAY,CAAgC;IACpD,OAAO,CAAC,MAAM,CAA+C;gBAEjD,MAAM,EAAE,eAAe;IAWnC;;OAEG;IACG,gBAAgB,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IAqE9D;;OAEG;IACG,cAAc,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IA+E5D;;OAEG;IACG,iBAAiB,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IA4C/D;;OAEG;IACG,gBAAgB,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IAoD9D;;OAEG;IACG,YAAY,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IAwC1D;;OAEG;IACH,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA+GlB;;OAEG;IACH,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA6DhB;;OAEG;IACH,mBAAmB;;;;IAOnB;;OAEG;IACH,kBAAkB;;;;;;;;;;IAalB;;OAEG;IACH,cAAc;;;;CAMf"}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { oAddress } from '@olane/o-core';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
export class AnthropicIntelligenceTool extends
|
|
2
|
+
import { LLM_PARAMS } from './methods/llm.methods.js';
|
|
3
|
+
import { oLaneTool } from '@olane/o-lane';
|
|
4
|
+
export class AnthropicIntelligenceTool extends oLaneTool {
|
|
5
5
|
constructor(config) {
|
|
6
6
|
super({
|
|
7
7
|
...config,
|
|
8
8
|
address: new oAddress('o://anthropic'),
|
|
9
9
|
description: 'Intelligence tool using Anthropic LLM suite of models',
|
|
10
10
|
// shared parameters for all tools
|
|
11
|
-
methods:
|
|
11
|
+
methods: LLM_PARAMS,
|
|
12
12
|
dependencies: [],
|
|
13
13
|
});
|
|
14
|
-
this.defaultModel = 'claude-sonnet-4-
|
|
14
|
+
this.defaultModel = 'claude-sonnet-4-5-20250929';
|
|
15
15
|
this.apiKey = process.env.ANTHROPIC_API_KEY || '';
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { oRequest } from '@olane/o-core';
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { ToolResult } from '@olane/o-tool';
|
|
3
|
+
import { oLaneTool } from '@olane/o-lane';
|
|
4
|
+
import { oNodeToolConfig } from '@olane/o-node';
|
|
5
|
+
export declare class GeminiIntelligenceTool extends oLaneTool {
|
|
4
6
|
private apiKey;
|
|
5
7
|
private baseUrl;
|
|
6
8
|
private defaultModel;
|
|
7
|
-
constructor(config:
|
|
9
|
+
constructor(config: oNodeToolConfig);
|
|
8
10
|
/**
|
|
9
11
|
* Chat completion with Gemini
|
|
10
12
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gemini-intelligence.tool.d.ts","sourceRoot":"","sources":["../../src/gemini-intelligence.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,QAAQ,
|
|
1
|
+
{"version":3,"file":"gemini-intelligence.tool.d.ts","sourceRoot":"","sources":["../../src/gemini-intelligence.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,QAAQ,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAe,eAAe,EAAE,MAAM,eAAe,CAAC;AAgH7D,qBAAa,sBAAuB,SAAQ,SAAS;IACnD,OAAO,CAAC,MAAM,CAA4C;IAC1D,OAAO,CAAC,OAAO,CAAU;IACzB,OAAO,CAAC,YAAY,CAAU;gBAElB,MAAM,EAAE,eAAe;IAUnC;;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,13 +1,13 @@
|
|
|
1
1
|
import { oAddress } from '@olane/o-core';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
export class GeminiIntelligenceTool extends
|
|
2
|
+
import { LLM_PARAMS } from './methods/llm.methods.js';
|
|
3
|
+
import { oLaneTool } from '@olane/o-lane';
|
|
4
|
+
export class GeminiIntelligenceTool extends oLaneTool {
|
|
5
5
|
constructor(config) {
|
|
6
6
|
super({
|
|
7
7
|
...config,
|
|
8
8
|
address: new oAddress('o://gemini'),
|
|
9
9
|
description: 'Intelligence tool using Google Gemini suite of models',
|
|
10
|
-
methods:
|
|
10
|
+
methods: LLM_PARAMS,
|
|
11
11
|
dependencies: [],
|
|
12
12
|
});
|
|
13
13
|
this.apiKey = process.env.GEMINI_API_KEY || '';
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { oRequest } from '@olane/o-core';
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { ToolResult } from '@olane/o-tool';
|
|
3
|
+
import { oLaneTool } from '@olane/o-lane';
|
|
4
|
+
import { oNodeToolConfig } from '@olane/o-node';
|
|
5
|
+
export declare class GrokIntelligenceTool extends oLaneTool {
|
|
4
6
|
private baseUrl;
|
|
5
7
|
private defaultModel;
|
|
6
8
|
private apiKey;
|
|
7
|
-
constructor(config:
|
|
9
|
+
constructor(config: oNodeToolConfig);
|
|
8
10
|
_tool_completion(request: oRequest): Promise<ToolResult>;
|
|
9
11
|
_tool_generate(request: oRequest): Promise<ToolResult>;
|
|
10
12
|
_tool_list_models(request: oRequest): Promise<ToolResult>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grok-intelligence.tool.d.ts","sourceRoot":"","sources":["../../src/grok-intelligence.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,QAAQ,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"grok-intelligence.tool.d.ts","sourceRoot":"","sources":["../../src/grok-intelligence.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,QAAQ,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AA6ChD,qBAAa,oBAAqB,SAAQ,SAAS;IACjD,OAAO,CAAC,OAAO,CAAiC;IAChD,OAAO,CAAC,YAAY,CAAyB;IAC7C,OAAO,CAAC,MAAM,CAA0C;gBAE5C,MAAM,EAAE,eAAe;IAU7B,gBAAgB,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IAiExD,cAAc,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IAqEtD,iBAAiB,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IAiCzD,gBAAgB,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IAgCxD,YAAY,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;CA+B3D"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { oAddress } from '@olane/o-core';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
export class GrokIntelligenceTool extends
|
|
2
|
+
import { LLM_PARAMS } from './methods/llm.methods.js';
|
|
3
|
+
import { oLaneTool } from '@olane/o-lane';
|
|
4
|
+
export class GrokIntelligenceTool extends oLaneTool {
|
|
5
5
|
constructor(config) {
|
|
6
6
|
super({
|
|
7
7
|
...config,
|
|
8
8
|
address: new oAddress('o://grok'),
|
|
9
9
|
description: 'Intelligence tool using xAI Grok suite of models',
|
|
10
|
-
methods:
|
|
10
|
+
methods: LLM_PARAMS,
|
|
11
11
|
dependencies: [],
|
|
12
12
|
});
|
|
13
13
|
this.baseUrl = 'https://api.x.ai/v1';
|
package/dist/src/index.d.ts
CHANGED
|
@@ -3,5 +3,5 @@ export * from './openai-intelligence.tool.js';
|
|
|
3
3
|
export * from './anthropic-intelligence.tool.js';
|
|
4
4
|
export * from './gemini-intelligence.tool.js';
|
|
5
5
|
export * from './grok-intelligence.tool.js';
|
|
6
|
-
export * from './intelligence.tool.js';
|
|
6
|
+
export * from './o-intelligence.tool.js';
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/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,6BAA6B,CAAC;AAC5C,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/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,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC"}
|
package/dist/src/index.js
CHANGED
|
@@ -3,4 +3,4 @@ export * from './openai-intelligence.tool.js';
|
|
|
3
3
|
export * from './anthropic-intelligence.tool.js';
|
|
4
4
|
export * from './gemini-intelligence.tool.js';
|
|
5
5
|
export * from './grok-intelligence.tool.js';
|
|
6
|
-
export * from './intelligence.tool.js';
|
|
6
|
+
export * from './o-intelligence.tool.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intelligence.tool.d.ts","sourceRoot":"","sources":["../../src/intelligence.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAa,MAAM,eAAe,CAAC;AAEpD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAQ3C,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAExE,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAE/D,qBAAa,gBAAiB,SAAQ,YAAY;IAChD,OAAO,CAAC,eAAe,CAAK;gBAChB,MAAM,EAAE,WAAW;IA0DzB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAmBnD,gBAAgB,IAAI,OAAO,CAAC;QAAE,QAAQ,EAAE,YAAY,CAAA;KAAE,CAAC;IA6DvD,iBAAiB,CAAC,QAAQ,EAAE,YAAY,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAqEtE,kBAAkB,IAAI,OAAO,CAAC;QAClC,QAAQ,EAAE,iBAAiB,CAAC;QAC5B,OAAO,EAAE,GAAG,CAAC;KACd,CAAC;
|
|
1
|
+
{"version":3,"file":"intelligence.tool.d.ts","sourceRoot":"","sources":["../../src/intelligence.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAa,MAAM,eAAe,CAAC;AAEpD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAQ3C,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAExE,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAE/D,qBAAa,gBAAiB,SAAQ,YAAY;IAChD,OAAO,CAAC,eAAe,CAAK;gBAChB,MAAM,EAAE,WAAW;IA0DzB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAmBnD,gBAAgB,IAAI,OAAO,CAAC;QAAE,QAAQ,EAAE,YAAY,CAAA;KAAE,CAAC;IA6DvD,iBAAiB,CAAC,QAAQ,EAAE,YAAY,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAqEtE,kBAAkB,IAAI,OAAO,CAAC;QAClC,aAAa,EAAE,YAAY,CAAC;QAC5B,QAAQ,EAAE,iBAAiB,CAAC;QAC5B,OAAO,EAAE,GAAG,CAAC;KACd,CAAC;IAuCI,kBAAkB,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC;QACxD,MAAM,EAAE,QAAQ,CAAC;QACjB,MAAM,EAAE,MAAM,CAAC;QACf,OAAO,EAAE,GAAG,CAAC;KACd,CAAC;IAWI,eAAe,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,UAAU,CAAC;IA4C/D,2BAA2B,CAC/B,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC;IAgCvB,WAAW,CAAC,OAAO,EAAE,GAAG,GAAG,OAAO,CAAC,UAAU,CAAC;IAkC9C,YAAY,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,UAAU,CAAC;CAwBhE"}
|
|
@@ -205,8 +205,14 @@ export class IntelligenceTool extends oVirtualTool {
|
|
|
205
205
|
if (addressStored) {
|
|
206
206
|
address = addressStored;
|
|
207
207
|
}
|
|
208
|
+
const modelProviderStored = await this.getSecureValue(IntelligenceStorageKeys.MODEL_PROVIDER_PREFERENCE);
|
|
209
|
+
let modelProvider = modelProviderStored;
|
|
210
|
+
if (!modelProvider) {
|
|
211
|
+
modelProvider = LLMProviders.ANTHROPIC;
|
|
212
|
+
}
|
|
208
213
|
return {
|
|
209
214
|
provider: provider,
|
|
215
|
+
modelProvider: modelProvider,
|
|
210
216
|
options: {
|
|
211
217
|
token: token,
|
|
212
218
|
address: address,
|
|
@@ -267,10 +273,10 @@ export class IntelligenceTool extends oVirtualTool {
|
|
|
267
273
|
}
|
|
268
274
|
async attemptUseOlaneIntelligence(request) {
|
|
269
275
|
const { prompt } = request.params;
|
|
270
|
-
const { provider: hostingProvider, options } = await this.getHostingProvider();
|
|
276
|
+
const { provider: hostingProvider, options, modelProvider } = await this.getHostingProvider();
|
|
271
277
|
// forward to olane
|
|
272
278
|
if (hostingProvider === HostModelProvider.OLANE) {
|
|
273
|
-
const response = await this.use(new oAddress(options.address, [
|
|
279
|
+
const response = await this.use(new oAddress(options.address + '/' + modelProvider, [
|
|
274
280
|
multiaddr(process.env.OLANE_ADDRESS ||
|
|
275
281
|
'/dns4/leader.olane.com/tcp/4000/tls/ws'),
|
|
276
282
|
]), {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intelligence.methods.d.ts","sourceRoot":"","sources":["../../../src/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;
|
|
1
|
+
{"version":3,"file":"intelligence.methods.d.ts","sourceRoot":"","sources":["../../../src/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;CAoCzD,CAAC"}
|
|
@@ -20,103 +20,6 @@ export const INTELLIGENCE_PARAMS = {
|
|
|
20
20
|
},
|
|
21
21
|
],
|
|
22
22
|
},
|
|
23
|
-
completion: {
|
|
24
|
-
name: 'completion',
|
|
25
|
-
description: 'Completion',
|
|
26
|
-
dependencies: [],
|
|
27
|
-
parameters: [
|
|
28
|
-
{
|
|
29
|
-
name: 'model',
|
|
30
|
-
type: 'string',
|
|
31
|
-
value: 'string',
|
|
32
|
-
description: 'The model to use for generation',
|
|
33
|
-
required: false,
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
name: 'messages',
|
|
37
|
-
type: 'array',
|
|
38
|
-
value: 'string[]',
|
|
39
|
-
description: 'The messages to use for generation',
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
name: 'options',
|
|
43
|
-
type: 'object',
|
|
44
|
-
value: 'object',
|
|
45
|
-
description: 'The options to use for generation',
|
|
46
|
-
required: false,
|
|
47
|
-
},
|
|
48
|
-
],
|
|
49
|
-
},
|
|
50
|
-
generate: {
|
|
51
|
-
name: 'generate',
|
|
52
|
-
description: 'Generate',
|
|
53
|
-
dependencies: [],
|
|
54
|
-
parameters: [
|
|
55
|
-
{
|
|
56
|
-
name: 'model',
|
|
57
|
-
type: 'string',
|
|
58
|
-
value: 'string',
|
|
59
|
-
description: 'The model to use for generation',
|
|
60
|
-
},
|
|
61
|
-
],
|
|
62
|
-
},
|
|
63
|
-
list_models: {
|
|
64
|
-
name: 'list_models',
|
|
65
|
-
description: 'List models',
|
|
66
|
-
dependencies: [],
|
|
67
|
-
parameters: [],
|
|
68
|
-
},
|
|
69
|
-
pull_model: {
|
|
70
|
-
name: 'pull_model',
|
|
71
|
-
description: 'Pull model',
|
|
72
|
-
dependencies: [],
|
|
73
|
-
parameters: [
|
|
74
|
-
{
|
|
75
|
-
name: 'model',
|
|
76
|
-
type: 'string',
|
|
77
|
-
value: 'string',
|
|
78
|
-
description: 'The model to pull',
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
name: 'insecure',
|
|
82
|
-
type: 'boolean',
|
|
83
|
-
value: 'boolean',
|
|
84
|
-
description: 'Whether to allow insecure connections',
|
|
85
|
-
},
|
|
86
|
-
],
|
|
87
|
-
},
|
|
88
|
-
delete_model: {
|
|
89
|
-
name: 'delete_model',
|
|
90
|
-
description: 'Delete model',
|
|
91
|
-
dependencies: [],
|
|
92
|
-
parameters: [
|
|
93
|
-
{
|
|
94
|
-
name: 'model',
|
|
95
|
-
type: 'string',
|
|
96
|
-
value: 'string',
|
|
97
|
-
description: 'The model to delete',
|
|
98
|
-
},
|
|
99
|
-
],
|
|
100
|
-
},
|
|
101
|
-
model_info: {
|
|
102
|
-
name: 'model_info',
|
|
103
|
-
description: 'Model info',
|
|
104
|
-
dependencies: [],
|
|
105
|
-
parameters: [
|
|
106
|
-
{
|
|
107
|
-
name: 'model',
|
|
108
|
-
type: 'string',
|
|
109
|
-
value: 'string',
|
|
110
|
-
description: 'The model to get info for',
|
|
111
|
-
},
|
|
112
|
-
],
|
|
113
|
-
},
|
|
114
|
-
status: {
|
|
115
|
-
name: 'status',
|
|
116
|
-
description: 'Status',
|
|
117
|
-
dependencies: [],
|
|
118
|
-
parameters: [],
|
|
119
|
-
},
|
|
120
23
|
prompt: {
|
|
121
24
|
name: 'prompt',
|
|
122
25
|
description: 'Generate a response using AI based on a prompt',
|
|
@@ -130,24 +33,4 @@ export const INTELLIGENCE_PARAMS = {
|
|
|
130
33
|
},
|
|
131
34
|
],
|
|
132
35
|
},
|
|
133
|
-
search: {
|
|
134
|
-
name: 'search',
|
|
135
|
-
description: 'Search for information using AI search capabilities',
|
|
136
|
-
dependencies: [],
|
|
137
|
-
parameters: [
|
|
138
|
-
{
|
|
139
|
-
name: 'query',
|
|
140
|
-
type: 'string',
|
|
141
|
-
value: 'string',
|
|
142
|
-
description: 'The search query to execute',
|
|
143
|
-
},
|
|
144
|
-
{
|
|
145
|
-
name: 'focus',
|
|
146
|
-
type: 'string',
|
|
147
|
-
value: 'string',
|
|
148
|
-
description: 'The focus area for the search',
|
|
149
|
-
required: false,
|
|
150
|
-
},
|
|
151
|
-
],
|
|
152
|
-
},
|
|
153
36
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"llm.methods.d.ts","sourceRoot":"","sources":["../../../src/methods/llm.methods.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,eAAO,MAAM,UAAU,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAkGhD,CAAC"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
export const LLM_PARAMS = {
|
|
2
|
+
completion: {
|
|
3
|
+
name: 'completion',
|
|
4
|
+
description: 'The primary method for interacting with the service',
|
|
5
|
+
dependencies: [],
|
|
6
|
+
parameters: [
|
|
7
|
+
{
|
|
8
|
+
name: 'model',
|
|
9
|
+
type: 'string',
|
|
10
|
+
value: 'string',
|
|
11
|
+
description: 'The model to use for generation',
|
|
12
|
+
required: false,
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
name: 'messages',
|
|
16
|
+
type: 'array',
|
|
17
|
+
value: 'string[]',
|
|
18
|
+
description: 'The messages to use for generation',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: 'options',
|
|
22
|
+
type: 'object',
|
|
23
|
+
value: 'object',
|
|
24
|
+
description: 'The options to use for generation',
|
|
25
|
+
required: false,
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
},
|
|
29
|
+
generate: {
|
|
30
|
+
name: 'generate',
|
|
31
|
+
description: 'Generate',
|
|
32
|
+
dependencies: [],
|
|
33
|
+
parameters: [
|
|
34
|
+
{
|
|
35
|
+
name: 'model',
|
|
36
|
+
type: 'string',
|
|
37
|
+
value: 'string',
|
|
38
|
+
description: 'The model to use for generation',
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
},
|
|
42
|
+
list_models: {
|
|
43
|
+
name: 'list_models',
|
|
44
|
+
description: 'List models',
|
|
45
|
+
dependencies: [],
|
|
46
|
+
parameters: [],
|
|
47
|
+
},
|
|
48
|
+
pull_model: {
|
|
49
|
+
name: 'pull_model',
|
|
50
|
+
description: 'Pull model',
|
|
51
|
+
dependencies: [],
|
|
52
|
+
parameters: [
|
|
53
|
+
{
|
|
54
|
+
name: 'model',
|
|
55
|
+
type: 'string',
|
|
56
|
+
value: 'string',
|
|
57
|
+
description: 'The model to pull',
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: 'insecure',
|
|
61
|
+
type: 'boolean',
|
|
62
|
+
value: 'boolean',
|
|
63
|
+
description: 'Whether to allow insecure connections',
|
|
64
|
+
},
|
|
65
|
+
],
|
|
66
|
+
},
|
|
67
|
+
delete_model: {
|
|
68
|
+
name: 'delete_model',
|
|
69
|
+
description: 'Delete model',
|
|
70
|
+
dependencies: [],
|
|
71
|
+
parameters: [
|
|
72
|
+
{
|
|
73
|
+
name: 'model',
|
|
74
|
+
type: 'string',
|
|
75
|
+
value: 'string',
|
|
76
|
+
description: 'The model to delete',
|
|
77
|
+
},
|
|
78
|
+
],
|
|
79
|
+
},
|
|
80
|
+
model_info: {
|
|
81
|
+
name: 'model_info',
|
|
82
|
+
description: 'Model info',
|
|
83
|
+
dependencies: [],
|
|
84
|
+
parameters: [
|
|
85
|
+
{
|
|
86
|
+
name: 'model',
|
|
87
|
+
type: 'string',
|
|
88
|
+
value: 'string',
|
|
89
|
+
description: 'The model to get info for',
|
|
90
|
+
},
|
|
91
|
+
],
|
|
92
|
+
},
|
|
93
|
+
status: {
|
|
94
|
+
name: 'status',
|
|
95
|
+
description: 'Status',
|
|
96
|
+
dependencies: [],
|
|
97
|
+
parameters: [],
|
|
98
|
+
},
|
|
99
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { oAddress } from '@olane/o-core';
|
|
2
|
+
import { ToolResult } from '@olane/o-tool';
|
|
3
|
+
import { LLMProviders } from './enums/llm-providers.enum.js';
|
|
4
|
+
import { ConfigureRequest } from './interfaces/configure.request.js';
|
|
5
|
+
import { PromptRequest } from './interfaces/prompt.request.js';
|
|
6
|
+
import { oLaneTool } from '@olane/o-lane';
|
|
7
|
+
import { oNodeToolConfig } from '@olane/o-node';
|
|
8
|
+
export declare class IntelligenceTool extends oLaneTool {
|
|
9
|
+
private roundRobinIndex;
|
|
10
|
+
constructor(config: oNodeToolConfig);
|
|
11
|
+
getSecureValue(key: string): Promise<string | null>;
|
|
12
|
+
getModelProvider(): Promise<{
|
|
13
|
+
provider: LLMProviders;
|
|
14
|
+
}>;
|
|
15
|
+
getProviderApiKey(provider: LLMProviders): Promise<{
|
|
16
|
+
apiKey: string;
|
|
17
|
+
}>;
|
|
18
|
+
chooseIntelligence(request: PromptRequest): Promise<{
|
|
19
|
+
choice: oAddress;
|
|
20
|
+
apiKey: string;
|
|
21
|
+
options: any;
|
|
22
|
+
}>;
|
|
23
|
+
_tool_configure(request: ConfigureRequest): Promise<ToolResult>;
|
|
24
|
+
_tool_prompt(request: PromptRequest): Promise<ToolResult>;
|
|
25
|
+
initialize(): Promise<void>;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=o-intelligence.tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"o-intelligence.tool.d.ts","sourceRoot":"","sources":["../../src/o-intelligence.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAa,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAQ3C,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAGrE,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAe,eAAe,EAAE,MAAM,eAAe,CAAC;AAE7D,qBAAa,gBAAiB,SAAQ,SAAS;IAC7C,OAAO,CAAC,eAAe,CAAK;gBAChB,MAAM,EAAE,eAAe;IAuB7B,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAmBnD,gBAAgB,IAAI,OAAO,CAAC;QAAE,QAAQ,EAAE,YAAY,CAAA;KAAE,CAAC;IA6DvD,iBAAiB,CAAC,QAAQ,EAAE,YAAY,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAsEtE,kBAAkB,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC;QACxD,MAAM,EAAE,QAAQ,CAAC;QACjB,MAAM,EAAE,MAAM,CAAC;QACf,OAAO,EAAE,GAAG,CAAC;KACd,CAAC;IAWI,eAAe,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,UAAU,CAAC;IA6C/D,YAAY,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,UAAU,CAAC;IAqBzD,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;CAwClC"}
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
import { oAddress } from '@olane/o-core';
|
|
2
|
+
import { AnthropicIntelligenceTool } from './anthropic-intelligence.tool.js';
|
|
3
|
+
import { OpenAIIntelligenceTool } from './openai-intelligence.tool.js';
|
|
4
|
+
import { OllamaIntelligenceTool } from './ollama-intelligence.tool.js';
|
|
5
|
+
import { PerplexityIntelligenceTool } from './perplexity-intelligence.tool.js';
|
|
6
|
+
import { GrokIntelligenceTool } from './grok-intelligence.tool.js';
|
|
7
|
+
import { INTELLIGENCE_PARAMS } from './methods/intelligence.methods.js';
|
|
8
|
+
import { IntelligenceStorageKeys } from './enums/intelligence-storage-keys.enum.js';
|
|
9
|
+
import { LLMProviders } from './enums/llm-providers.enum.js';
|
|
10
|
+
import { oLaneTool } from '@olane/o-lane';
|
|
11
|
+
export class IntelligenceTool extends oLaneTool {
|
|
12
|
+
constructor(config) {
|
|
13
|
+
super({
|
|
14
|
+
...config,
|
|
15
|
+
address: new oAddress('o://intelligence'),
|
|
16
|
+
methods: INTELLIGENCE_PARAMS,
|
|
17
|
+
description: config.description ||
|
|
18
|
+
'Tool to help route LLM requests to the best intelligence tool',
|
|
19
|
+
dependencies: [
|
|
20
|
+
{
|
|
21
|
+
address: 'o://setup',
|
|
22
|
+
parameters: [
|
|
23
|
+
{
|
|
24
|
+
name: 'intelligence',
|
|
25
|
+
type: 'string',
|
|
26
|
+
description: 'The intelligence tool to use',
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
});
|
|
32
|
+
this.roundRobinIndex = 0;
|
|
33
|
+
}
|
|
34
|
+
async getSecureValue(key) {
|
|
35
|
+
try {
|
|
36
|
+
const response = await this.use(new oAddress('o://secure'), {
|
|
37
|
+
method: 'get',
|
|
38
|
+
params: {
|
|
39
|
+
key: key,
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
const payload = response.result.data;
|
|
43
|
+
if (payload && payload.value) {
|
|
44
|
+
return payload.value;
|
|
45
|
+
}
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
catch (error) {
|
|
49
|
+
this.logger.error('Error getting secure value: ', error);
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
async getModelProvider() {
|
|
54
|
+
// check ENV vars for override
|
|
55
|
+
if (process.env.MODEL_PROVIDER_CHOICE) {
|
|
56
|
+
if (Object.values(LLMProviders).includes(process.env.MODEL_PROVIDER_CHOICE)) {
|
|
57
|
+
return {
|
|
58
|
+
provider: process.env.MODEL_PROVIDER_CHOICE,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
throw new Error('Invalid model provider choice, please set the MODEL_PROVIDER_CHOICE environment variable to a valid model provider');
|
|
62
|
+
}
|
|
63
|
+
let model = LLMProviders.ANTHROPIC;
|
|
64
|
+
// check secure storage for preference
|
|
65
|
+
const modelProviderStored = await this.getSecureValue(IntelligenceStorageKeys.MODEL_PROVIDER_PREFERENCE);
|
|
66
|
+
if (modelProviderStored) {
|
|
67
|
+
model = modelProviderStored;
|
|
68
|
+
return {
|
|
69
|
+
provider: model,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
// no preference found, ask the human
|
|
73
|
+
this.logger.info('Asking human for model selection...');
|
|
74
|
+
try {
|
|
75
|
+
const modelResponse = await this.use(new oAddress('o://human'), {
|
|
76
|
+
method: 'question',
|
|
77
|
+
params: {
|
|
78
|
+
question: 'Which AI model do you want to use? (anthropic, openai, ollama, perplexity, grok)',
|
|
79
|
+
},
|
|
80
|
+
});
|
|
81
|
+
// process the human response
|
|
82
|
+
const { answer: modelHuman } = modelResponse.result.data;
|
|
83
|
+
model = modelHuman.toLowerCase();
|
|
84
|
+
await this.use(new oAddress('o://secure'), {
|
|
85
|
+
method: 'put',
|
|
86
|
+
params: {
|
|
87
|
+
key: IntelligenceStorageKeys.MODEL_PROVIDER_PREFERENCE,
|
|
88
|
+
value: model,
|
|
89
|
+
},
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
catch (error) {
|
|
93
|
+
this.logger.warn('Defaulting to anthropic');
|
|
94
|
+
model = LLMProviders.ANTHROPIC;
|
|
95
|
+
}
|
|
96
|
+
return {
|
|
97
|
+
provider: model,
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
async getProviderApiKey(provider) {
|
|
101
|
+
// leverage the ENV vars first
|
|
102
|
+
const ENV_KEYS = [
|
|
103
|
+
{
|
|
104
|
+
key: process.env.ANTHROPIC_API_KEY,
|
|
105
|
+
address: 'o://anthropic',
|
|
106
|
+
name: 'anthropic',
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
key: process.env.OPENAI_API_KEY,
|
|
110
|
+
address: 'o://openai',
|
|
111
|
+
name: 'openai',
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
key: process.env.SONAR_API_KEY,
|
|
115
|
+
address: 'o://sonar',
|
|
116
|
+
name: 'sonar',
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
key: process.env.GEMINI_API_KEY,
|
|
120
|
+
address: 'o://gemini',
|
|
121
|
+
name: 'gemini',
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
key: process.env.GROK_API_KEY,
|
|
125
|
+
address: 'o://grok',
|
|
126
|
+
name: 'grok',
|
|
127
|
+
},
|
|
128
|
+
];
|
|
129
|
+
const modelEnvConfig = ENV_KEYS.find((key) => key.name === provider);
|
|
130
|
+
if (modelEnvConfig && !!modelEnvConfig.key) {
|
|
131
|
+
return {
|
|
132
|
+
apiKey: modelEnvConfig.key,
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
let apiKey = '';
|
|
136
|
+
// check secure storage 2nd
|
|
137
|
+
const apiKeyStored = await this.getSecureValue(`${provider}-${IntelligenceStorageKeys.API_KEY_SUFFIX}`);
|
|
138
|
+
if (apiKeyStored) {
|
|
139
|
+
return {
|
|
140
|
+
apiKey: apiKeyStored,
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
// no preference found, ask the human
|
|
144
|
+
this.logger.info('Asking human for API key...');
|
|
145
|
+
const keyResponse = await this.use(new oAddress('o://human'), {
|
|
146
|
+
method: 'question',
|
|
147
|
+
params: {
|
|
148
|
+
question: `What is the API key for the ${provider} model?`,
|
|
149
|
+
},
|
|
150
|
+
});
|
|
151
|
+
// process the human response
|
|
152
|
+
const { answer: key } = keyResponse.result.data;
|
|
153
|
+
apiKey = key;
|
|
154
|
+
await this.use(new oAddress('o://secure'), {
|
|
155
|
+
method: 'put',
|
|
156
|
+
params: {
|
|
157
|
+
key: `${provider}-${IntelligenceStorageKeys.API_KEY_SUFFIX}`,
|
|
158
|
+
value: key,
|
|
159
|
+
},
|
|
160
|
+
});
|
|
161
|
+
return {
|
|
162
|
+
apiKey: apiKey,
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
async chooseIntelligence(request) {
|
|
166
|
+
// check to see if anthropic key is in vault
|
|
167
|
+
const { provider } = await this.getModelProvider();
|
|
168
|
+
const { apiKey } = await this.getProviderApiKey(provider);
|
|
169
|
+
return {
|
|
170
|
+
choice: new oAddress(`o://${provider}`),
|
|
171
|
+
apiKey,
|
|
172
|
+
options: {},
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
async _tool_configure(request) {
|
|
176
|
+
const { modelProvider, hostingProvider, accessToken, address } = request.params;
|
|
177
|
+
if (hostingProvider) {
|
|
178
|
+
await this.use(new oAddress('o://secure'), {
|
|
179
|
+
method: 'put',
|
|
180
|
+
params: {
|
|
181
|
+
key: `${IntelligenceStorageKeys.HOSTING_PROVIDER_PREFERENCE}`,
|
|
182
|
+
value: hostingProvider,
|
|
183
|
+
},
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
if (accessToken) {
|
|
187
|
+
await this.use(new oAddress('o://secure'), {
|
|
188
|
+
method: 'put',
|
|
189
|
+
params: {
|
|
190
|
+
key: `${IntelligenceStorageKeys.ACCESS_TOKEN}`,
|
|
191
|
+
value: accessToken,
|
|
192
|
+
},
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
if (address) {
|
|
196
|
+
await this.use(new oAddress('o://secure'), {
|
|
197
|
+
method: 'put',
|
|
198
|
+
params: {
|
|
199
|
+
key: `${IntelligenceStorageKeys.OLANE_ADDRESS}`,
|
|
200
|
+
value: address,
|
|
201
|
+
},
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
if (modelProvider) {
|
|
205
|
+
await this.use(new oAddress('o://secure'), {
|
|
206
|
+
method: 'put',
|
|
207
|
+
params: {
|
|
208
|
+
key: `${IntelligenceStorageKeys.MODEL_PROVIDER_PREFERENCE}`,
|
|
209
|
+
value: modelProvider,
|
|
210
|
+
},
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
return {
|
|
214
|
+
success: true,
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
// we cannot wrap this tool use in a plan because it is a core dependency in all planning
|
|
218
|
+
async _tool_prompt(request) {
|
|
219
|
+
const { prompt } = request.params;
|
|
220
|
+
const intelligence = await this.chooseIntelligence(request);
|
|
221
|
+
this.logger.debug('Using intelligence: ', intelligence.choice.toString());
|
|
222
|
+
const child = this.hierarchyManager.getChild(intelligence.choice);
|
|
223
|
+
const response = await this.useChild(child || intelligence.choice, {
|
|
224
|
+
method: 'completion',
|
|
225
|
+
params: {
|
|
226
|
+
apiKey: intelligence.apiKey,
|
|
227
|
+
messages: [
|
|
228
|
+
{
|
|
229
|
+
role: 'user',
|
|
230
|
+
content: prompt,
|
|
231
|
+
},
|
|
232
|
+
],
|
|
233
|
+
},
|
|
234
|
+
});
|
|
235
|
+
return response.result.data;
|
|
236
|
+
}
|
|
237
|
+
async initialize() {
|
|
238
|
+
await super.initialize();
|
|
239
|
+
const config = this.config;
|
|
240
|
+
const anthropicTool = new AnthropicIntelligenceTool({
|
|
241
|
+
...config,
|
|
242
|
+
parent: this.address,
|
|
243
|
+
leader: this.leader,
|
|
244
|
+
});
|
|
245
|
+
await anthropicTool.start();
|
|
246
|
+
this.addChildNode(anthropicTool);
|
|
247
|
+
const openaiTool = new OpenAIIntelligenceTool({
|
|
248
|
+
...config,
|
|
249
|
+
parent: this.address,
|
|
250
|
+
leader: this.leader,
|
|
251
|
+
});
|
|
252
|
+
await openaiTool.start();
|
|
253
|
+
this.addChildNode(openaiTool);
|
|
254
|
+
const ollamaTool = new OllamaIntelligenceTool({
|
|
255
|
+
...config,
|
|
256
|
+
parent: this.address,
|
|
257
|
+
leader: this.leader,
|
|
258
|
+
});
|
|
259
|
+
await ollamaTool.start();
|
|
260
|
+
this.addChildNode(ollamaTool);
|
|
261
|
+
const perplexityTool = new PerplexityIntelligenceTool({
|
|
262
|
+
...config,
|
|
263
|
+
parent: this.address,
|
|
264
|
+
leader: this.leader,
|
|
265
|
+
});
|
|
266
|
+
await perplexityTool.start();
|
|
267
|
+
this.addChildNode(perplexityTool);
|
|
268
|
+
const grokTool = new GrokIntelligenceTool({
|
|
269
|
+
...config,
|
|
270
|
+
parent: this.address,
|
|
271
|
+
leader: this.leader,
|
|
272
|
+
});
|
|
273
|
+
await grokTool.start();
|
|
274
|
+
this.addChildNode(grokTool);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { oRequest } from '@olane/o-core';
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { ToolResult } from '@olane/o-tool';
|
|
3
|
+
import { oLaneTool } from '@olane/o-lane';
|
|
4
|
+
import { oNodeToolConfig } from '@olane/o-node';
|
|
5
|
+
export declare class OllamaIntelligenceTool extends oLaneTool {
|
|
4
6
|
static defaultModel: string;
|
|
5
7
|
static defaultUrl: string;
|
|
6
|
-
constructor(config:
|
|
8
|
+
constructor(config: oNodeToolConfig);
|
|
7
9
|
/**
|
|
8
10
|
* Chat completion with Ollama
|
|
9
11
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ollama-intelligence.tool.d.ts","sourceRoot":"","sources":["../../src/ollama-intelligence.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,QAAQ,
|
|
1
|
+
{"version":3,"file":"ollama-intelligence.tool.d.ts","sourceRoot":"","sources":["../../src/ollama-intelligence.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,QAAQ,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AA8GhD,qBAAa,sBAAuB,SAAQ,SAAS;IACnD,MAAM,CAAC,YAAY,SAAqB;IACxC,MAAM,CAAC,UAAU,SAA4B;gBAEjC,MAAM,EAAE,eAAe;IAYnC;;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"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { oAddress } from '@olane/o-core';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
export class OllamaIntelligenceTool extends
|
|
2
|
+
import { LLM_PARAMS } from './methods/llm.methods.js';
|
|
3
|
+
import { oLaneTool } from '@olane/o-lane';
|
|
4
|
+
export class OllamaIntelligenceTool extends oLaneTool {
|
|
5
5
|
constructor(config) {
|
|
6
6
|
super({
|
|
7
7
|
...config,
|
|
8
8
|
address: new oAddress('o://ollama'),
|
|
9
9
|
description: 'Intelligence tool using Ollama LLM suite of models',
|
|
10
|
-
methods:
|
|
10
|
+
methods: LLM_PARAMS,
|
|
11
11
|
dependencies: [],
|
|
12
12
|
});
|
|
13
13
|
// this.baseUrl = config.ollamaUrl || 'http://localhost:11434';
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { oRequest } from '@olane/o-core';
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { ToolResult } from '@olane/o-tool';
|
|
3
|
+
import { oLaneTool } from '@olane/o-lane';
|
|
4
|
+
import { oNodeToolConfig } from '@olane/o-node';
|
|
5
|
+
export declare class OpenAIIntelligenceTool extends oLaneTool {
|
|
4
6
|
private baseUrl;
|
|
5
7
|
private defaultModel;
|
|
6
8
|
private organization?;
|
|
7
9
|
private apiKey;
|
|
8
|
-
constructor(config:
|
|
10
|
+
constructor(config: oNodeToolConfig);
|
|
9
11
|
/**
|
|
10
12
|
* Chat completion with OpenAI
|
|
11
13
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openai-intelligence.tool.d.ts","sourceRoot":"","sources":["../../src/openai-intelligence.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,QAAQ,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"openai-intelligence.tool.d.ts","sourceRoot":"","sources":["../../src/openai-intelligence.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,QAAQ,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAmHhD,qBAAa,sBAAuB,SAAQ,SAAS;IACnD,OAAO,CAAC,OAAO,CAAuC;IACtD,OAAO,CAAC,YAAY,CAAmB;IACvC,OAAO,CAAC,YAAY,CAAC,CAAS;IAC9B,OAAO,CAAC,MAAM,CAA4C;gBAE9C,MAAM,EAAE,eAAe;IAUnC;;OAEG;IACG,gBAAgB,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IAyE9D;;OAEG;IACG,cAAc,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IAwE5D;;OAEG;IACG,iBAAiB,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IAgD/D;;OAEG;IACG,gBAAgB,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IA+C9D;;OAEG;IACG,YAAY,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;CAuC3D"}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { oAddress } from '@olane/o-core';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
export class OpenAIIntelligenceTool extends
|
|
2
|
+
import { LLM_PARAMS } from './methods/llm.methods.js';
|
|
3
|
+
import { oLaneTool } from '@olane/o-lane';
|
|
4
|
+
export class OpenAIIntelligenceTool extends oLaneTool {
|
|
5
5
|
constructor(config) {
|
|
6
6
|
super({
|
|
7
7
|
...config,
|
|
8
8
|
address: new oAddress('o://openai'),
|
|
9
9
|
description: "Open AI's suite of intelligence models.",
|
|
10
|
-
methods:
|
|
10
|
+
methods: LLM_PARAMS,
|
|
11
11
|
dependencies: [],
|
|
12
12
|
});
|
|
13
13
|
this.baseUrl = 'https://api.openai.com/v1';
|
|
14
|
-
this.defaultModel = 'gpt-5
|
|
14
|
+
this.defaultModel = 'gpt-5';
|
|
15
15
|
this.apiKey = process.env.OPENAI_API_KEY || '';
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { oRequest } from '@olane/o-core';
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { ToolResult } from '@olane/o-tool';
|
|
3
|
+
import { oLaneTool } from '@olane/o-lane';
|
|
4
|
+
import { oNodeToolConfig } from '@olane/o-node';
|
|
5
|
+
export declare class PerplexityIntelligenceTool extends oLaneTool {
|
|
4
6
|
private defaultModel;
|
|
5
7
|
private defaultApiKey;
|
|
6
|
-
constructor(config:
|
|
8
|
+
constructor(config: oNodeToolConfig);
|
|
7
9
|
/**
|
|
8
10
|
* Chat completion with Perplexity
|
|
9
11
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"perplexity-intelligence.tool.d.ts","sourceRoot":"","sources":["../../src/perplexity-intelligence.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,QAAQ,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"perplexity-intelligence.tool.d.ts","sourceRoot":"","sources":["../../src/perplexity-intelligence.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,QAAQ,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAoFhD,qBAAa,0BAA2B,SAAQ,SAAS;IACvD,OAAO,CAAC,YAAY,CAAmB;IACvC,OAAO,CAAC,aAAa,CAA2C;gBAEpD,MAAM,EAAE,eAAe;IAWnC;;OAEG;IACG,gBAAgB,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IA+F9D;;OAEG;IACG,cAAc,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IAuG5D;;OAEG;IACG,iBAAiB,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IAyC/D;;OAEG;IACG,YAAY,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IA6E1D;;OAEG;IACG,YAAY,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;CAgC3D"}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { oAddress } from '@olane/o-core';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
export class PerplexityIntelligenceTool extends
|
|
2
|
+
import { LLM_PARAMS } from './methods/llm.methods.js';
|
|
3
|
+
import { oLaneTool } from '@olane/o-lane';
|
|
4
|
+
export class PerplexityIntelligenceTool extends oLaneTool {
|
|
5
5
|
constructor(config) {
|
|
6
6
|
super({
|
|
7
7
|
...config,
|
|
8
8
|
address: new oAddress('o://perplexity'),
|
|
9
|
-
description: '
|
|
10
|
-
methods:
|
|
9
|
+
description: 'Perplexity sonar model is useful for searching the web or providing information about a wide range of topics',
|
|
10
|
+
methods: LLM_PARAMS,
|
|
11
11
|
dependencies: [],
|
|
12
12
|
});
|
|
13
|
+
this.defaultModel = 'sonar';
|
|
13
14
|
this.defaultApiKey = process.env.SONAR_API_KEY || '';
|
|
14
15
|
}
|
|
15
16
|
/**
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { oAddress, oTransport, ResolveRequest, RouteResponse } from '@olane/o-core';
|
|
2
|
+
import { oIntelligenceResolver } from './o-intelligence.resolver';
|
|
3
|
+
export declare class oIntelligenceOlaneResolver extends oIntelligenceResolver {
|
|
4
|
+
protected readonly address: oAddress;
|
|
5
|
+
constructor(address: oAddress);
|
|
6
|
+
get customTransports(): oTransport[];
|
|
7
|
+
resolve(resolveRequest: ResolveRequest): Promise<RouteResponse>;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=o-intelligence.olane-resolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"o-intelligence.olane-resolver.d.ts","sourceRoot":"","sources":["../../../src/router/o-intelligence.olane-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAER,UAAU,EACV,cAAc,EACd,aAAa,EACd,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAIlE,qBAAa,0BAA2B,SAAQ,qBAAqB;IACvD,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,QAAQ;gBAAjB,OAAO,EAAE,QAAQ;IAIhD,IAAI,gBAAgB,IAAI,UAAU,EAAE,CAEnC;IAEK,OAAO,CAAC,cAAc,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC;CAkCtE"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { oAddress, oCustomTransport, } from '@olane/o-core';
|
|
2
|
+
import { oIntelligenceResolver } from './o-intelligence.resolver';
|
|
3
|
+
import { HostModelProvider } from '../enums/host-model-provider.enum';
|
|
4
|
+
import { oNodeTransport } from '@olane/o-node/dist/src/router/o-node.transport';
|
|
5
|
+
export class oIntelligenceOlaneResolver extends oIntelligenceResolver {
|
|
6
|
+
constructor(address) {
|
|
7
|
+
super(address);
|
|
8
|
+
this.address = address;
|
|
9
|
+
}
|
|
10
|
+
get customTransports() {
|
|
11
|
+
return [new oCustomTransport('/intelligence/olane')];
|
|
12
|
+
}
|
|
13
|
+
async resolve(resolveRequest) {
|
|
14
|
+
const { address, node, request, targetAddress } = resolveRequest;
|
|
15
|
+
if (!request) {
|
|
16
|
+
return {
|
|
17
|
+
nextHopAddress: address,
|
|
18
|
+
targetAddress: targetAddress,
|
|
19
|
+
requestOverride: request,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
const { provider: hostingProvider, options, modelProvider, } = await this.getHostingProvider(node);
|
|
23
|
+
// forward to olane
|
|
24
|
+
if (hostingProvider === HostModelProvider.OLANE) {
|
|
25
|
+
const nextAddress = new oAddress(options.address + '/' + modelProvider, [
|
|
26
|
+
new oNodeTransport(process.env.OLANE_ADDRESS || '/dns4/leader.olane.com/tcp/4000/tls/ws'),
|
|
27
|
+
]);
|
|
28
|
+
return {
|
|
29
|
+
nextHopAddress: nextAddress,
|
|
30
|
+
targetAddress: targetAddress,
|
|
31
|
+
requestOverride: request,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
return {
|
|
35
|
+
nextHopAddress: address,
|
|
36
|
+
targetAddress: targetAddress,
|
|
37
|
+
requestOverride: request,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { oAddress, oAddressResolver, oCore, oTransport } from '@olane/o-core';
|
|
2
|
+
import { LLMProviders } from '../enums/llm-providers.enum';
|
|
3
|
+
import { HostModelProvider } from '../enums/host-model-provider.enum';
|
|
4
|
+
export declare abstract class oIntelligenceResolver extends oAddressResolver {
|
|
5
|
+
protected readonly address: oAddress;
|
|
6
|
+
constructor(address: oAddress);
|
|
7
|
+
get customTransports(): oTransport[];
|
|
8
|
+
getSecureValue(node: oCore, key: string): Promise<string | null>;
|
|
9
|
+
getHostingProvider(node: oCore): Promise<{
|
|
10
|
+
modelProvider: LLMProviders;
|
|
11
|
+
provider: HostModelProvider;
|
|
12
|
+
options: any;
|
|
13
|
+
}>;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=o-intelligence.resolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"o-intelligence.resolver.d.ts","sourceRoot":"","sources":["../../../src/router/o-intelligence.resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,gBAAgB,EAChB,KAAK,EAEL,UAAU,EAEX,MAAM,eAAe,CAAC;AAGvB,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAEtE,8BAAsB,qBAAsB,SAAQ,gBAAgB;IACtD,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,QAAQ;gBAAjB,OAAO,EAAE,QAAQ;IAIhD,IAAI,gBAAgB,IAAI,UAAU,EAAE,CAEnC;IAEK,cAAc,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAmBhE,kBAAkB,CAAC,IAAI,EAAE,KAAK,GAAG,OAAO,CAAC;QAC7C,aAAa,EAAE,YAAY,CAAC;QAC5B,QAAQ,EAAE,iBAAiB,CAAC;QAC5B,OAAO,EAAE,GAAG,CAAC;KACd,CAAC;CA0CH"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { oAddress, oAddressResolver, oCustomTransport, } from '@olane/o-core';
|
|
2
|
+
import { IntelligenceStorageKeys } from '../enums/intelligence-storage-keys.enum';
|
|
3
|
+
import { LLMProviders } from '../enums/llm-providers.enum';
|
|
4
|
+
import { HostModelProvider } from '../enums/host-model-provider.enum';
|
|
5
|
+
export class oIntelligenceResolver extends oAddressResolver {
|
|
6
|
+
constructor(address) {
|
|
7
|
+
super(address);
|
|
8
|
+
this.address = address;
|
|
9
|
+
}
|
|
10
|
+
get customTransports() {
|
|
11
|
+
return [new oCustomTransport('/intelligence')];
|
|
12
|
+
}
|
|
13
|
+
async getSecureValue(node, key) {
|
|
14
|
+
try {
|
|
15
|
+
const response = await node.use(new oAddress('o://secure'), {
|
|
16
|
+
method: 'get',
|
|
17
|
+
params: {
|
|
18
|
+
key: key,
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
const payload = response.result.data;
|
|
22
|
+
if (payload && payload.value) {
|
|
23
|
+
return payload.value;
|
|
24
|
+
}
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
this.logger.error('Error getting secure value: ', error);
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
async getHostingProvider(node) {
|
|
33
|
+
let provider = HostModelProvider.LOCAL;
|
|
34
|
+
const hostingProviderStored = await this.getSecureValue(node, IntelligenceStorageKeys.HOSTING_PROVIDER_PREFERENCE);
|
|
35
|
+
if (hostingProviderStored) {
|
|
36
|
+
provider = hostingProviderStored;
|
|
37
|
+
}
|
|
38
|
+
let token = null;
|
|
39
|
+
const accessTokenStored = await this.getSecureValue(node, IntelligenceStorageKeys.ACCESS_TOKEN);
|
|
40
|
+
if (accessTokenStored) {
|
|
41
|
+
token = accessTokenStored;
|
|
42
|
+
}
|
|
43
|
+
const addressStored = await this.getSecureValue(node, IntelligenceStorageKeys.OLANE_ADDRESS);
|
|
44
|
+
let address = 'o://leader/auth/intelligence';
|
|
45
|
+
if (addressStored) {
|
|
46
|
+
address = addressStored;
|
|
47
|
+
}
|
|
48
|
+
const modelProviderStored = await this.getSecureValue(node, IntelligenceStorageKeys.MODEL_PROVIDER_PREFERENCE);
|
|
49
|
+
let modelProvider = modelProviderStored;
|
|
50
|
+
if (!modelProvider) {
|
|
51
|
+
modelProvider = LLMProviders.ANTHROPIC;
|
|
52
|
+
}
|
|
53
|
+
return {
|
|
54
|
+
provider: provider,
|
|
55
|
+
modelProvider: modelProvider,
|
|
56
|
+
options: {
|
|
57
|
+
token: token,
|
|
58
|
+
address: address,
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@olane/o-intelligence",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/src/index.js",
|
|
6
6
|
"types": "dist/src/index.d.ts",
|
|
@@ -56,10 +56,11 @@
|
|
|
56
56
|
"typescript": "5.4.5"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
|
-
"@olane/o-config": "^0.
|
|
60
|
-
"@olane/o-core": "^0.
|
|
61
|
-
"@olane/o-protocol": "^0.
|
|
62
|
-
"@olane/o-tool": "^0.
|
|
59
|
+
"@olane/o-config": "^0.7.0",
|
|
60
|
+
"@olane/o-core": "^0.7.0",
|
|
61
|
+
"@olane/o-protocol": "^0.7.0",
|
|
62
|
+
"@olane/o-tool": "^0.7.0",
|
|
63
|
+
"@olane/o-lane": "^0.7.0"
|
|
63
64
|
},
|
|
64
65
|
"dependencies": {
|
|
65
66
|
"debug": "^4.4.1",
|