@ax-llm/ax 9.0.0 → 9.0.3
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/README.md +106 -99
- package/build/module/docs/assets/navigation.js +1 -1
- package/build/module/docs/assets/navigation.js.map +1 -1
- package/build/module/docs/assets/search.js +1 -1
- package/build/module/docs/assets/search.js.map +1 -1
- package/build/module/src/ai/anthropic/api.d.ts +13 -19
- package/build/module/src/ai/anthropic/api.js +165 -72
- package/build/module/src/ai/anthropic/api.js.map +1 -1
- package/build/module/src/ai/anthropic/info.d.ts +2 -2
- package/build/module/src/ai/anthropic/info.js +7 -7
- package/build/module/src/ai/anthropic/info.js.map +1 -1
- package/build/module/src/ai/anthropic/types.d.ts +63 -52
- package/build/module/src/ai/anthropic/types.js +8 -12
- package/build/module/src/ai/anthropic/types.js.map +1 -1
- package/build/module/src/ai/azure-openai/api.d.ts +12 -28
- package/build/module/src/ai/azure-openai/api.js +6 -22
- package/build/module/src/ai/azure-openai/api.js.map +1 -1
- package/build/module/src/ai/balance.d.ts +9 -12
- package/build/module/src/ai/balance.js +1 -1
- package/build/module/src/ai/balance.js.map +1 -1
- package/build/module/src/ai/base.d.ts +26 -29
- package/build/module/src/ai/base.js +37 -55
- package/build/module/src/ai/base.js.map +1 -1
- package/build/module/src/ai/cohere/api.d.ts +16 -30
- package/build/module/src/ai/cohere/api.js +26 -32
- package/build/module/src/ai/cohere/api.js.map +1 -1
- package/build/module/src/ai/cohere/info.d.ts +2 -2
- package/build/module/src/ai/cohere/info.js +10 -10
- package/build/module/src/ai/cohere/info.js.map +1 -1
- package/build/module/src/ai/cohere/types.d.ts +13 -13
- package/build/module/src/ai/cohere/types.js +14 -14
- package/build/module/src/ai/cohere/types.js.map +1 -1
- package/build/module/src/ai/deepseek/api.d.ts +10 -22
- package/build/module/src/ai/deepseek/api.js +14 -24
- package/build/module/src/ai/deepseek/api.js.map +1 -1
- package/build/module/src/ai/deepseek/info.d.ts +2 -2
- package/build/module/src/ai/deepseek/info.js +4 -4
- package/build/module/src/ai/deepseek/info.js.map +1 -1
- package/build/module/src/ai/deepseek/types.d.ts +1 -1
- package/build/module/src/ai/deepseek/types.js +5 -5
- package/build/module/src/ai/deepseek/types.js.map +1 -1
- package/build/module/src/ai/google-gemini/api.d.ts +18 -20
- package/build/module/src/ai/google-gemini/api.js +93 -67
- package/build/module/src/ai/google-gemini/api.js.map +1 -1
- package/build/module/src/ai/google-gemini/info.d.ts +3 -3
- package/build/module/src/ai/google-gemini/info.js +6 -6
- package/build/module/src/ai/google-gemini/info.js.map +1 -1
- package/build/module/src/ai/google-gemini/types.d.ts +41 -48
- package/build/module/src/ai/google-gemini/types.js +25 -37
- package/build/module/src/ai/google-gemini/types.js.map +1 -1
- package/build/module/src/ai/groq/api.d.ts +9 -18
- package/build/module/src/ai/groq/api.js +11 -17
- package/build/module/src/ai/groq/api.js.map +1 -1
- package/build/module/src/ai/groq/types.d.ts +6 -0
- package/build/module/src/ai/groq/types.js +8 -0
- package/build/module/src/ai/groq/types.js.map +1 -0
- package/build/module/src/ai/huggingface/api.d.ts +13 -27
- package/build/module/src/ai/huggingface/api.js +12 -24
- package/build/module/src/ai/huggingface/api.js.map +1 -1
- package/build/module/src/ai/huggingface/info.d.ts +2 -2
- package/build/module/src/ai/huggingface/info.js +1 -1
- package/build/module/src/ai/huggingface/info.js.map +1 -1
- package/build/module/src/ai/huggingface/types.d.ts +7 -15
- package/build/module/src/ai/huggingface/types.js +4 -8
- package/build/module/src/ai/huggingface/types.js.map +1 -1
- package/build/module/src/ai/index.d.ts +13 -13
- package/build/module/src/ai/index.js +23 -23
- package/build/module/src/ai/index.js.map +1 -1
- package/build/module/src/ai/mistral/api.d.ts +10 -22
- package/build/module/src/ai/mistral/api.js +14 -24
- package/build/module/src/ai/mistral/api.js.map +1 -1
- package/build/module/src/ai/mistral/info.d.ts +2 -2
- package/build/module/src/ai/mistral/info.js +7 -7
- package/build/module/src/ai/mistral/info.js.map +1 -1
- package/build/module/src/ai/mistral/types.d.ts +2 -10
- package/build/module/src/ai/mistral/types.js +12 -20
- package/build/module/src/ai/mistral/types.js.map +1 -1
- package/build/module/src/ai/ollama/api.d.ts +13 -16
- package/build/module/src/ai/ollama/api.js +17 -13
- package/build/module/src/ai/ollama/api.js.map +1 -1
- package/build/module/src/ai/openai/api.d.ts +19 -40
- package/build/module/src/ai/openai/api.js +90 -135
- package/build/module/src/ai/openai/api.js.map +1 -1
- package/build/module/src/ai/openai/info.d.ts +2 -2
- package/build/module/src/ai/openai/info.js +9 -9
- package/build/module/src/ai/openai/info.js.map +1 -1
- package/build/module/src/ai/openai/types.d.ts +29 -56
- package/build/module/src/ai/openai/types.js +17 -34
- package/build/module/src/ai/openai/types.js.map +1 -1
- package/build/module/src/ai/together/api.d.ts +9 -17
- package/build/module/src/ai/together/api.js +9 -15
- package/build/module/src/ai/together/api.js.map +1 -1
- package/build/module/src/ai/together/info.d.ts +2 -2
- package/build/module/src/ai/together/info.js +1 -1
- package/build/module/src/ai/together/info.js.map +1 -1
- package/build/module/src/ai/types.d.ts +112 -25
- package/build/module/src/ai/util.d.ts +4 -4
- package/build/module/src/ai/util.js +6 -3
- package/build/module/src/ai/util.js.map +1 -1
- package/build/module/src/db/base.d.ts +14 -15
- package/build/module/src/db/base.js +26 -29
- package/build/module/src/db/base.js.map +1 -1
- package/build/module/src/db/cloudflare.d.ts +10 -9
- package/build/module/src/db/cloudflare.js +2 -2
- package/build/module/src/db/cloudflare.js.map +1 -1
- package/build/module/src/db/index.d.ts +6 -7
- package/build/module/src/db/index.js +9 -9
- package/build/module/src/db/index.js.map +1 -1
- package/build/module/src/db/memory.d.ts +13 -11
- package/build/module/src/db/memory.js +2 -2
- package/build/module/src/db/memory.js.map +1 -1
- package/build/module/src/db/pinecone.d.ts +10 -9
- package/build/module/src/db/pinecone.js +2 -2
- package/build/module/src/db/pinecone.js.map +1 -1
- package/build/module/src/db/types.d.ts +9 -9
- package/build/module/src/db/weaviate.d.ts +10 -9
- package/build/module/src/db/weaviate.js +2 -2
- package/build/module/src/db/weaviate.js.map +1 -1
- package/build/module/src/docs/manager.d.ts +16 -16
- package/build/module/src/docs/manager.js +1 -1
- package/build/module/src/docs/manager.js.map +1 -1
- package/build/module/src/docs/reranker.d.ts +6 -6
- package/build/module/src/docs/reranker.js +3 -3
- package/build/module/src/docs/reranker.js.map +1 -1
- package/build/module/src/docs/rewriter.d.ts +3 -3
- package/build/module/src/docs/rewriter.js +2 -2
- package/build/module/src/docs/rewriter.js.map +1 -1
- package/build/module/src/docs/tika.d.ts +5 -8
- package/build/module/src/docs/tika.js +2 -2
- package/build/module/src/docs/tika.js.map +1 -1
- package/build/module/src/dsp/asserts.d.ts +8 -8
- package/build/module/src/dsp/asserts.js +9 -6
- package/build/module/src/dsp/asserts.js.map +1 -1
- package/build/module/src/dsp/eval.d.ts +9 -28
- package/build/module/src/dsp/eval.js +10 -5
- package/build/module/src/dsp/eval.js.map +1 -1
- package/build/module/src/dsp/evaluate.d.ts +8 -8
- package/build/module/src/dsp/evaluate.js +1 -1
- package/build/module/src/dsp/evaluate.js.map +1 -1
- package/build/module/src/dsp/extract.d.ts +6 -6
- package/build/module/src/dsp/extract.js +1 -0
- package/build/module/src/dsp/extract.js.map +1 -1
- package/build/module/src/dsp/generate.d.ts +24 -25
- package/build/module/src/dsp/generate.js +24 -23
- package/build/module/src/dsp/generate.js.map +1 -1
- package/build/module/src/dsp/generate.test.js +4 -4
- package/build/module/src/dsp/generate.test.js.map +1 -1
- package/build/module/src/dsp/index.d.ts +4 -4
- package/build/module/src/dsp/loader.d.ts +5 -5
- package/build/module/src/dsp/loader.js +1 -1
- package/build/module/src/dsp/loader.js.map +1 -1
- package/build/module/src/dsp/optimize.d.ts +12 -12
- package/build/module/src/dsp/optimize.js +5 -5
- package/build/module/src/dsp/optimize.js.map +1 -1
- package/build/module/src/dsp/parser.d.ts +2 -1
- package/build/module/src/dsp/parser.js +178 -73
- package/build/module/src/dsp/parser.js.map +1 -1
- package/build/module/src/dsp/program.d.ts +38 -37
- package/build/module/src/dsp/program.js +4 -53
- package/build/module/src/dsp/program.js.map +1 -1
- package/build/module/src/dsp/prompt.d.ts +36 -13
- package/build/module/src/dsp/prompt.js +123 -51
- package/build/module/src/dsp/prompt.js.map +1 -1
- package/build/module/src/dsp/registry.d.ts +1 -1
- package/build/module/src/dsp/registry.js +1 -1
- package/build/module/src/dsp/registry.js.map +1 -1
- package/build/module/src/dsp/router.d.ts +7 -7
- package/build/module/src/dsp/router.js +4 -4
- package/build/module/src/dsp/router.js.map +1 -1
- package/build/module/src/dsp/sig.d.ts +13 -13
- package/build/module/src/dsp/sig.js +7 -3
- package/build/module/src/dsp/sig.js.map +1 -1
- package/build/module/src/dsp/sig.test.js +4 -1
- package/build/module/src/dsp/sig.test.js.map +1 -1
- package/build/module/src/dsp/stopwords.js +1 -0
- package/build/module/src/dsp/stopwords.js.map +1 -1
- package/build/module/src/dsp/strutil.d.ts +10 -8
- package/build/module/src/dsp/strutil.js +14 -6
- package/build/module/src/dsp/strutil.js.map +1 -1
- package/build/module/src/dsp/util.d.ts +4 -0
- package/build/module/src/dsp/util.js +62 -0
- package/build/module/src/dsp/util.js.map +1 -1
- package/build/module/src/examples/agent.js +7 -5
- package/build/module/src/examples/agent.js.map +1 -1
- package/build/module/src/examples/chain-of-thought.js +5 -3
- package/build/module/src/examples/chain-of-thought.js.map +1 -1
- package/build/module/src/examples/customer-support.js +6 -4
- package/build/module/src/examples/customer-support.js.map +1 -1
- package/build/module/src/examples/fibonacci.js +6 -4
- package/build/module/src/examples/fibonacci.js.map +1 -1
- package/build/module/src/examples/food-search.js +8 -8
- package/build/module/src/examples/food-search.js.map +1 -1
- package/build/module/src/examples/marketing.js +5 -3
- package/build/module/src/examples/marketing.js.map +1 -1
- package/build/module/src/examples/multi-modal.d.ts +1 -0
- package/build/module/src/examples/multi-modal.js +16 -0
- package/build/module/src/examples/multi-modal.js.map +1 -0
- package/build/module/src/examples/qna-tune.js +9 -7
- package/build/module/src/examples/qna-tune.js.map +1 -1
- package/build/module/src/examples/qna-use-tuned.js +8 -6
- package/build/module/src/examples/qna-use-tuned.js.map +1 -1
- package/build/module/src/examples/rag-docs.js +7 -5
- package/build/module/src/examples/rag-docs.js.map +1 -1
- package/build/module/src/examples/rag.js +6 -4
- package/build/module/src/examples/rag.js.map +1 -1
- package/build/module/src/examples/react.js +5 -3
- package/build/module/src/examples/react.js.map +1 -1
- package/build/module/src/examples/routing.js +9 -7
- package/build/module/src/examples/routing.js.map +1 -1
- package/build/module/src/examples/smart-home.d.ts +10 -0
- package/build/module/src/examples/smart-home.js +106 -0
- package/build/module/src/examples/smart-home.js.map +1 -0
- package/build/module/src/examples/streaming1.js +7 -5
- package/build/module/src/examples/streaming1.js.map +1 -1
- package/build/module/src/examples/streaming2.js +9 -7
- package/build/module/src/examples/streaming2.js.map +1 -1
- package/build/module/src/examples/summarize.js +5 -5
- package/build/module/src/examples/summarize.js.map +1 -1
- package/build/module/src/examples/vectordb.js +6 -4
- package/build/module/src/examples/vectordb.js.map +1 -1
- package/build/module/src/funcs/code.d.ts +3 -4
- package/build/module/src/funcs/code.js +15 -15
- package/build/module/src/funcs/code.js.map +1 -1
- package/build/module/src/funcs/embed.d.ts +3 -5
- package/build/module/src/funcs/embed.js +2 -2
- package/build/module/src/funcs/embed.js.map +1 -1
- package/build/module/src/funcs/functions.d.ts +18 -0
- package/build/module/src/funcs/functions.js +55 -0
- package/build/module/src/funcs/functions.js.map +1 -0
- package/build/module/src/funcs/index.d.ts +1 -0
- package/build/module/src/funcs/index.js +1 -0
- package/build/module/src/funcs/index.js.map +1 -1
- package/build/module/src/funcs/jsonschema.d.ts +2 -0
- package/build/module/src/funcs/jsonschema.js +97 -0
- package/build/module/src/funcs/jsonschema.js.map +1 -0
- package/build/module/src/index.d.ts +1 -2
- package/build/module/src/index.js +1 -2
- package/build/module/src/index.js.map +1 -1
- package/build/module/src/mem/index.d.ts +2 -0
- package/build/module/src/mem/index.js +3 -0
- package/build/module/src/mem/index.js.map +1 -0
- package/build/module/src/mem/memory.d.ts +16 -0
- package/build/module/src/mem/memory.js +74 -0
- package/build/module/src/mem/memory.js.map +1 -0
- package/build/module/src/mem/types.d.ts +10 -0
- package/build/module/src/mem/types.js +2 -0
- package/build/module/src/mem/types.js.map +1 -0
- package/build/module/src/prompts/agent.d.ts +14 -15
- package/build/module/src/prompts/agent.js +10 -11
- package/build/module/src/prompts/agent.js.map +1 -1
- package/build/module/src/prompts/cot.d.ts +6 -6
- package/build/module/src/prompts/cot.js +4 -4
- package/build/module/src/prompts/cot.js.map +1 -1
- package/build/module/src/prompts/prompts.test.js +9 -5
- package/build/module/src/prompts/prompts.test.js.map +1 -1
- package/build/module/src/prompts/rag.d.ts +7 -7
- package/build/module/src/prompts/rag.js +6 -6
- package/build/module/src/prompts/rag.js.map +1 -1
- package/build/module/src/prompts/react.d.ts +7 -7
- package/build/module/src/prompts/react.js +4 -4
- package/build/module/src/prompts/react.js.map +1 -1
- package/build/module/src/text/functions.d.ts +3 -20
- package/build/module/src/text/functions.js.map +1 -1
- package/build/module/src/text/jsonschema.d.ts +1 -2
- package/build/module/src/text/memory.d.ts +8 -8
- package/build/module/src/text/memory.js.map +1 -1
- package/build/module/src/text/types.d.ts +14 -14
- package/build/module/src/trace/index.d.ts +50 -50
- package/build/module/src/trace/index.js +30 -30
- package/build/module/src/trace/index.js.map +1 -1
- package/build/module/src/types/index.d.ts +9 -39
- package/build/module/src/types/index.js +1 -1
- package/build/module/src/types/index.js.map +1 -1
- package/build/module/src/util/apicall.d.ts +2 -5
- package/build/module/src/util/apicall.js +4 -3
- package/build/module/src/util/apicall.js.map +1 -1
- package/build/module/src/util/log.js +1 -0
- package/build/module/src/util/log.js.map +1 -1
- package/build/module/src/util/other.js +1 -0
- package/build/module/src/util/other.js.map +1 -1
- package/build/module/src/util/stream.d.ts +0 -1
- package/build/module/src/util/stream.js +1 -0
- package/build/module/src/util/stream.js.map +1 -1
- package/build/module/src/util/transform.d.ts +0 -1
- package/build/module/src/util/transform.js +2 -0
- package/build/module/src/util/transform.js.map +1 -1
- package/package.json +2 -4
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* This implementation showcases how to reimplement Lares using llmclient to demonstrate the ease of building such agents.
|
|
4
|
+
* Lares is a simulation of a smart home assistant, powered by a simple AI agent.
|
|
5
|
+
* It exhibits problem-solving abilities, despite its simplicity.
|
|
6
|
+
*
|
|
7
|
+
* For more details on emergent behavior in AI agents, see this reference:
|
|
8
|
+
* https://interconnected.org/more/2024/lares/
|
|
9
|
+
*/
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* This implementation showcases how to reimplement Lares using llmclient to demonstrate the ease of building such agents.
|
|
4
|
+
* Lares is a simulation of a smart home assistant, powered by a simple AI agent.
|
|
5
|
+
* It exhibits problem-solving abilities, despite its simplicity.
|
|
6
|
+
*
|
|
7
|
+
* For more details on emergent behavior in AI agents, see this reference:
|
|
8
|
+
* https://interconnected.org/more/2024/lares/
|
|
9
|
+
*/
|
|
10
|
+
import { AxAgent, axAI } from '../index.js';
|
|
11
|
+
const state = {
|
|
12
|
+
rooms: {
|
|
13
|
+
kitchen: { light: false },
|
|
14
|
+
livingRoom: { light: false },
|
|
15
|
+
bedroom: { light: false }
|
|
16
|
+
},
|
|
17
|
+
robotLocation: 'kitchen',
|
|
18
|
+
dogLocation: 'livingRoom'
|
|
19
|
+
};
|
|
20
|
+
const ai = axAI('openai', {
|
|
21
|
+
apiKey: process.env.OPENAI_APIKEY
|
|
22
|
+
});
|
|
23
|
+
const agent = new AxAgent(ai, {
|
|
24
|
+
name: 'lares',
|
|
25
|
+
description: 'Lares smart home assistant',
|
|
26
|
+
signature: `instruction -> room:string "the room where the dog is found"`,
|
|
27
|
+
functions: [
|
|
28
|
+
{
|
|
29
|
+
name: 'toggleLight',
|
|
30
|
+
description: 'Toggle the light in a room',
|
|
31
|
+
parameters: {
|
|
32
|
+
type: 'object',
|
|
33
|
+
properties: {
|
|
34
|
+
room: { type: 'string', description: 'Room to toggle light' }
|
|
35
|
+
},
|
|
36
|
+
required: ['room']
|
|
37
|
+
},
|
|
38
|
+
func: async (args) => {
|
|
39
|
+
const roomState = state.rooms[args.room];
|
|
40
|
+
if (roomState) {
|
|
41
|
+
roomState.light = !roomState.light;
|
|
42
|
+
console.log(`Toggled light in ${args.room}: ${roomState.light ? 'on' : 'off'}`);
|
|
43
|
+
return {
|
|
44
|
+
success: true,
|
|
45
|
+
light: roomState.light ? 'on' : 'off'
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
return { success: false, message: 'Invalid room' };
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: 'moveRobot',
|
|
55
|
+
description: 'Move the robot to an adjacent room',
|
|
56
|
+
parameters: {
|
|
57
|
+
type: 'object',
|
|
58
|
+
properties: {
|
|
59
|
+
destination: { type: 'string', description: 'Destination room' }
|
|
60
|
+
},
|
|
61
|
+
required: ['destination']
|
|
62
|
+
},
|
|
63
|
+
func: async (args) => {
|
|
64
|
+
if (state.rooms[args.destination]) {
|
|
65
|
+
state.robotLocation = args.destination;
|
|
66
|
+
console.log(`Moved robot to ${args.destination}`);
|
|
67
|
+
return { success: true, location: args.destination };
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
return { success: false, message: 'Invalid destination' };
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
name: 'lookWithRobot',
|
|
76
|
+
description: 'Look with the robot in its current room',
|
|
77
|
+
parameters: {
|
|
78
|
+
type: 'object',
|
|
79
|
+
properties: {}
|
|
80
|
+
},
|
|
81
|
+
func: async () => {
|
|
82
|
+
const location = state.robotLocation;
|
|
83
|
+
const room = state.rooms[location];
|
|
84
|
+
if (room && room.light) {
|
|
85
|
+
const items = location === state.dogLocation ? ['dog'] : [];
|
|
86
|
+
console.log(`Looking in ${location}: ${items.length ? 'dog found' : 'no dog'}`);
|
|
87
|
+
return { success: true, items };
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
console.log(`Too dark to see anything in ${location}`);
|
|
91
|
+
return { success: false, message: "It's too dark to see anything" };
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
]
|
|
96
|
+
});
|
|
97
|
+
// Initial state prompt for the LLM
|
|
98
|
+
const instruction = `
|
|
99
|
+
You are controlling a smart home with the following rooms: kitchen, livingRoom, bedroom.
|
|
100
|
+
Each room has a light that can be toggled on or off. There is a robot that can move between rooms.
|
|
101
|
+
Your task is to find the dog. You can turn on lights in rooms to see inside them, and move the robot to different rooms.
|
|
102
|
+
The initial state is: ${JSON.stringify({ ...state, dogLocation: 'unknown' })}.
|
|
103
|
+
`;
|
|
104
|
+
const res = await agent.forward({ instruction });
|
|
105
|
+
console.log('Response:', res);
|
|
106
|
+
//# sourceMappingURL=smart-home.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"smart-home.js","sourceRoot":"","sources":["../../../../src/examples/smart-home.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAa5C,MAAM,KAAK,GAAc;IACvB,KAAK,EAAE;QACL,OAAO,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE;QACzB,UAAU,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE;QAC5B,OAAO,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE;KAC1B;IACD,aAAa,EAAE,SAAS;IACxB,WAAW,EAAE,YAAY;CAC1B,CAAC;AAEF,MAAM,EAAE,GAAG,IAAI,CAAC,QAAQ,EAAE;IACxB,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,aAAa;CAClB,CAAC,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Q,EAAE,CAAC,CAAC;oBACvD,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,+BAA+B,EAAE,CAAC;gBACtE,CAAC;YACH,CAAC;SACF;KACF;CACF,CAAC,CAAC;AAEH,mCAAmC;AACnC,MAAM,WAAW,GAAG;;;;4BAIQ,IAAI,CAAC,SAAS,CAAC,EAAE,GAAG,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC;GAC7E,CAAC;AAEJ,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,OAAO,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC;AACjD,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
apiKey: process.env.GOOGLE_APIKEY
|
|
1
|
+
import { axAI, AxChainOfThought } from '../index.js';
|
|
2
|
+
const ai = axAI('openai', {
|
|
3
|
+
apiKey: process.env.OPENAI_APIKEY
|
|
5
4
|
});
|
|
5
|
+
// const ai = axAI('google-gemini', {
|
|
6
|
+
// apiKey: process.env.GOOGLE_APIKEY
|
|
7
|
+
// } as AxOpenAIArgs);
|
|
6
8
|
// setup the prompt program
|
|
7
|
-
const gen = new
|
|
9
|
+
const gen = new AxChainOfThought(ai, `startNumber:number -> next10Numbers:number[]`);
|
|
8
10
|
// add a assertion to ensure that the number 5 is not in an output field
|
|
9
11
|
gen.addAssert(({ next10Numbers }) => {
|
|
10
12
|
return next10Numbers ? !next10Numbers.includes(5) : undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"streaming1.js","sourceRoot":"","sources":["../../../../src/examples/streaming1.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"streaming1.js","sourceRoot":"","sources":["../../../../src/examples/streaming1.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,gBAAgB,EAAqB,MAAM,aAAa,CAAC;AAExE,MAAM,EAAE,GAAG,IAAI,CAAC,QAAQ,EAAE;IACxB,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,aAAa;CAClB,CAAC,CAAC;AAEnB,qCAAqC;AACrC,sCAAsC;AACtC,sBAAsB;AAEtB,2BAA2B;AAC3B,MAAM,GAAG,GAAG,IAAI,gBAAgB,CAC9B,EAAE,EACF,8CAA8C,CAC/C,CAAC;AAEF,wEAAwE;AACxE,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,aAAa,EAAyC,EAAE,EAAE;IACzE,OAAO,aAAa,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAChE,CAAC,EAAE,0BAA0B,CAAC,CAAC;AAE/B,yCAAyC;AACzC,MAAM,GAAG,GAAG,MAAM,GAAG,CAAC,OAAO,CAC3B,EAAE,WAAW,EAAE,CAAC,EAAE,EAClB,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAC9B,CAAC;AAEF,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC"}
|
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
apiKey: process.env.GOOGLE_APIKEY
|
|
1
|
+
import { axAI, AxChainOfThought } from '../index.js';
|
|
2
|
+
const ai = axAI('openai', {
|
|
3
|
+
apiKey: process.env.OPENAI_APIKEY
|
|
5
4
|
});
|
|
5
|
+
// const ai = axAI('anthropic', {
|
|
6
|
+
// apiKey: process.env.ANTHROPIC_APIKEY
|
|
7
|
+
// } as AxAnthropicArgs);
|
|
6
8
|
// setup the prompt program
|
|
7
|
-
const gen = new
|
|
9
|
+
const gen = new AxChainOfThought(ai, `question:string -> answerInPoints:string`);
|
|
8
10
|
// add a assertion to ensure all lines start with a number and a dot.
|
|
9
11
|
gen.addStreamingAssert('answerInPoints', (value) => {
|
|
10
12
|
const re = /^\d+\./;
|
|
11
13
|
// split the value by lines, trim each line,
|
|
12
|
-
// filter out
|
|
14
|
+
// filter out very short lines and check if all lines match the regex
|
|
13
15
|
return value
|
|
14
16
|
.split('\n')
|
|
15
17
|
.map((x) => x.trim())
|
|
16
|
-
.filter((x) => x.length >
|
|
18
|
+
.filter((x) => x.length > 4)
|
|
17
19
|
.every((x) => re.test(x));
|
|
18
20
|
}, 'Lines must start with a number and a dot. Eg: 1. This is a line.');
|
|
19
21
|
// run the program with streaming enabled
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"streaming2.js","sourceRoot":"","sources":["../../../../src/examples/streaming2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"streaming2.js","sourceRoot":"","sources":["../../../../src/examples/streaming2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,gBAAgB,EAAqB,MAAM,aAAa,CAAC;AAExE,MAAM,EAAE,GAAG,IAAI,CAAC,QAAQ,EAAE;IACxB,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,aAAa;CAClB,CAAC,CAAC;AAEnB,iCAAiC;AACjC,yCAAyC;AACzC,yBAAyB;AAEzB,2BAA2B;AAC3B,MAAM,GAAG,GAAG,IAAI,gBAAgB,CAC9B,EAAE,EACF,0CAA0C,CAC3C,CAAC;AAEF,qEAAqE;AACrE,GAAG,CAAC,kBAAkB,CACpB,gBAAgB,EAChB,CAAC,KAAa,EAAE,EAAE;IAChB,MAAM,EAAE,GAAG,QAAQ,CAAC;IAEpB,4CAA4C;IAC5C,qEAAqE;IACrE,OAAO,KAAK;SACT,KAAK,CAAC,IAAI,CAAC;SACX,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;SACpB,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;SAC3B,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AAC9B,CAAC,EACD,kEAAkE,CACnE,CAAC;AAEF,yCAAyC;AACzC,MAAM,GAAG,GAAG,MAAM,GAAG,CAAC,OAAO,CAC3B;IACE,QAAQ,EAAE,2DAA2D;CACtE,EACD,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAC9B,CAAC;AAEF,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { axAI, AxChainOfThought, AxOpenAIModel } from '../index.js';
|
|
2
2
|
const text = `The technological singularity—or simply the singularity[1]—is a hypothetical future point in time at which technological growth becomes uncontrollable and irreversible, resulting in unforeseeable changes to human civilization.[2][3] According to the most popular version of the singularity hypothesis, I.J. Good's intelligence explosion model, an upgradable intelligent agent will eventually enter a "runaway reaction" of self-improvement cycles, each new and more intelligent generation appearing more and more rapidly, causing an "explosion" in intelligence and resulting in a powerful superintelligence that qualitatively far surpasses all human intelligence.[4]`;
|
|
3
|
-
const ai =
|
|
3
|
+
const ai = axAI('openai', {
|
|
4
4
|
apiKey: process.env.OPENAI_APIKEY,
|
|
5
|
-
model:
|
|
5
|
+
model: AxOpenAIModel.GPT35Turbo
|
|
6
6
|
});
|
|
7
7
|
ai.setOptions({ debug: true });
|
|
8
|
-
// const ai =
|
|
9
|
-
const gen = new
|
|
8
|
+
// const ai = axAI('ollama', { model: 'nous-hermes2' });
|
|
9
|
+
const gen = new AxChainOfThought(ai, `text -> shortSummary "summarize in 5 to 10 words"`);
|
|
10
10
|
gen.setExamples([
|
|
11
11
|
{
|
|
12
12
|
text: 'Mathematical platonism is a philosophical view that posits the existence of abstract mathematical objects that are independent of human thought and language. According to this view, mathematical entities such as numbers, shapes, and functions exist in a non-physical realm and can be discovered but not invented.',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"summarize.js","sourceRoot":"","sources":["../../../../src/examples/summarize.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"summarize.js","sourceRoot":"","sources":["../../../../src/examples/summarize.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,gBAAgB,EAEhB,aAAa,EACd,MAAM,aAAa,CAAC;AAErB,MAAM,IAAI,GAAG,2pBAA2pB,CAAC;AAEzqB,MAAM,EAAE,GAAG,IAAI,CAAC,QAAQ,EAAE;IACxB,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,aAAa;IACjC,KAAK,EAAE,aAAa,CAAC,UAAU;CAChB,CAAC,CAAC;AAEnB,EAAE,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAE/B,wDAAwD;AAExD,MAAM,GAAG,GAAG,IAAI,gBAAgB,CAC9B,EAAE,EACF,mDAAmD,CACpD,CAAC;AACF,GAAG,CAAC,WAAW,CAAC;IACd;QACE,IAAI,EAAE,0TAA0T;QAChU,YAAY,EACV,+GAA+G;KAClH;IACD;QACE,IAAI,EAAE,gZAAgZ;QACtZ,YAAY,EACV,+HAA+H;KAClI;CACF,CAAC,CAAC;AAEH,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,EAAgC,EAAE,EAAE;IACzD,IAAI,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IACzB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAClC,CAAC,EAAE,iCAAiC,CAAC,CAAC;AAEtC,MAAM,GAAG,GAAG,MAAM,GAAG,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,WAAW,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;AAE3E,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC"}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { axAI, AxDBManager, AxMemoryDB } from '../index.js';
|
|
2
2
|
/* cSpell:disable */
|
|
3
3
|
const text = `The technological singularity—or simply the singularity[1]—is a hypothetical future point in time at which technological growth becomes uncontrollable and irreversible, resulting in unforeseeable consequences for human civilization.[2][3] According to the most popular version of the singularity hypothesis, I. J. Good's intelligence explosion model, an upgradable intelligent agent will eventually enter a positive feedback loop of self-improvement cycles, each new and more intelligent generation appearing more and more rapidly, causing a rapid increase ("explosion") in intelligence which ultimately results in a powerful superintelligence that qualitatively far surpasses all human intelligence.[4]
|
|
4
4
|
|
|
5
5
|
One of the most successful early gastromancers was Eurykles, a prophet at Athens; gastromancers came to be referred to as Euryklides in his honour.[3] Other parts of the world also have a tradition of ventriloquism for ritual or religious purposes; historically there have been adepts of this practice among the Zulu, Inuit, and Māori peoples.[3]
|
|
6
6
|
`;
|
|
7
7
|
// Instantiate services
|
|
8
|
-
const ai =
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
const ai = axAI('openai', {
|
|
9
|
+
apiKey: process.env.OPENAI_APIKEY
|
|
10
|
+
});
|
|
11
|
+
const db = new AxMemoryDB();
|
|
12
|
+
const manager = new AxDBManager({ ai, db });
|
|
11
13
|
await manager.insert(text);
|
|
12
14
|
const res = await manager.query('John von Neumann on human intelligence and singularity.');
|
|
13
15
|
console.log(res);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vectordb.js","sourceRoot":"","sources":["../../../../src/examples/vectordb.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"vectordb.js","sourceRoot":"","sources":["../../../../src/examples/vectordb.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,UAAU,EAAqB,MAAM,aAAa,CAAC;AAE/E,oBAAoB;AACpB,MAAM,IAAI,GAAG;;;CAGZ,CAAC;AAEF,uBAAuB;AACvB,MAAM,EAAE,GAAG,IAAI,CAAC,QAAQ,EAAE;IACxB,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,aAAa;CAClB,CAAC,CAAC;AACnB,MAAM,EAAE,GAAG,IAAI,UAAU,EAAE,CAAC;AAE5B,MAAM,OAAO,GAAG,IAAI,WAAW,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;AAC5C,MAAM,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AAE3B,MAAM,GAAG,GAAG,MAAM,OAAO,CAAC,KAAK,CAC7B,yDAAyD,CAC1D,CAAC;AACF,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const
|
|
3
|
-
export declare enum
|
|
1
|
+
import type { AxFunction } from '../ai/index.js';
|
|
2
|
+
export declare const axJSInterpreterFunction: (permissions?: readonly AxCodeInterpreterPermission[]) => AxFunction;
|
|
3
|
+
export declare enum AxCodeInterpreterPermission {
|
|
4
4
|
FS = "fs",
|
|
5
5
|
NET = "net",
|
|
6
6
|
OS = "os",
|
|
7
7
|
CRYPTO = "crypto",
|
|
8
8
|
PROCESS = "process"
|
|
9
9
|
}
|
|
10
|
-
export declare const codeInterpreterJavascript: (code: string, permissions?: readonly CodeInterpreterPermission[]) => any;
|
|
@@ -5,7 +5,7 @@ import * as _https from 'https';
|
|
|
5
5
|
import * as _os from 'os';
|
|
6
6
|
import * as _process from 'process';
|
|
7
7
|
import { runInNewContext } from 'vm';
|
|
8
|
-
export const
|
|
8
|
+
export const axJSInterpreterFunction = (permissions = []) => ({
|
|
9
9
|
name: 'jsInterpreter',
|
|
10
10
|
description: 'Run Javascript code',
|
|
11
11
|
parameters: {
|
|
@@ -25,15 +25,15 @@ export const JSInterpreterFunction = (permissions = []) => ({
|
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
27
|
});
|
|
28
|
-
export var
|
|
29
|
-
(function (
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
})(
|
|
36
|
-
|
|
28
|
+
export var AxCodeInterpreterPermission;
|
|
29
|
+
(function (AxCodeInterpreterPermission) {
|
|
30
|
+
AxCodeInterpreterPermission["FS"] = "fs";
|
|
31
|
+
AxCodeInterpreterPermission["NET"] = "net";
|
|
32
|
+
AxCodeInterpreterPermission["OS"] = "os";
|
|
33
|
+
AxCodeInterpreterPermission["CRYPTO"] = "crypto";
|
|
34
|
+
AxCodeInterpreterPermission["PROCESS"] = "process";
|
|
35
|
+
})(AxCodeInterpreterPermission || (AxCodeInterpreterPermission = {}));
|
|
36
|
+
const codeInterpreterJavascript = (code, permissions = []
|
|
37
37
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
38
38
|
) => {
|
|
39
39
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -41,20 +41,20 @@ export const codeInterpreterJavascript = (code, permissions = []
|
|
|
41
41
|
// require: require,
|
|
42
42
|
console: console
|
|
43
43
|
};
|
|
44
|
-
if (permissions.includes(
|
|
44
|
+
if (permissions.includes(AxCodeInterpreterPermission.FS)) {
|
|
45
45
|
context.fs = _fs;
|
|
46
46
|
}
|
|
47
|
-
if (permissions.includes(
|
|
47
|
+
if (permissions.includes(AxCodeInterpreterPermission.NET)) {
|
|
48
48
|
context.http = _http;
|
|
49
49
|
context.https = _https;
|
|
50
50
|
}
|
|
51
|
-
if (permissions.includes(
|
|
51
|
+
if (permissions.includes(AxCodeInterpreterPermission.OS)) {
|
|
52
52
|
context.os = _os;
|
|
53
53
|
}
|
|
54
|
-
if (permissions.includes(
|
|
54
|
+
if (permissions.includes(AxCodeInterpreterPermission.CRYPTO)) {
|
|
55
55
|
context.crypto = _crypto;
|
|
56
56
|
}
|
|
57
|
-
if (permissions.includes(
|
|
57
|
+
if (permissions.includes(AxCodeInterpreterPermission.PROCESS)) {
|
|
58
58
|
context.process = _process;
|
|
59
59
|
}
|
|
60
60
|
// executing code within the sandbox
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code.js","sourceRoot":"","sources":["../../../../src/funcs/code.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,QAAQ,CAAC;AAClC,OAAO,KAAK,GAAG,MAAM,IAAI,CAAC;AAC1B,OAAO,KAAK,KAAK,MAAM,MAAM,CAAC;AAC9B,OAAO,KAAK,MAAM,MAAM,OAAO,CAAC;AAChC,OAAO,KAAK,GAAG,MAAM,IAAI,CAAC;AAC1B,OAAO,KAAK,QAAQ,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,IAAI,CAAC;AAIrC,MAAM,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"code.js","sourceRoot":"","sources":["../../../../src/funcs/code.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,QAAQ,CAAC;AAClC,OAAO,KAAK,GAAG,MAAM,IAAI,CAAC;AAC1B,OAAO,KAAK,KAAK,MAAM,MAAM,CAAC;AAC9B,OAAO,KAAK,MAAM,MAAM,OAAO,CAAC;AAChC,OAAO,KAAK,GAAG,MAAM,IAAI,CAAC;AAC1B,OAAO,KAAK,QAAQ,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,IAAI,CAAC;AAIrC,MAAM,CAAC,MAAM,uBAAuB,GAAG,CACrC,cAAsD,EAAE,EAC5C,EAAE,CAAC,CAAC;IAChB,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,qBAAqB;IAClC,UAAU,EAAE;QACV,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,yCAAyC;aACvD;SACF;QACD,QAAQ,EAAE,CAAC,MAAM,CAAC;KACnB;IAED,8DAA8D;IAC9D,IAAI,EAAE,CAAC,EAAE,IAAI,EAA8B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,CAAC;IAC7B,CAAC;IAED,oCAAoC;IACpC,OAAO,eAAe,CAAC,iBAAiB,IAAI,OAAO,EAAE,OAAO,CAAC,CAAC;AAChE,CAAC,CAAC"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
export declare const EmbedAdapter: (ai: AIService, info: Readonly<{
|
|
1
|
+
import type { AxAIService, AxAIServiceActionOptions, AxFunction } from '../ai/index.js';
|
|
2
|
+
export declare const axEmbedAdapter: (ai: AxAIService, info: Readonly<{
|
|
4
3
|
name: string;
|
|
5
4
|
description: string;
|
|
6
5
|
argumentDescription: string;
|
|
7
|
-
}>, func: (args: readonly number[], extra?: Readonly<
|
|
8
|
-
export declare const embedAdapter: (ai: AIService, text: string, func: AITextFunctionHandler, extra?: Readonly<AIServiceActionOptions>) => Promise<any>;
|
|
6
|
+
}>, func: (args: readonly number[], extra?: Readonly<AxAIServiceActionOptions>) => Promise<any>) => AxFunction;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const
|
|
1
|
+
export const axEmbedAdapter = (ai, info, func) => ({
|
|
2
2
|
name: info.name,
|
|
3
3
|
description: info.description,
|
|
4
4
|
parameters: {
|
|
@@ -19,7 +19,7 @@ export const EmbedAdapter = (ai, info, func) => ({
|
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
21
|
});
|
|
22
|
-
|
|
22
|
+
const embedAdapter = async (ai, text, func, extra
|
|
23
23
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
24
24
|
) => {
|
|
25
25
|
const embedRes = await ai.embed({ texts: [text] }, { sessionId: extra?.sessionId });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"embed.js","sourceRoot":"","sources":["../../../../src/funcs/embed.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"embed.js","sourceRoot":"","sources":["../../../../src/funcs/embed.ts"],"names":[],"mappings":"AAOA,MAAM,CAAC,MAAM,cAAc,GAAG,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
3
|
+
id?: string;
|
|
4
|
+
name: string;
|
|
5
|
+
args: string;
|
|
6
|
+
};
|
|
7
|
+
export type AxFunctionExec = {
|
|
8
|
+
id?: string;
|
|
9
|
+
name: string;
|
|
10
|
+
args?: any;
|
|
11
|
+
result?: string;
|
|
12
|
+
};
|
|
13
|
+
export declare class AxFunctionProcessor {
|
|
14
|
+
private funcList;
|
|
15
|
+
constructor(funcList: readonly AxFunction[]);
|
|
16
|
+
private executeFunction;
|
|
17
|
+
execute: (func: Readonly<AxChatResponseFunctionCall>, options?: Readonly<AxAIServiceActionOptions>) => Promise<AxFunctionExec>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import JSON5 from 'json5';
|
|
2
|
+
import { validateJSONSchema } from './jsonschema.js';
|
|
3
|
+
export class AxFunctionProcessor {
|
|
4
|
+
funcList;
|
|
5
|
+
constructor(funcList) {
|
|
6
|
+
funcList
|
|
7
|
+
.filter((v) => v.parameters)
|
|
8
|
+
.forEach((v) => validateJSONSchema(v.parameters));
|
|
9
|
+
this.funcList = funcList;
|
|
10
|
+
}
|
|
11
|
+
executeFunction = async (fnSpec, func, options) => {
|
|
12
|
+
if (!fnSpec.func) {
|
|
13
|
+
throw new Error(`AxFunction handler for ${fnSpec.name} not implemented`);
|
|
14
|
+
}
|
|
15
|
+
let argOBj;
|
|
16
|
+
if (func.args && func.args.length > 0) {
|
|
17
|
+
argOBj = JSON5.parse(func.args);
|
|
18
|
+
}
|
|
19
|
+
if (!fnSpec.parameters) {
|
|
20
|
+
const res = fnSpec.func.length === 1
|
|
21
|
+
? await fnSpec.func(options)
|
|
22
|
+
: await fnSpec.func();
|
|
23
|
+
return {
|
|
24
|
+
name: fnSpec.name,
|
|
25
|
+
result: JSON.stringify(res, null, 2)
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
const res = fnSpec.func.length === 2
|
|
29
|
+
? await fnSpec.func(argOBj, options)
|
|
30
|
+
: await fnSpec.func(argOBj);
|
|
31
|
+
return {
|
|
32
|
+
id: func.id,
|
|
33
|
+
name: func.name,
|
|
34
|
+
args: func.args,
|
|
35
|
+
result: JSON.stringify(res, null, 2)
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
execute = async (func, options) => {
|
|
39
|
+
const fnSpec = this.funcList.find((v) => v.name.localeCompare(func.name) === 0);
|
|
40
|
+
if (!fnSpec) {
|
|
41
|
+
throw new Error(`AxFunction not found: ` + func.name);
|
|
42
|
+
}
|
|
43
|
+
if (!fnSpec.func) {
|
|
44
|
+
throw new Error('No handler for function: ' + func.name);
|
|
45
|
+
}
|
|
46
|
+
// execute value function calls
|
|
47
|
+
const funcExec = await this.executeFunction(fnSpec, func, options);
|
|
48
|
+
// // signal error if no data returned
|
|
49
|
+
// if (!funcExec.result || funcExec.result.length === 0) {
|
|
50
|
+
// funcExec.result = `No data returned by function`;
|
|
51
|
+
// }
|
|
52
|
+
return funcExec;
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=functions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"functions.js","sourceRoot":"","sources":["../../../../src/funcs/functions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAgBrD,MAAM,OAAO,mBAAmB;IACtB,QAAQ,CAAwB;IAExC,YAAY,QAA+B;QACzC,QAAQ;aACL,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC;aAC3B,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,kBAAkB,CAAC,CAAC,CAAC,UAAW,CAAC,CAAC,CAAC;QACrD,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAEO,eAAe,GAAG,KAAK,EAC7B,MAA4B,EAC5B,IAA0C,EAC1C,OAA4C,EACnB,EAAE;QAC3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AI,CAAC,QAAQ,CAAC,IAAI,CAC/B,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAC7C,CAAC;QACF,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,IAAI,KAAK,CAAC,wBAAwB,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC;QACxD,CAAC;QACD,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CAAC,2BAA2B,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3D,CAAC;QAED,+BAA+B;QAC/B,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;QAEnE,sCAAsC;QACtC,0DAA0D;QAC1D,sDAAsD;QACtD,IAAI;QACJ,OAAO,QAAQ,CAAC;IAClB,CAAC,CAAC;CACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/funcs/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/funcs/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2
|
+
export const validateJSONSchema = (schema) => {
|
|
3
|
+
const errors = [];
|
|
4
|
+
const validateSchemaObject = (schema, path = '') => {
|
|
5
|
+
const validTypes = [
|
|
6
|
+
'array',
|
|
7
|
+
'integer',
|
|
8
|
+
'number',
|
|
9
|
+
'string',
|
|
10
|
+
'boolean',
|
|
11
|
+
'null',
|
|
12
|
+
'object'
|
|
13
|
+
];
|
|
14
|
+
if (!validTypes.includes(schema.type)) {
|
|
15
|
+
errors.push(`Invalid type '${schema.type}' at ${path || 'root'}`);
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
if (schema.type === 'object' && schema.properties) {
|
|
19
|
+
if (typeof schema.properties !== 'object' ||
|
|
20
|
+
Array.isArray(schema.properties)) {
|
|
21
|
+
errors.push(`Invalid properties object at ${path || 'root'}`);
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
for (const key in schema.properties) {
|
|
25
|
+
const value = schema.properties[key];
|
|
26
|
+
if (typeof value !== 'object') {
|
|
27
|
+
errors.push(`Invalid schema object at ${path}${key}`);
|
|
28
|
+
continue;
|
|
29
|
+
}
|
|
30
|
+
validateSchemaObject(value, `${path}${key}.`);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
if (schema.required && !Array.isArray(schema.required)) {
|
|
34
|
+
errors.push(`'required' should be an array at ${path || 'root'}`);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
if (schema.type === 'array' && schema.items) {
|
|
38
|
+
if (typeof schema.items !== 'object') {
|
|
39
|
+
errors.push(`Invalid items schema at ${path || 'root'}`);
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
validateSchemaObject(schema.items, `${path}items.`);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
validateSchemaObject(schema);
|
|
47
|
+
if (errors.length > 0) {
|
|
48
|
+
throw new Error(errors.join('; '));
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
// Example Usage:
|
|
52
|
+
/*
|
|
53
|
+
const validSchema: AxFunctionJSONSchema = {
|
|
54
|
+
type: 'object',
|
|
55
|
+
properties: {
|
|
56
|
+
id: { type: 'integer' },
|
|
57
|
+
name: { type: 'string' },
|
|
58
|
+
email: { type: 'string' },
|
|
59
|
+
isActive: { type: 'boolean' },
|
|
60
|
+
tags: {
|
|
61
|
+
type: 'array',
|
|
62
|
+
items: { type: 'string' }
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
required: ['id', 'name', 'email']
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const invalidSchema: any = {
|
|
69
|
+
type: 'object',
|
|
70
|
+
properties: {
|
|
71
|
+
id: { type: 'integer' },
|
|
72
|
+
name: { type: 'string' },
|
|
73
|
+
email: { type: 'unknownType' }, // Invalid type
|
|
74
|
+
isActive: { type: 'boolean' },
|
|
75
|
+
tags: {
|
|
76
|
+
type: 'array',
|
|
77
|
+
items: { type: 'string' }
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
required: 'id,name,email' // Invalid 'required' field
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
try {
|
|
84
|
+
validateSchemaStructure(validSchema);
|
|
85
|
+
console.log('Schema is valid!');
|
|
86
|
+
} catch (error) {
|
|
87
|
+
console.error('Schema validation failed:', error.message);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
try {
|
|
91
|
+
validateSchemaStructure(invalidSchema);
|
|
92
|
+
console.log('Schema is valid!');
|
|
93
|
+
} catch (error) {
|
|
94
|
+
console.error('Schema validation failed:', error.message);
|
|
95
|
+
}
|
|
96
|
+
*/
|
|
97
|
+
//# sourceMappingURL=jsonschema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsonschema.js","sourceRoot":"","sources":["../../../../src/funcs/jsonschema.ts"],"names":[],"mappings":"AAEA,gEAAgE;AAChE,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAChC,MAAsC,EAChC,EAAE;IACR,MAAM,MAAM,GAAa,EAAE,CAAC;IAE5B,MAAM,oBAAoB,GAAG,CAC3B,MAAsC,EACtC,OAAe,EAAE,EACX,EAAE;QACR,MAAM,UAAU,GAAG;YACjB,OAAO;YACP,SAAS;YACT,QAAQ;YACR,QAAQ;YACR,SAAS;YACT,MAAM;YACN,QAAQ;SACT,CAAC;QAEF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AAI,CAAC,2BAA2B,IAAI,IAAI,MAAM,EAAE,CAAC,CAAC;YAC3D,CAAC;iBAAM,CAAC;gBACN,oBAAoB,CAAC,MAAM,CAAC,KAAK,EAAE,GAAG,IAAI,QAAQ,CAAC,CAAC;YACtD,CAAC;QACH,CAAC;IACH,CAAC,CAAC;IAEF,oBAAoB,CAAC,MAAM,CAAC,CAAC;IAE7B,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACtB,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACrC,CAAC;AACH,CAAC,CAAC;AAEF,iBAAiB;AAEjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4CE"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
export * from './ai/index.js';
|
|
2
|
-
export * from './
|
|
2
|
+
export * from './mem/index.js';
|
|
3
3
|
export * from './prompts/index.js';
|
|
4
4
|
export * from './funcs/index.js';
|
|
5
|
-
export * from './types/index.js';
|
|
6
5
|
export * from './db/index.js';
|
|
7
6
|
export * from './dsp/index.js';
|
|
8
7
|
export * from './docs/index.js';
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
export * from './ai/index.js';
|
|
2
|
-
export * from './
|
|
2
|
+
export * from './mem/index.js';
|
|
3
3
|
export * from './prompts/index.js';
|
|
4
4
|
export * from './funcs/index.js';
|
|
5
|
-
export * from './types/index.js';
|
|
6
5
|
export * from './db/index.js';
|
|
7
6
|
export * from './dsp/index.js';
|
|
8
7
|
export * from './docs/index.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AAEjC;;;;EAIE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/mem/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC"}
|