@ax-llm/ax 9.0.19 → 9.0.20
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/package.json +33 -85
- package/CHANGELOG.md +0 -184
- package/LICENSE +0 -201
- package/README.md +0 -569
- package/build/module/docs/assets/icons.d.ts +0 -1
- package/build/module/docs/assets/icons.js +0 -19
- package/build/module/docs/assets/icons.js.map +0 -1
- package/build/module/docs/assets/main.d.ts +0 -1
- package/build/module/docs/assets/main.js +0 -629
- package/build/module/docs/assets/main.js.map +0 -1
- package/build/module/docs/assets/navigation.d.ts +0 -1
- package/build/module/docs/assets/navigation.js +0 -3
- package/build/module/docs/assets/navigation.js.map +0 -1
- package/build/module/docs/assets/search.d.ts +0 -1
- package/build/module/docs/assets/search.js +0 -3
- package/build/module/docs/assets/search.js.map +0 -1
- package/build/module/src/ai/anthropic/api.d.ts +0 -19
- package/build/module/src/ai/anthropic/api.js +0 -326
- package/build/module/src/ai/anthropic/api.js.map +0 -1
- package/build/module/src/ai/anthropic/index.d.ts +0 -2
- package/build/module/src/ai/anthropic/index.js +0 -3
- package/build/module/src/ai/anthropic/index.js.map +0 -1
- package/build/module/src/ai/anthropic/info.d.ts +0 -2
- package/build/module/src/ai/anthropic/info.js +0 -40
- package/build/module/src/ai/anthropic/info.js.map +0 -1
- package/build/module/src/ai/anthropic/types.d.ts +0 -171
- package/build/module/src/ai/anthropic/types.js +0 -10
- package/build/module/src/ai/anthropic/types.js.map +0 -1
- package/build/module/src/ai/azure-openai/api.d.ts +0 -19
- package/build/module/src/ai/azure-openai/api.js +0 -30
- package/build/module/src/ai/azure-openai/api.js.map +0 -1
- package/build/module/src/ai/azure-openai/index.d.ts +0 -1
- package/build/module/src/ai/azure-openai/index.js +0 -2
- package/build/module/src/ai/azure-openai/index.js.map +0 -1
- package/build/module/src/ai/balance.d.ts +0 -23
- package/build/module/src/ai/balance.js +0 -87
- package/build/module/src/ai/balance.js.map +0 -1
- package/build/module/src/ai/base.d.ts +0 -55
- package/build/module/src/ai/base.js +0 -343
- package/build/module/src/ai/base.js.map +0 -1
- package/build/module/src/ai/cohere/api.d.ts +0 -22
- package/build/module/src/ai/cohere/api.js +0 -264
- package/build/module/src/ai/cohere/api.js.map +0 -1
- package/build/module/src/ai/cohere/index.d.ts +0 -2
- package/build/module/src/ai/cohere/index.js +0 -3
- package/build/module/src/ai/cohere/index.js.map +0 -1
- package/build/module/src/ai/cohere/info.d.ts +0 -2
- package/build/module/src/ai/cohere/info.js +0 -52
- package/build/module/src/ai/cohere/info.js.map +0 -1
- package/build/module/src/ai/cohere/types.d.ts +0 -102
- package/build/module/src/ai/cohere/types.js +0 -23
- package/build/module/src/ai/cohere/types.js.map +0 -1
- package/build/module/src/ai/deepseek/api.d.ts +0 -16
- package/build/module/src/ai/deepseek/api.js +0 -32
- package/build/module/src/ai/deepseek/api.js.map +0 -1
- package/build/module/src/ai/deepseek/index.d.ts +0 -2
- package/build/module/src/ai/deepseek/index.js +0 -3
- package/build/module/src/ai/deepseek/index.js.map +0 -1
- package/build/module/src/ai/deepseek/info.d.ts +0 -2
- package/build/module/src/ai/deepseek/info.js +0 -16
- package/build/module/src/ai/deepseek/info.js.map +0 -1
- package/build/module/src/ai/deepseek/types.d.ts +0 -8
- package/build/module/src/ai/deepseek/types.js +0 -10
- package/build/module/src/ai/deepseek/types.js.map +0 -1
- package/build/module/src/ai/google-gemini/api.d.ts +0 -36
- package/build/module/src/ai/google-gemini/api.js +0 -299
- package/build/module/src/ai/google-gemini/api.js.map +0 -1
- package/build/module/src/ai/google-gemini/index.d.ts +0 -2
- package/build/module/src/ai/google-gemini/index.js +0 -3
- package/build/module/src/ai/google-gemini/index.js.map +0 -1
- package/build/module/src/ai/google-gemini/info.d.ts +0 -6
- package/build/module/src/ai/google-gemini/info.js +0 -29
- package/build/module/src/ai/google-gemini/info.js.map +0 -1
- package/build/module/src/ai/google-gemini/types.d.ts +0 -146
- package/build/module/src/ai/google-gemini/types.js +0 -27
- package/build/module/src/ai/google-gemini/types.js.map +0 -1
- package/build/module/src/ai/groq/api.d.ts +0 -18
- package/build/module/src/ai/groq/api.js +0 -52
- package/build/module/src/ai/groq/api.js.map +0 -1
- package/build/module/src/ai/groq/index.d.ts +0 -1
- package/build/module/src/ai/groq/index.js +0 -2
- package/build/module/src/ai/groq/index.js.map +0 -1
- package/build/module/src/ai/groq/types.d.ts +0 -6
- package/build/module/src/ai/groq/types.js +0 -8
- package/build/module/src/ai/groq/types.js.map +0 -1
- package/build/module/src/ai/huggingface/api.d.ts +0 -19
- package/build/module/src/ai/huggingface/api.js +0 -115
- package/build/module/src/ai/huggingface/api.js.map +0 -1
- package/build/module/src/ai/huggingface/index.d.ts +0 -2
- package/build/module/src/ai/huggingface/index.js +0 -3
- package/build/module/src/ai/huggingface/index.js.map +0 -1
- package/build/module/src/ai/huggingface/info.d.ts +0 -6
- package/build/module/src/ai/huggingface/info.js +0 -6
- package/build/module/src/ai/huggingface/info.js.map +0 -1
- package/build/module/src/ai/huggingface/types.d.ts +0 -34
- package/build/module/src/ai/huggingface/types.js +0 -5
- package/build/module/src/ai/huggingface/types.js.map +0 -1
- package/build/module/src/ai/index.d.ts +0 -16
- package/build/module/src/ai/index.js +0 -16
- package/build/module/src/ai/index.js.map +0 -1
- package/build/module/src/ai/mistral/api.d.ts +0 -16
- package/build/module/src/ai/mistral/api.js +0 -32
- package/build/module/src/ai/mistral/api.js.map +0 -1
- package/build/module/src/ai/mistral/index.d.ts +0 -2
- package/build/module/src/ai/mistral/index.js +0 -3
- package/build/module/src/ai/mistral/index.js.map +0 -1
- package/build/module/src/ai/mistral/info.d.ts +0 -2
- package/build/module/src/ai/mistral/info.js +0 -34
- package/build/module/src/ai/mistral/info.js.map +0 -1
- package/build/module/src/ai/mistral/types.d.ts +0 -10
- package/build/module/src/ai/mistral/types.js +0 -13
- package/build/module/src/ai/mistral/types.js.map +0 -1
- package/build/module/src/ai/ollama/api.d.ts +0 -22
- package/build/module/src/ai/ollama/api.js +0 -32
- package/build/module/src/ai/ollama/api.js.map +0 -1
- package/build/module/src/ai/ollama/index.d.ts +0 -1
- package/build/module/src/ai/ollama/index.js +0 -2
- package/build/module/src/ai/ollama/index.js.map +0 -1
- package/build/module/src/ai/openai/api.d.ts +0 -29
- package/build/module/src/ai/openai/api.js +0 -283
- package/build/module/src/ai/openai/api.js.map +0 -1
- package/build/module/src/ai/openai/index.d.ts +0 -2
- package/build/module/src/ai/openai/index.js +0 -3
- package/build/module/src/ai/openai/index.js.map +0 -1
- package/build/module/src/ai/openai/info.d.ts +0 -6
- package/build/module/src/ai/openai/info.js +0 -50
- package/build/module/src/ai/openai/info.js.map +0 -1
- package/build/module/src/ai/openai/types.d.ts +0 -165
- package/build/module/src/ai/openai/types.js +0 -18
- package/build/module/src/ai/openai/types.js.map +0 -1
- package/build/module/src/ai/together/api.d.ts +0 -15
- package/build/module/src/ai/together/api.js +0 -28
- package/build/module/src/ai/together/api.js.map +0 -1
- package/build/module/src/ai/together/index.d.ts +0 -1
- package/build/module/src/ai/together/index.js +0 -2
- package/build/module/src/ai/together/index.js.map +0 -1
- package/build/module/src/ai/together/info.d.ts +0 -2
- package/build/module/src/ai/together/info.js +0 -2
- package/build/module/src/ai/together/info.js.map +0 -1
- package/build/module/src/ai/types.d.ts +0 -159
- package/build/module/src/ai/types.js +0 -2
- package/build/module/src/ai/types.js.map +0 -1
- package/build/module/src/ai/util.d.ts +0 -12
- package/build/module/src/ai/util.js +0 -63
- package/build/module/src/ai/util.js.map +0 -1
- package/build/module/src/ai/wrap.d.ts +0 -47
- package/build/module/src/ai/wrap.js +0 -95
- package/build/module/src/ai/wrap.js.map +0 -1
- package/build/module/src/db/base.d.ts +0 -23
- package/build/module/src/db/base.js +0 -87
- package/build/module/src/db/base.js.map +0 -1
- package/build/module/src/db/cloudflare.d.ts +0 -21
- package/build/module/src/db/cloudflare.js +0 -98
- package/build/module/src/db/cloudflare.js.map +0 -1
- package/build/module/src/db/index.d.ts +0 -6
- package/build/module/src/db/index.js +0 -7
- package/build/module/src/db/index.js.map +0 -1
- package/build/module/src/db/memory.d.ts +0 -21
- package/build/module/src/db/memory.js +0 -99
- package/build/module/src/db/memory.js.map +0 -1
- package/build/module/src/db/pinecone.d.ts +0 -21
- package/build/module/src/db/pinecone.js +0 -71
- package/build/module/src/db/pinecone.js.map +0 -1
- package/build/module/src/db/types.d.ts +0 -35
- package/build/module/src/db/types.js +0 -3
- package/build/module/src/db/types.js.map +0 -1
- package/build/module/src/db/weaviate.d.ts +0 -21
- package/build/module/src/db/weaviate.js +0 -127
- package/build/module/src/db/weaviate.js.map +0 -1
- package/build/module/src/db/wrap.d.ts +0 -13
- package/build/module/src/db/wrap.js +0 -35
- package/build/module/src/db/wrap.js.map +0 -1
- package/build/module/src/docs/index.d.ts +0 -4
- package/build/module/src/docs/index.js +0 -5
- package/build/module/src/docs/index.js.map +0 -1
- package/build/module/src/docs/manager.d.ts +0 -45
- package/build/module/src/docs/manager.js +0 -159
- package/build/module/src/docs/manager.js.map +0 -1
- package/build/module/src/docs/reranker.d.ts +0 -7
- package/build/module/src/docs/reranker.js +0 -26
- package/build/module/src/docs/reranker.js.map +0 -1
- package/build/module/src/docs/rewriter.d.ts +0 -4
- package/build/module/src/docs/rewriter.js +0 -9
- package/build/module/src/docs/rewriter.js.map +0 -1
- package/build/module/src/docs/tika.d.ts +0 -18
- package/build/module/src/docs/tika.js +0 -46
- package/build/module/src/docs/tika.js.map +0 -1
- package/build/module/src/dsp/asserts.d.ts +0 -32
- package/build/module/src/dsp/asserts.js +0 -91
- package/build/module/src/dsp/asserts.js.map +0 -1
- package/build/module/src/dsp/eval.d.ts +0 -43
- package/build/module/src/dsp/eval.js +0 -125
- package/build/module/src/dsp/eval.js.map +0 -1
- package/build/module/src/dsp/evaluate.d.ts +0 -12
- package/build/module/src/dsp/evaluate.js +0 -32
- package/build/module/src/dsp/evaluate.js.map +0 -1
- package/build/module/src/dsp/extract.d.ts +0 -25
- package/build/module/src/dsp/extract.js +0 -153
- package/build/module/src/dsp/extract.js.map +0 -1
- package/build/module/src/dsp/generate.d.ts +0 -55
- package/build/module/src/dsp/generate.js +0 -314
- package/build/module/src/dsp/generate.js.map +0 -1
- package/build/module/src/dsp/generate.test.d.ts +0 -1
- package/build/module/src/dsp/generate.test.js +0 -41
- package/build/module/src/dsp/generate.test.js.map +0 -1
- package/build/module/src/dsp/index.d.ts +0 -15
- package/build/module/src/dsp/index.js +0 -11
- package/build/module/src/dsp/index.js.map +0 -1
- package/build/module/src/dsp/loader.d.ts +0 -30
- package/build/module/src/dsp/loader.js +0 -81
- package/build/module/src/dsp/loader.js.map +0 -1
- package/build/module/src/dsp/optimize.d.ts +0 -27
- package/build/module/src/dsp/optimize.js +0 -95
- package/build/module/src/dsp/optimize.js.map +0 -1
- package/build/module/src/dsp/parser.d.ts +0 -87
- package/build/module/src/dsp/parser.js +0 -1542
- package/build/module/src/dsp/parser.js.map +0 -1
- package/build/module/src/dsp/program.d.ts +0 -73
- package/build/module/src/dsp/program.js +0 -116
- package/build/module/src/dsp/program.js.map +0 -1
- package/build/module/src/dsp/prompt.d.ts +0 -48
- package/build/module/src/dsp/prompt.js +0 -260
- package/build/module/src/dsp/prompt.js.map +0 -1
- package/build/module/src/dsp/registry.d.ts +0 -6
- package/build/module/src/dsp/registry.js +0 -15
- package/build/module/src/dsp/registry.js.map +0 -1
- package/build/module/src/dsp/router.d.ts +0 -26
- package/build/module/src/dsp/router.js +0 -71
- package/build/module/src/dsp/router.js.map +0 -1
- package/build/module/src/dsp/sig.d.ts +0 -37
- package/build/module/src/dsp/sig.js +0 -194
- package/build/module/src/dsp/sig.js.map +0 -1
- package/build/module/src/dsp/sig.test.d.ts +0 -1
- package/build/module/src/dsp/sig.test.js +0 -28
- package/build/module/src/dsp/sig.test.js.map +0 -1
- package/build/module/src/dsp/stopwords.d.ts +0 -1
- package/build/module/src/dsp/stopwords.js +0 -1164
- package/build/module/src/dsp/stopwords.js.map +0 -1
- package/build/module/src/dsp/strutil.d.ts +0 -11
- package/build/module/src/dsp/strutil.js +0 -60
- package/build/module/src/dsp/strutil.js.map +0 -1
- package/build/module/src/dsp/util.d.ts +0 -5
- package/build/module/src/dsp/util.js +0 -76
- package/build/module/src/dsp/util.js.map +0 -1
- package/build/module/src/funcs/code.d.ts +0 -9
- package/build/module/src/funcs/code.js +0 -63
- package/build/module/src/funcs/code.js.map +0 -1
- package/build/module/src/funcs/embed.d.ts +0 -6
- package/build/module/src/funcs/embed.js +0 -29
- package/build/module/src/funcs/embed.js.map +0 -1
- package/build/module/src/funcs/functions.d.ts +0 -16
- package/build/module/src/funcs/functions.js +0 -55
- package/build/module/src/funcs/functions.js.map +0 -1
- package/build/module/src/funcs/index.d.ts +0 -3
- package/build/module/src/funcs/index.js +0 -4
- package/build/module/src/funcs/index.js.map +0 -1
- package/build/module/src/funcs/jsonschema.d.ts +0 -2
- package/build/module/src/funcs/jsonschema.js +0 -97
- package/build/module/src/funcs/jsonschema.js.map +0 -1
- package/build/module/src/index.d.ts +0 -9
- package/build/module/src/index.js.map +0 -1
- package/build/module/src/mem/index.d.ts +0 -2
- package/build/module/src/mem/index.js +0 -3
- package/build/module/src/mem/index.js.map +0 -1
- package/build/module/src/mem/memory.d.ts +0 -16
- package/build/module/src/mem/memory.js +0 -77
- package/build/module/src/mem/memory.js.map +0 -1
- package/build/module/src/mem/types.d.ts +0 -10
- package/build/module/src/mem/types.js +0 -2
- package/build/module/src/mem/types.js.map +0 -1
- package/build/module/src/prompts/agent.d.ts +0 -34
- package/build/module/src/prompts/agent.js +0 -108
- package/build/module/src/prompts/agent.js.map +0 -1
- package/build/module/src/prompts/cot.d.ts +0 -9
- package/build/module/src/prompts/cot.js +0 -17
- package/build/module/src/prompts/cot.js.map +0 -1
- package/build/module/src/prompts/index.d.ts +0 -4
- package/build/module/src/prompts/index.js +0 -5
- package/build/module/src/prompts/index.js.map +0 -1
- package/build/module/src/prompts/prompts.test.d.ts +0 -1
- package/build/module/src/prompts/prompts.test.js +0 -54
- package/build/module/src/prompts/prompts.test.js.map +0 -1
- package/build/module/src/prompts/rag.d.ts +0 -23
- package/build/module/src/prompts/rag.js +0 -30
- package/build/module/src/prompts/rag.js.map +0 -1
- package/build/module/src/prompts/react.d.ts +0 -8
- package/build/module/src/prompts/react.js +0 -22
- package/build/module/src/prompts/react.js.map +0 -1
- package/build/module/src/trace/index.d.ts +0 -171
- package/build/module/src/trace/index.js +0 -67
- package/build/module/src/trace/index.js.map +0 -1
- package/build/module/src/util/apicall.d.ts +0 -18
- package/build/module/src/util/apicall.js +0 -50
- package/build/module/src/util/apicall.js.map +0 -1
- package/build/module/src/util/log.d.ts +0 -14
- package/build/module/src/util/log.js +0 -31
- package/build/module/src/util/log.js.map +0 -1
- package/build/module/src/util/other.d.ts +0 -1
- package/build/module/src/util/other.js +0 -5
- package/build/module/src/util/other.js.map +0 -1
- package/build/module/src/util/rate-limit.d.ts +0 -24
- package/build/module/src/util/rate-limit.js +0 -49
- package/build/module/src/util/rate-limit.js.map +0 -1
- package/build/module/src/util/stream.d.ts +0 -9
- package/build/module/src/util/stream.js +0 -29
- package/build/module/src/util/stream.js.map +0 -1
- package/build/module/src/util/transform.d.ts +0 -7
- package/build/module/src/util/transform.js +0 -59
- package/build/module/src/util/transform.js.map +0 -1
- /package/{build/module/src/index.js → index.js} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"memory.js","sourceRoot":"","sources":["../../../../src/mem/memory.ts"],"names":[],"mappings":"AAMA,MAAM,OAAO,QAAQ;IACX,IAAI,GAAgC,EAAE,CAAC;IACvC,KAAK,GAAG,IAAI,GAAG,EAAuC,CAAC;IACvD,KAAK,CAAS;IAEtB,YAAY,KAAK,GAAG,EAAE;QACpB,IAAI,KAAK,IAAI,CAAC,EAAE,CAAC;YACf,MAAM,KAAK,CAAC,wCAAwC,CAAC,CAAC;QACxD,CAAC;QACD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IA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AK,CAAC,GAAG,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;QAChC,CAAC;QAED,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;IACzC,CAAC;CACF"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { AxChatRequest, AxChatResponseResult } from '../ai/index.js';
|
|
2
|
-
export interface AxAIMemory {
|
|
3
|
-
add(result: Readonly<AxChatRequest['chatPrompt'] | AxChatRequest['chatPrompt'][0]>, sessionId?: string): void;
|
|
4
|
-
addResult(result: Readonly<AxChatResponseResult>, sessionId?: string): void;
|
|
5
|
-
updateResult(result: Readonly<AxChatResponseResult>, sessionId?: string): void;
|
|
6
|
-
history(sessionId?: string): AxChatRequest['chatPrompt'];
|
|
7
|
-
peek(sessionId?: string): AxChatRequest['chatPrompt'];
|
|
8
|
-
reset(sessionId?: string): void;
|
|
9
|
-
getLast(sessionId?: string): AxChatRequest['chatPrompt'][0] | undefined;
|
|
10
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/mem/types.ts"],"names":[],"mappings":""}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import type { AxAIService, AxFunction } from '../ai/types.js';
|
|
2
|
-
import { type AxGenerateOptions, AxSignature } from '../dsp/index.js';
|
|
3
|
-
import { type AxGenIn, type AxGenOut, type AxProgramDemos, type AxProgramExamples, type AxProgramForwardOptions, type AxTunable, type AxUsable } from '../dsp/program.js';
|
|
4
|
-
export interface AxAgentic extends AxTunable, AxUsable {
|
|
5
|
-
getFunction(): AxFunction;
|
|
6
|
-
}
|
|
7
|
-
export type AxAgentOptions = Omit<AxGenerateOptions, 'functions' | 'functionCall'>;
|
|
8
|
-
export declare class AxAgent<IN extends AxGenIn, OUT extends AxGenOut> implements AxAgentic {
|
|
9
|
-
private program;
|
|
10
|
-
private name;
|
|
11
|
-
private description;
|
|
12
|
-
private subAgentList?;
|
|
13
|
-
private func;
|
|
14
|
-
constructor(ai: AxAIService, { name, description, signature, agents, functions }: Readonly<{
|
|
15
|
-
name: string;
|
|
16
|
-
description: string;
|
|
17
|
-
signature: AxSignature | string;
|
|
18
|
-
agents?: AxAgentic[];
|
|
19
|
-
functions?: AxFunction[];
|
|
20
|
-
}>, options?: Readonly<AxAgentOptions>);
|
|
21
|
-
getSignature(): AxSignature;
|
|
22
|
-
setExamples(examples: Readonly<AxProgramExamples>): void;
|
|
23
|
-
setId(id: string): void;
|
|
24
|
-
setParentId(parentId: string): void;
|
|
25
|
-
getTraces(): import("../dsp/program.js").AxProgramTrace[];
|
|
26
|
-
setDemos(demos: readonly AxProgramDemos[]): void;
|
|
27
|
-
getUsage(): (import("../ai/types.js").AxTokenUsage & {
|
|
28
|
-
ai: string;
|
|
29
|
-
model: string;
|
|
30
|
-
})[];
|
|
31
|
-
resetUsage(): void;
|
|
32
|
-
getFunction(): AxFunction;
|
|
33
|
-
forward(values: IN, options?: Readonly<AxProgramForwardOptions>): Promise<OUT>;
|
|
34
|
-
}
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import { AxSignature } from '../dsp/index.js';
|
|
2
|
-
import { AxProgram } from '../dsp/program.js';
|
|
3
|
-
import { AxSpanKind } from '../trace/index.js';
|
|
4
|
-
import { AxChainOfThought } from './cot.js';
|
|
5
|
-
import { AxReAct } from './react.js';
|
|
6
|
-
export class AxAgent {
|
|
7
|
-
program;
|
|
8
|
-
name;
|
|
9
|
-
description;
|
|
10
|
-
subAgentList;
|
|
11
|
-
func;
|
|
12
|
-
constructor(ai, { name, description, signature, agents, functions }, options) {
|
|
13
|
-
const funcs = [
|
|
14
|
-
...(functions ?? []),
|
|
15
|
-
...(agents?.map((a) => a.getFunction()) ?? [])
|
|
16
|
-
];
|
|
17
|
-
const opt = {
|
|
18
|
-
...options,
|
|
19
|
-
functions: funcs
|
|
20
|
-
};
|
|
21
|
-
this.program =
|
|
22
|
-
funcs.length > 0
|
|
23
|
-
? new AxReAct(ai, signature, opt)
|
|
24
|
-
: new AxChainOfThought(ai, signature, opt);
|
|
25
|
-
if (!name || name.length < 5) {
|
|
26
|
-
throw new Error('Agent name must be at least 10 characters (more descriptive): ' + name);
|
|
27
|
-
}
|
|
28
|
-
if (!description || description.length < 20) {
|
|
29
|
-
throw new Error('Agent description must be at least 20 characters (explain in detail what the agent does): ' +
|
|
30
|
-
description);
|
|
31
|
-
}
|
|
32
|
-
this.name = name;
|
|
33
|
-
this.description = description;
|
|
34
|
-
this.subAgentList = agents?.map((a) => a.getFunction().name).join(', ');
|
|
35
|
-
this.func = {
|
|
36
|
-
name: toCamelCase(this.name),
|
|
37
|
-
description: this.description,
|
|
38
|
-
parameters: this.program.getSignature().toJSONSchema(),
|
|
39
|
-
func: () => this.forward
|
|
40
|
-
};
|
|
41
|
-
for (const agent of agents ?? []) {
|
|
42
|
-
this.program.register(agent);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
getSignature() {
|
|
46
|
-
return this.program.getSignature();
|
|
47
|
-
}
|
|
48
|
-
setExamples(examples) {
|
|
49
|
-
this.program.setExamples(examples);
|
|
50
|
-
}
|
|
51
|
-
setId(id) {
|
|
52
|
-
this.program.setId(id);
|
|
53
|
-
}
|
|
54
|
-
setParentId(parentId) {
|
|
55
|
-
this.program.setParentId(parentId);
|
|
56
|
-
}
|
|
57
|
-
getTraces() {
|
|
58
|
-
return this.program.getTraces();
|
|
59
|
-
}
|
|
60
|
-
setDemos(demos) {
|
|
61
|
-
this.program.setDemos(demos);
|
|
62
|
-
}
|
|
63
|
-
getUsage() {
|
|
64
|
-
return this.program.getUsage();
|
|
65
|
-
}
|
|
66
|
-
resetUsage() {
|
|
67
|
-
this.program.resetUsage();
|
|
68
|
-
}
|
|
69
|
-
getFunction() {
|
|
70
|
-
return this.func;
|
|
71
|
-
}
|
|
72
|
-
async forward(values, options) {
|
|
73
|
-
if (!options?.tracer) {
|
|
74
|
-
return await this.program.forward(values, options);
|
|
75
|
-
}
|
|
76
|
-
const attributes = {
|
|
77
|
-
['agent.name']: this.name,
|
|
78
|
-
['agent.description']: this.description,
|
|
79
|
-
['agent.subAgents']: this.subAgentList ?? 'none'
|
|
80
|
-
};
|
|
81
|
-
return await options?.tracer.startActiveSpan('Agent', {
|
|
82
|
-
kind: AxSpanKind.SERVER,
|
|
83
|
-
attributes
|
|
84
|
-
}, async (span) => {
|
|
85
|
-
const res = await this.program.forward(values, options);
|
|
86
|
-
span.end();
|
|
87
|
-
return res;
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
function toCamelCase(inputString) {
|
|
92
|
-
// Split the string by any non-alphanumeric character (including underscores, spaces, hyphens)
|
|
93
|
-
const words = inputString.split(/[^a-zA-Z0-9]/);
|
|
94
|
-
// Map through each word, capitalize the first letter of each word except the first word
|
|
95
|
-
const camelCaseString = words
|
|
96
|
-
.map((word, index) => {
|
|
97
|
-
// Lowercase the word to handle cases like uppercase letters in input
|
|
98
|
-
const lowerWord = word.toLowerCase();
|
|
99
|
-
// Capitalize the first letter of each word except the first one
|
|
100
|
-
if (index > 0 && lowerWord && lowerWord[0]) {
|
|
101
|
-
return lowerWord[0].toUpperCase() + lowerWord.slice(1);
|
|
102
|
-
}
|
|
103
|
-
return lowerWord;
|
|
104
|
-
})
|
|
105
|
-
.join('');
|
|
106
|
-
return camelCaseString;
|
|
107
|
-
}
|
|
108
|
-
//# sourceMappingURL=agent.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"agent.js","sourceRoot":"","sources":["../../../../src/prompts/agent.ts"],"names":[],"mappings":"AACA,OAAO,EAA0B,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,EAGL,SAAS,EAMV,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5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AO,SAAS,CAAC;IACnB,CAAC,CAAC;SACD,IAAI,CAAC,EAAE,CAAC,CAAC;IAEZ,OAAO,eAAe,CAAC;AACzB,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { AxAIService } from '../ai/types.js';
|
|
2
|
-
import { AxGenerate, type AxGenerateOptions } from '../dsp/generate.js';
|
|
3
|
-
import type { AxGenIn, AxGenOut } from '../dsp/program.js';
|
|
4
|
-
import { AxSignature } from '../dsp/sig.js';
|
|
5
|
-
export declare class AxChainOfThought<IN extends AxGenIn = AxGenIn, OUT extends AxGenOut = AxGenOut> extends AxGenerate<IN, OUT & {
|
|
6
|
-
reason: string;
|
|
7
|
-
}> {
|
|
8
|
-
constructor(ai: AxAIService, signature: Readonly<AxSignature | string>, options?: Readonly<AxGenerateOptions>);
|
|
9
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { AxGenerate } from '../dsp/generate.js';
|
|
2
|
-
import { AxSignature } from '../dsp/sig.js';
|
|
3
|
-
export class AxChainOfThought extends AxGenerate {
|
|
4
|
-
constructor(ai, signature, options) {
|
|
5
|
-
const sig = new AxSignature(signature);
|
|
6
|
-
const description = `Let's work this out in a step by step way in order to ensure we have the right answer.`;
|
|
7
|
-
sig.setOutputFields([
|
|
8
|
-
{
|
|
9
|
-
name: 'reason',
|
|
10
|
-
description
|
|
11
|
-
},
|
|
12
|
-
...sig.getOutputFields()
|
|
13
|
-
]);
|
|
14
|
-
super(ai, sig, options);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=cot.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cot.js","sourceRoot":"","sources":["../../../../src/prompts/cot.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAA0B,MAAM,oBAAoB,CAAC;AAExE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,MAAM,OAAO,gBAGX,SAAQ,UAAwC;IAChD,YACE,EAAe,EACf,SAAyC,EACzC,OAAqC;QAErC,MAAM,GAAG,GAAG,IAAI,WAAW,CAAC,SAAS,CAAC,CAAC;QACvC,MAAM,WAAW,GAAG,wFAAwF,CAAC;QAE7G,GAAG,CAAC,eAAe,CAAC;YAClB;gBACE,IAAI,EAAE,QAAQ;gBACd,WAAW;aACZ;YACD,GAAG,GAAG,CAAC,eAAe,EAAE;SACzB,CAAC,CAAC;QAEH,KAAK,CAAC,EAAE,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;IAC1B,CAAC;CACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/prompts/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import test from 'ava';
|
|
2
|
-
import { AxAI } from '../ai/index.js';
|
|
3
|
-
import { AxSignature } from '../dsp/sig.js';
|
|
4
|
-
import { AxChainOfThought } from './cot.js';
|
|
5
|
-
const someText = `The technological singularity—or simply the singularity[1]—is a hypothetical future point in time at which technological growth becomes uncontrollable and irreversible.`;
|
|
6
|
-
const examples = [
|
|
7
|
-
{
|
|
8
|
-
someText: '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.',
|
|
9
|
-
shortSummary: 'A philosophy that suggests mathematical objects exist independently of human thought in a non-physical realm.'
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
someText: 'Quantum entanglement is a physical phenomenon occurring when pairs or groups of particles are generated, interact, or share spatial proximity in ways such that the quantum state of each particle cannot be described independently of the state of the others, even when the particles are separated by large distances. This leads to correlations between observable physical properties of the particles.',
|
|
13
|
-
shortSummary: 'A phenomenon where particles remain interconnected and the state of one affects the state of another, regardless of distance.'
|
|
14
|
-
}
|
|
15
|
-
];
|
|
16
|
-
const mockFetch = async () => {
|
|
17
|
-
const mockRes = {
|
|
18
|
-
choices: [
|
|
19
|
-
{
|
|
20
|
-
message: {
|
|
21
|
-
role: 'assistant',
|
|
22
|
-
content: 'Reason: Blah blah blah\nShort Summary: More blah blah blah'
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
]
|
|
26
|
-
};
|
|
27
|
-
return new Promise((resolve) => {
|
|
28
|
-
resolve({
|
|
29
|
-
ok: true,
|
|
30
|
-
status: 200,
|
|
31
|
-
json: async () => new Promise((resolve) => resolve(mockRes))
|
|
32
|
-
});
|
|
33
|
-
});
|
|
34
|
-
};
|
|
35
|
-
test('generate prompt', async (t) => {
|
|
36
|
-
const options = { fetch: mockFetch };
|
|
37
|
-
const ai = new AxAI({
|
|
38
|
-
name: 'openai',
|
|
39
|
-
apiKey: 'no-key',
|
|
40
|
-
options
|
|
41
|
-
});
|
|
42
|
-
// const ai = new AxAI({ name: 'ollama', config: { model: 'nous-hermes2' } });
|
|
43
|
-
const gen = new AxChainOfThought(ai, `someText -> shortSummary "summarize in 5 to 10 words"`);
|
|
44
|
-
gen.setExamples(examples);
|
|
45
|
-
const res = await gen.forward({ someText });
|
|
46
|
-
t.deepEqual(res, {
|
|
47
|
-
reason: 'Blah blah blah',
|
|
48
|
-
shortSummary: 'More blah blah blah'
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
test('generate prompt: invalid signature', async (t) => {
|
|
52
|
-
t.throws(() => new AxSignature(`someText -> output:image`));
|
|
53
|
-
});
|
|
54
|
-
//# sourceMappingURL=prompts.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.test.js","sourceRoot":"","sources":["../../../../src/prompts/prompts.test.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,KAAK,CAAC;AA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AAM,GAAG,GAAG,MAAM,GAAG,CAAC,OAAO,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC;IAE5C,CAAC,CAAC,SAAS,CAAC,GAAG,EAAE;QACf,MAAM,EAAE,gBAAgB;QACxB,YAAY,EAAE,qBAAqB;KACpC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,oCAAoC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE;IACrD,CAAC,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,IAAI,WAAW,CAAC,0BAA0B,CAAC,CAAC,CAAC;AAC9D,CAAC,CAAC,CAAC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { AxAIService } from '../ai/types.js';
|
|
2
|
-
import { type AxGenerateOptions } from '../dsp/index.js';
|
|
3
|
-
import { type AxProgramForwardOptions } from '../dsp/program.js';
|
|
4
|
-
import { AxChainOfThought } from './cot.js';
|
|
5
|
-
export declare class AxRAG extends AxChainOfThought<{
|
|
6
|
-
context: string[];
|
|
7
|
-
question: string;
|
|
8
|
-
}, {
|
|
9
|
-
answer: string;
|
|
10
|
-
}> {
|
|
11
|
-
private genQuery;
|
|
12
|
-
private queryFn;
|
|
13
|
-
private maxHops;
|
|
14
|
-
constructor(ai: AxAIService, queryFn: (query: string) => Promise<string>, options: Readonly<AxGenerateOptions & {
|
|
15
|
-
maxHops?: number;
|
|
16
|
-
}>);
|
|
17
|
-
forward({ question }: Readonly<{
|
|
18
|
-
question: string;
|
|
19
|
-
}>, options?: Readonly<AxProgramForwardOptions>): Promise<{
|
|
20
|
-
answer: string;
|
|
21
|
-
reason: string;
|
|
22
|
-
}>;
|
|
23
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { AxGenerate, AxSignature, axStringUtil } from '../dsp/index.js';
|
|
2
|
-
import {} from '../dsp/program.js';
|
|
3
|
-
import { AxChainOfThought } from './cot.js';
|
|
4
|
-
export class AxRAG extends AxChainOfThought {
|
|
5
|
-
genQuery;
|
|
6
|
-
queryFn;
|
|
7
|
-
maxHops;
|
|
8
|
-
constructor(ai, queryFn, options) {
|
|
9
|
-
const sig = '"Answer questions with short factoid answers." context:string[] "may contain relevant facts", question -> answer';
|
|
10
|
-
super(ai, sig, options);
|
|
11
|
-
this.maxHops = options?.maxHops ?? 3;
|
|
12
|
-
const qsig = new AxSignature('"Write a simple search query that will help answer a complex question." context?:string[] "may contain relevant facts", question -> query "question to further our understanding"');
|
|
13
|
-
this.genQuery = new AxGenerate(ai, qsig);
|
|
14
|
-
this.queryFn = queryFn;
|
|
15
|
-
this.register(this.genQuery);
|
|
16
|
-
}
|
|
17
|
-
async forward({ question }, options) {
|
|
18
|
-
let context = [];
|
|
19
|
-
for (let i = 0; i < this.maxHops; i++) {
|
|
20
|
-
const { query } = await this.genQuery.forward({
|
|
21
|
-
context,
|
|
22
|
-
question
|
|
23
|
-
}, options);
|
|
24
|
-
const val = await this.queryFn(query);
|
|
25
|
-
context = axStringUtil.dedup([...context, val]);
|
|
26
|
-
}
|
|
27
|
-
return super.forward({ context, question }, options);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
//# sourceMappingURL=rag.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rag.js","sourceRoot":"","sources":["../../../../src/prompts/rag.ts"],"names":[],"mappings":"AACA,OAAO,EACL,UAAU,EAEV,WAAW,EACX,YAAY,EACb,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAgC,MAAM,mBAAmB,CAAC;AAEjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5C,MAAM,OAAO,KAAM,SAAQ,gBAG1B;IACS,QAAQ,CAGd;IACM,OAAO,CAAqC;IAC5C,OAAO,CAAS;IAExB,YACE,EAAe,EACf,OAA2C,EAC3C,OAA2D;QAE3D,MAAM,GAAG,GACP,kHAAkH,CAAC;QACrH,KAAK,CAAC,EAAE,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;QAExB,IAAI,CAAC,OAAO,GAAG,OAAO,EAAE,OAAO,IAAI,CAAC,CAAC;QAErC,MAAM,IAAI,GAAG,IAAI,WAAW,CAC1B,mLAAmL,CACpL,CAAC;QACF,IAAI,CAAC,QAAQ,GAAG,IAAI,UAAU,CAG5B,EAAE,EAAE,IAAI,CAAC,CAAC;QACZ,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC/B,CAAC;IAEe,KAAK,CAAC,OAAO,CAC3B,EAAE,QAAQ,EAAkC,EAC5C,OAA2C;QAE3C,IAAI,OAAO,GAAa,EAAE,CAAC;QAE3B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC,EAAE,EAAE,CAAC;YACtC,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,OAAO,CAC3C;gBACE,OAAO;gBACP,QAAQ;aACT,EACD,OAAO,CACR,CAAC;YACF,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YACtC,OAAO,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC,GAAG,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC;QAClD,CAAC;QAED,OAAO,KAAK,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,OAAO,CAAC,CAAC;IACvD,CAAC;CACF"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { AxAIService } from '../ai/index.js';
|
|
2
|
-
import type { AxGenerateOptions } from '../dsp/generate.js';
|
|
3
|
-
import type { AxGenIn, AxGenOut } from '../dsp/program.js';
|
|
4
|
-
import { AxSignature } from '../dsp/sig.js';
|
|
5
|
-
import { AxChainOfThought } from './cot.js';
|
|
6
|
-
export declare class AxReAct<IN extends AxGenIn = AxGenIn, OUT extends AxGenOut = AxGenOut> extends AxChainOfThought<IN, OUT> {
|
|
7
|
-
constructor(ai: AxAIService, signature: Readonly<AxSignature | string>, options: Readonly<AxGenerateOptions>);
|
|
8
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { AxSignature } from '../dsp/sig.js';
|
|
2
|
-
import { AxChainOfThought } from './cot.js';
|
|
3
|
-
export class AxReAct extends AxChainOfThought {
|
|
4
|
-
constructor(ai, signature, options) {
|
|
5
|
-
if (!options?.functions || options.functions.length === 0) {
|
|
6
|
-
throw new Error('No functions provided');
|
|
7
|
-
}
|
|
8
|
-
const functions = [...options.functions];
|
|
9
|
-
const funcList = functions.map((f) => `'${f.name}'`).join(', ');
|
|
10
|
-
const sig = new AxSignature(signature);
|
|
11
|
-
sig.setDescription(`Use the provided functions ${funcList} to complete the task and return the result if any.`);
|
|
12
|
-
// sig.addInputField({
|
|
13
|
-
// name: 'observation',
|
|
14
|
-
// description: 'Result value from executed function',
|
|
15
|
-
// isOptional: true,
|
|
16
|
-
// type: { name: 'string', isArray: true }
|
|
17
|
-
// });
|
|
18
|
-
sig.setOutputFields(sig.getOutputFields().map((v) => ({ ...v, isOptional: true })));
|
|
19
|
-
super(ai, sig, options);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
//# sourceMappingURL=react.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"react.js","sourceRoot":"","sources":["../../../../src/prompts/react.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5C,MAAM,OAAO,OAGX,SAAQ,gBAAyB;IACjC,YACE,EAAe,EACf,SAAyC,EACzC,OAAoC;QAEpC,IAAI,CAAC,OAAO,EAAE,SAAS,IAAI,OAAO,CAAC,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC1D,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;QAC3C,CAAC;QAED,MAAM,SAAS,GAAG,CAAC,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;QACzC,MAAM,QAAQ,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEhE,MAAM,GAAG,GAAG,IAAI,WAAW,CAAC,SAAS,CAAC,CAAC;QACvC,GAAG,CAAC,cAAc,CAChB,8BAA8B,QAAQ,qDAAqD,CAC5F,CAAC;QAEF,sBAAsB;QACtB,yBAAyB;QACzB,wDAAwD;QACxD,sBAAsB;QACtB,4CAA4C;QAC5C,MAAM;QAEN,GAAG,CAAC,eAAe,CACjB,GAAG,CAAC,eAAe,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC,CAC/D,CAAC;QAEF,KAAK,CAAC,EAAE,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;IAC1B,CAAC;CACF"}
|
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
export declare const axSpanAttributes: {
|
|
2
|
-
LLM_SYSTEM: string;
|
|
3
|
-
LLM_REQUEST_MODEL: string;
|
|
4
|
-
LLM_REQUEST_MAX_TOKENS: string;
|
|
5
|
-
LLM_REQUEST_TEMPERATURE: string;
|
|
6
|
-
LLM_REQUEST_TOP_K: string;
|
|
7
|
-
LLM_REQUEST_FREQUENCY_PENALTY: string;
|
|
8
|
-
LLM_REQUEST_PRESENCE_PENALTY: string;
|
|
9
|
-
LLM_REQUEST_STOP_SEQUENCES: string;
|
|
10
|
-
LLM_REQUEST_LLM_IS_STREAMING: string;
|
|
11
|
-
LLM_REQUEST_TOP_P: string;
|
|
12
|
-
LLM_USAGE_PROMPT_TOKENS: string;
|
|
13
|
-
LLM_USAGE_COMPLETION_TOKENS: string;
|
|
14
|
-
DB_SYSTEM: string;
|
|
15
|
-
DB_TABLE: string;
|
|
16
|
-
DB_NAMESPACE: string;
|
|
17
|
-
DB_ID: string;
|
|
18
|
-
DB_QUERY_TEXT: string;
|
|
19
|
-
DB_VECTOR: string;
|
|
20
|
-
DB_OPERATION_NAME: string;
|
|
21
|
-
DB_VECTOR_QUERY_TOP_K: string;
|
|
22
|
-
DB_QUERY_EMBEDDINGS: string;
|
|
23
|
-
DB_QUERY_RESULT: string;
|
|
24
|
-
DB_QUERY_EMBEDDINGS_VECTOR: string;
|
|
25
|
-
DB_QUERY_RESULT_ID: string;
|
|
26
|
-
DB_QUERY_RESULT_SCORE: string;
|
|
27
|
-
DB_QUERY_RESULT_DISTANCE: string;
|
|
28
|
-
DB_QUERY_RESULT_METADATA: string;
|
|
29
|
-
DB_QUERY_RESULT_VECTOR: string;
|
|
30
|
-
DB_QUERY_RESULT_DOCUMENT: string;
|
|
31
|
-
};
|
|
32
|
-
export declare const axSpanEvents: {
|
|
33
|
-
LLM_PROMPT: string;
|
|
34
|
-
};
|
|
35
|
-
export declare enum AxLLMRequestTypeValues {
|
|
36
|
-
COMPLETION = "completion",
|
|
37
|
-
CHAT = "chat",
|
|
38
|
-
RERANK = "rerank",
|
|
39
|
-
UNKNOWN = "unknown"
|
|
40
|
-
}
|
|
41
|
-
export declare enum AxSpanKindValues {
|
|
42
|
-
WORKFLOW = "workflow",
|
|
43
|
-
TASK = "task",
|
|
44
|
-
AGENT = "agent",
|
|
45
|
-
TOOL = "tool",
|
|
46
|
-
UNKNOWN = "unknown"
|
|
47
|
-
}
|
|
48
|
-
export type AxSpanAttributeValue = string | number | boolean | undefined | null;
|
|
49
|
-
export interface AxSpanAttributes {
|
|
50
|
-
[key: string]: AxSpanAttributeValue;
|
|
51
|
-
}
|
|
52
|
-
export interface AxSpanTimeInput {
|
|
53
|
-
timestamp: number;
|
|
54
|
-
}
|
|
55
|
-
export interface AxSpanException {
|
|
56
|
-
message: string;
|
|
57
|
-
name: string;
|
|
58
|
-
stack?: string;
|
|
59
|
-
}
|
|
60
|
-
export interface AxSpanContext {
|
|
61
|
-
traceId: string;
|
|
62
|
-
spanId: string;
|
|
63
|
-
}
|
|
64
|
-
export declare enum AxSpanStatusCode {
|
|
65
|
-
OK = "OK",
|
|
66
|
-
ERROR = "ERROR"
|
|
67
|
-
}
|
|
68
|
-
export interface AxSpanStatus {
|
|
69
|
-
code: AxSpanStatusCode;
|
|
70
|
-
message?: string;
|
|
71
|
-
}
|
|
72
|
-
export interface AxSpanStatus {
|
|
73
|
-
code: AxSpanStatusCode;
|
|
74
|
-
description?: string;
|
|
75
|
-
}
|
|
76
|
-
export interface AxSpan {
|
|
77
|
-
addEvent(name: string, attributesOrStartTime?: Readonly<AxSpanAttributes | AxSpanTimeInput>, startTime?: Readonly<AxSpanTimeInput>): AxSpan;
|
|
78
|
-
end(endTime?: Readonly<AxSpanTimeInput>): void;
|
|
79
|
-
isRecording(): boolean;
|
|
80
|
-
recordAxSpanException(exception: Readonly<AxSpanException>, time?: Readonly<AxSpanTimeInput>): void;
|
|
81
|
-
setAttribute(key: string, value: AxSpanAttributeValue): AxSpan;
|
|
82
|
-
setAttributes(attributes: AxSpanAttributes): AxSpan;
|
|
83
|
-
setStatus(status: Readonly<AxSpanStatus>): AxSpan;
|
|
84
|
-
spanContext(): AxSpanContext;
|
|
85
|
-
updateName(name: string): AxSpan;
|
|
86
|
-
}
|
|
87
|
-
export interface AxContext {
|
|
88
|
-
/**
|
|
89
|
-
* Deletes a value associated with a key from the context.
|
|
90
|
-
* Returns a new context that inherits from the current context but does not contain the value for the specified key.
|
|
91
|
-
* @param key The symbol key for which to clear the value.
|
|
92
|
-
* @returns A new Context instance without the specified key.
|
|
93
|
-
*/
|
|
94
|
-
deleteValue(key: symbol): AxContext;
|
|
95
|
-
/**
|
|
96
|
-
* Retrieves a value from the context using a symbol as the key.
|
|
97
|
-
* @param key The symbol key which identifies a context value.
|
|
98
|
-
* @returns The value associated with the key, if any; otherwise, undefined.
|
|
99
|
-
*/
|
|
100
|
-
getValue(key: symbol): unknown;
|
|
101
|
-
/**
|
|
102
|
-
* Sets a value in the context for the specified key.
|
|
103
|
-
* Returns a new context that inherits from the current context with the new key-value pair added.
|
|
104
|
-
* @param key The symbol key for which to set the value.
|
|
105
|
-
* @param value The value to set for the given key.
|
|
106
|
-
* @returns A new Context instance with the updated key-value pair.
|
|
107
|
-
*/
|
|
108
|
-
setValue(key: symbol, value: unknown): AxContext;
|
|
109
|
-
}
|
|
110
|
-
export declare enum AxSpanKind {
|
|
111
|
-
INTERNAL = "INTERNAL",
|
|
112
|
-
SERVER = "SERVER",
|
|
113
|
-
CLIENT = "CLIENT",
|
|
114
|
-
PRODUCER = "PRODUCER",
|
|
115
|
-
CONSUMER = "CONSUMER"
|
|
116
|
-
}
|
|
117
|
-
export interface AxSpanLink {
|
|
118
|
-
context: AxSpanContext;
|
|
119
|
-
attributes?: AxSpanAttributes;
|
|
120
|
-
}
|
|
121
|
-
export interface AxSpanOptions {
|
|
122
|
-
/**
|
|
123
|
-
* Optional attributes that can be attached to the AxSpan.
|
|
124
|
-
* @optional
|
|
125
|
-
*/
|
|
126
|
-
attributes?: AxSpanAttributes;
|
|
127
|
-
/**
|
|
128
|
-
* The kind of span, defaults to AxSpanKind.INTERNAL if not specified.
|
|
129
|
-
* @optional
|
|
130
|
-
*/
|
|
131
|
-
kind?: AxSpanKind;
|
|
132
|
-
/**
|
|
133
|
-
* AxSpanLinks that associate this new AxSpan with other AxSpans.
|
|
134
|
-
* @optional
|
|
135
|
-
*/
|
|
136
|
-
links?: AxSpanLink[];
|
|
137
|
-
/**
|
|
138
|
-
* Indicates whether the span should be a root span, ignoring any parent span from the context.
|
|
139
|
-
* @optional
|
|
140
|
-
*/
|
|
141
|
-
root?: boolean;
|
|
142
|
-
/**
|
|
143
|
-
* A manually specified start time for the span, if required.
|
|
144
|
-
* @optional
|
|
145
|
-
*/
|
|
146
|
-
startTime?: AxSpanTimeInput;
|
|
147
|
-
}
|
|
148
|
-
export interface AxSpan {
|
|
149
|
-
setStatus(status: Readonly<AxSpanStatus>): void;
|
|
150
|
-
end(): void;
|
|
151
|
-
}
|
|
152
|
-
export interface AxTracer {
|
|
153
|
-
/**
|
|
154
|
-
* Starts a new AxSpan with the specified options and executes the provided function. The span is automatically closed after the function executes.
|
|
155
|
-
* @param name The name of the span.
|
|
156
|
-
* @param options AxSpan options to apply to the span.
|
|
157
|
-
* @param fn The function to execute within the span's context.
|
|
158
|
-
* @returns The return value of the function.
|
|
159
|
-
*/
|
|
160
|
-
startActiveSpan<F extends (span: AxSpan) => unknown>(name: string, options: Readonly<AxSpanOptions>, fn: F): ReturnType<F>;
|
|
161
|
-
/**
|
|
162
|
-
* Starts a new AxSpan with the specified options and context, then executes the provided function. The span is automatically closed after the function executes.
|
|
163
|
-
* @param name The name of the span.
|
|
164
|
-
* @param options AxSpan options to apply to the span.
|
|
165
|
-
* @param context Context to be used for the span.
|
|
166
|
-
* @param fn The function to execute within the span's context.
|
|
167
|
-
* @returns The return value of the function.
|
|
168
|
-
*/
|
|
169
|
-
startActiveSpan<F extends (span: AxSpan) => unknown>(name: string, options: Readonly<AxSpanOptions>, context: AxContext, fn: F): ReturnType<F>;
|
|
170
|
-
startSpan(name: string, options?: Readonly<AxSpanOptions>, context?: AxContext): AxSpan;
|
|
171
|
-
}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
export const axSpanAttributes = {
|
|
2
|
-
// LLM
|
|
3
|
-
LLM_SYSTEM: 'gen_ai.system',
|
|
4
|
-
LLM_REQUEST_MODEL: 'gen_ai.request.model',
|
|
5
|
-
LLM_REQUEST_MAX_TOKENS: 'gen_ai.request.max_tokens',
|
|
6
|
-
LLM_REQUEST_TEMPERATURE: 'gen_ai.request.temperature',
|
|
7
|
-
LLM_REQUEST_TOP_K: 'gen_ai.request.top_k',
|
|
8
|
-
LLM_REQUEST_FREQUENCY_PENALTY: 'gen_ai.request.frequency_penalty',
|
|
9
|
-
LLM_REQUEST_PRESENCE_PENALTY: 'gen_ai.request.presence_penalty',
|
|
10
|
-
LLM_REQUEST_STOP_SEQUENCES: 'gen_ai.request.stop_sequences',
|
|
11
|
-
LLM_REQUEST_LLM_IS_STREAMING: 'gen_ai.request.llm_is_streaming',
|
|
12
|
-
LLM_REQUEST_TOP_P: 'gen_ai.request.top_p',
|
|
13
|
-
LLM_USAGE_PROMPT_TOKENS: 'gen_ai.usage.prompt_tokens',
|
|
14
|
-
LLM_USAGE_COMPLETION_TOKENS: 'gen_ai.usage.completion_tokens',
|
|
15
|
-
// Vector DB
|
|
16
|
-
DB_SYSTEM: 'db.system',
|
|
17
|
-
DB_TABLE: 'db.table',
|
|
18
|
-
DB_NAMESPACE: 'db.namespace',
|
|
19
|
-
DB_ID: 'db.id',
|
|
20
|
-
DB_QUERY_TEXT: 'db.query.text',
|
|
21
|
-
DB_VECTOR: 'db.vector',
|
|
22
|
-
DB_OPERATION_NAME: 'db.operation.name',
|
|
23
|
-
DB_VECTOR_QUERY_TOP_K: 'db.vector.query.top_k',
|
|
24
|
-
DB_QUERY_EMBEDDINGS: 'db.query.embeddings',
|
|
25
|
-
DB_QUERY_RESULT: 'db.query.result',
|
|
26
|
-
// Query Embeddings
|
|
27
|
-
DB_QUERY_EMBEDDINGS_VECTOR: 'db.query.embeddings.vector',
|
|
28
|
-
// Query Result (canonical format)
|
|
29
|
-
DB_QUERY_RESULT_ID: 'db.query.result.id',
|
|
30
|
-
DB_QUERY_RESULT_SCORE: 'db.query.result.score',
|
|
31
|
-
DB_QUERY_RESULT_DISTANCE: 'db.query.result.distance',
|
|
32
|
-
DB_QUERY_RESULT_METADATA: 'db.query.result.metadata',
|
|
33
|
-
DB_QUERY_RESULT_VECTOR: 'db.query.result.vector',
|
|
34
|
-
DB_QUERY_RESULT_DOCUMENT: 'db.query.result.document'
|
|
35
|
-
};
|
|
36
|
-
export const axSpanEvents = {
|
|
37
|
-
LLM_PROMPT: 'gen_ai.prompt'
|
|
38
|
-
};
|
|
39
|
-
export var AxLLMRequestTypeValues;
|
|
40
|
-
(function (AxLLMRequestTypeValues) {
|
|
41
|
-
AxLLMRequestTypeValues["COMPLETION"] = "completion";
|
|
42
|
-
AxLLMRequestTypeValues["CHAT"] = "chat";
|
|
43
|
-
AxLLMRequestTypeValues["RERANK"] = "rerank";
|
|
44
|
-
AxLLMRequestTypeValues["UNKNOWN"] = "unknown";
|
|
45
|
-
})(AxLLMRequestTypeValues || (AxLLMRequestTypeValues = {}));
|
|
46
|
-
export var AxSpanKindValues;
|
|
47
|
-
(function (AxSpanKindValues) {
|
|
48
|
-
AxSpanKindValues["WORKFLOW"] = "workflow";
|
|
49
|
-
AxSpanKindValues["TASK"] = "task";
|
|
50
|
-
AxSpanKindValues["AGENT"] = "agent";
|
|
51
|
-
AxSpanKindValues["TOOL"] = "tool";
|
|
52
|
-
AxSpanKindValues["UNKNOWN"] = "unknown";
|
|
53
|
-
})(AxSpanKindValues || (AxSpanKindValues = {}));
|
|
54
|
-
export var AxSpanStatusCode;
|
|
55
|
-
(function (AxSpanStatusCode) {
|
|
56
|
-
AxSpanStatusCode["OK"] = "OK";
|
|
57
|
-
AxSpanStatusCode["ERROR"] = "ERROR";
|
|
58
|
-
})(AxSpanStatusCode || (AxSpanStatusCode = {}));
|
|
59
|
-
export var AxSpanKind;
|
|
60
|
-
(function (AxSpanKind) {
|
|
61
|
-
AxSpanKind["INTERNAL"] = "INTERNAL";
|
|
62
|
-
AxSpanKind["SERVER"] = "SERVER";
|
|
63
|
-
AxSpanKind["CLIENT"] = "CLIENT";
|
|
64
|
-
AxSpanKind["PRODUCER"] = "PRODUCER";
|
|
65
|
-
AxSpanKind["CONSUMER"] = "CONSUMER";
|
|
66
|
-
})(AxSpanKind || (AxSpanKind = {}));
|
|
67
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../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