@backtest-kit/ollama 0.0.7 → 0.1.0
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/build/index.cjs +27 -3
- package/build/index.mjs +28 -4
- package/package.json +2 -2
- package/types.d.ts +990 -990
package/build/index.cjs
CHANGED
|
@@ -4889,6 +4889,10 @@ init();
|
|
|
4889
4889
|
Object.assign(globalThis, { engine });
|
|
4890
4890
|
var lib = engine;
|
|
4891
4891
|
|
|
4892
|
+
const INFERENCE_TIMEOUT$2 = 35000;
|
|
4893
|
+
const LOCAL_RUNNER_FN$2 = functoolsKit.timeout(async (params) => {
|
|
4894
|
+
return await engine.runnerPrivateService.getOutlineCompletion(params);
|
|
4895
|
+
}, INFERENCE_TIMEOUT$2);
|
|
4892
4896
|
/**
|
|
4893
4897
|
* Outline runner completion handler registration.
|
|
4894
4898
|
*
|
|
@@ -4920,11 +4924,19 @@ var lib = engine;
|
|
|
4920
4924
|
agentSwarmKit.addCompletion({
|
|
4921
4925
|
completionName: CompletionName.RunnerOutlineCompletion,
|
|
4922
4926
|
getCompletion: async (params) => {
|
|
4923
|
-
|
|
4927
|
+
const result = await LOCAL_RUNNER_FN$2(params);
|
|
4928
|
+
if (typeof result === "symbol") {
|
|
4929
|
+
throw new Error(`${CompletionName.RunnerOutlineCompletion} inference timeout`);
|
|
4930
|
+
}
|
|
4931
|
+
return result;
|
|
4924
4932
|
},
|
|
4925
4933
|
json: true,
|
|
4926
4934
|
});
|
|
4927
4935
|
|
|
4936
|
+
const INFERENCE_TIMEOUT$1 = 35000;
|
|
4937
|
+
const LOCAL_RUNNER_FN$1 = functoolsKit.timeout(async (params) => {
|
|
4938
|
+
return await engine.runnerPrivateService.getStreamCompletion(params);
|
|
4939
|
+
}, INFERENCE_TIMEOUT$1);
|
|
4928
4940
|
/**
|
|
4929
4941
|
* Streaming runner completion handler registration.
|
|
4930
4942
|
*
|
|
@@ -4955,10 +4967,18 @@ agentSwarmKit.addCompletion({
|
|
|
4955
4967
|
agentSwarmKit.addCompletion({
|
|
4956
4968
|
completionName: CompletionName.RunnerStreamCompletion,
|
|
4957
4969
|
getCompletion: async (params) => {
|
|
4958
|
-
|
|
4970
|
+
const result = await LOCAL_RUNNER_FN$1(params);
|
|
4971
|
+
if (typeof result === "symbol") {
|
|
4972
|
+
throw new Error(`${CompletionName.RunnerCompletion} inference timeout`);
|
|
4973
|
+
}
|
|
4974
|
+
return result;
|
|
4959
4975
|
},
|
|
4960
4976
|
});
|
|
4961
4977
|
|
|
4978
|
+
const INFERENCE_TIMEOUT = 35000;
|
|
4979
|
+
const LOCAL_RUNNER_FN = functoolsKit.timeout(async (params) => {
|
|
4980
|
+
return await engine.runnerPrivateService.getCompletion(params);
|
|
4981
|
+
}, INFERENCE_TIMEOUT);
|
|
4962
4982
|
/**
|
|
4963
4983
|
* Standard runner completion handler registration.
|
|
4964
4984
|
*
|
|
@@ -4988,7 +5008,11 @@ agentSwarmKit.addCompletion({
|
|
|
4988
5008
|
agentSwarmKit.addCompletion({
|
|
4989
5009
|
completionName: CompletionName.RunnerCompletion,
|
|
4990
5010
|
getCompletion: async (params) => {
|
|
4991
|
-
|
|
5011
|
+
const result = await LOCAL_RUNNER_FN(params);
|
|
5012
|
+
if (typeof result === "symbol") {
|
|
5013
|
+
throw new Error(`${CompletionName.RunnerCompletion} inference timeout`);
|
|
5014
|
+
}
|
|
5015
|
+
return result;
|
|
4992
5016
|
},
|
|
4993
5017
|
});
|
|
4994
5018
|
|
package/build/index.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import MarkdownIt from 'markdown-it';
|
|
|
5
5
|
import sanitizeHtml from 'sanitize-html';
|
|
6
6
|
import { lint } from 'markdownlint/promise';
|
|
7
7
|
import { applyFixes } from 'markdownlint';
|
|
8
|
-
import { ToolRegistry, memoize, singleshot, randomString, fetchApi, str } from 'functools-kit';
|
|
8
|
+
import { ToolRegistry, memoize, singleshot, randomString, fetchApi, str, timeout } from 'functools-kit';
|
|
9
9
|
import OpenAI from 'openai';
|
|
10
10
|
import { AIMessage, SystemMessage, HumanMessage, ToolMessage } from '@langchain/core/messages';
|
|
11
11
|
import { ChatXAI } from '@langchain/xai';
|
|
@@ -4887,6 +4887,10 @@ init();
|
|
|
4887
4887
|
Object.assign(globalThis, { engine });
|
|
4888
4888
|
var lib = engine;
|
|
4889
4889
|
|
|
4890
|
+
const INFERENCE_TIMEOUT$2 = 35000;
|
|
4891
|
+
const LOCAL_RUNNER_FN$2 = timeout(async (params) => {
|
|
4892
|
+
return await engine.runnerPrivateService.getOutlineCompletion(params);
|
|
4893
|
+
}, INFERENCE_TIMEOUT$2);
|
|
4890
4894
|
/**
|
|
4891
4895
|
* Outline runner completion handler registration.
|
|
4892
4896
|
*
|
|
@@ -4918,11 +4922,19 @@ var lib = engine;
|
|
|
4918
4922
|
addCompletion({
|
|
4919
4923
|
completionName: CompletionName.RunnerOutlineCompletion,
|
|
4920
4924
|
getCompletion: async (params) => {
|
|
4921
|
-
|
|
4925
|
+
const result = await LOCAL_RUNNER_FN$2(params);
|
|
4926
|
+
if (typeof result === "symbol") {
|
|
4927
|
+
throw new Error(`${CompletionName.RunnerOutlineCompletion} inference timeout`);
|
|
4928
|
+
}
|
|
4929
|
+
return result;
|
|
4922
4930
|
},
|
|
4923
4931
|
json: true,
|
|
4924
4932
|
});
|
|
4925
4933
|
|
|
4934
|
+
const INFERENCE_TIMEOUT$1 = 35000;
|
|
4935
|
+
const LOCAL_RUNNER_FN$1 = timeout(async (params) => {
|
|
4936
|
+
return await engine.runnerPrivateService.getStreamCompletion(params);
|
|
4937
|
+
}, INFERENCE_TIMEOUT$1);
|
|
4926
4938
|
/**
|
|
4927
4939
|
* Streaming runner completion handler registration.
|
|
4928
4940
|
*
|
|
@@ -4953,10 +4965,18 @@ addCompletion({
|
|
|
4953
4965
|
addCompletion({
|
|
4954
4966
|
completionName: CompletionName.RunnerStreamCompletion,
|
|
4955
4967
|
getCompletion: async (params) => {
|
|
4956
|
-
|
|
4968
|
+
const result = await LOCAL_RUNNER_FN$1(params);
|
|
4969
|
+
if (typeof result === "symbol") {
|
|
4970
|
+
throw new Error(`${CompletionName.RunnerCompletion} inference timeout`);
|
|
4971
|
+
}
|
|
4972
|
+
return result;
|
|
4957
4973
|
},
|
|
4958
4974
|
});
|
|
4959
4975
|
|
|
4976
|
+
const INFERENCE_TIMEOUT = 35000;
|
|
4977
|
+
const LOCAL_RUNNER_FN = timeout(async (params) => {
|
|
4978
|
+
return await engine.runnerPrivateService.getCompletion(params);
|
|
4979
|
+
}, INFERENCE_TIMEOUT);
|
|
4960
4980
|
/**
|
|
4961
4981
|
* Standard runner completion handler registration.
|
|
4962
4982
|
*
|
|
@@ -4986,7 +5006,11 @@ addCompletion({
|
|
|
4986
5006
|
addCompletion({
|
|
4987
5007
|
completionName: CompletionName.RunnerCompletion,
|
|
4988
5008
|
getCompletion: async (params) => {
|
|
4989
|
-
|
|
5009
|
+
const result = await LOCAL_RUNNER_FN(params);
|
|
5010
|
+
if (typeof result === "symbol") {
|
|
5011
|
+
throw new Error(`${CompletionName.RunnerCompletion} inference timeout`);
|
|
5012
|
+
}
|
|
5013
|
+
return result;
|
|
4990
5014
|
},
|
|
4991
5015
|
});
|
|
4992
5016
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backtest-kit/ollama",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "Multi-provider LLM inference library for AI-powered trading strategies. Supports 10+ providers including OpenAI, Claude, DeepSeek, Grok, Mistral with unified API and automatic token rotation.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Petr Tripolsky",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"@huggingface/inference": "4.7.1"
|
|
84
84
|
},
|
|
85
85
|
"peerDependencies": {
|
|
86
|
-
"backtest-kit": "^
|
|
86
|
+
"backtest-kit": "^2.0.3",
|
|
87
87
|
"typescript": "^5.0.0",
|
|
88
88
|
"ollama": "^0.6.0",
|
|
89
89
|
"openai": "^4.97.0",
|