@ax-llm/ax 10.0.25 → 10.0.26
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 +19 -22
- package/ai/anthropic/api.d.ts +0 -20
- package/ai/anthropic/api.js +0 -353
- package/ai/anthropic/api.js.map +0 -1
- package/ai/anthropic/index.d.ts +0 -3
- package/ai/anthropic/index.js +0 -4
- package/ai/anthropic/index.js.map +0 -1
- package/ai/anthropic/info.d.ts +0 -2
- package/ai/anthropic/info.js +0 -49
- package/ai/anthropic/info.js.map +0 -1
- package/ai/anthropic/types.d.ts +0 -181
- package/ai/anthropic/types.js +0 -11
- package/ai/anthropic/types.js.map +0 -1
- package/ai/azure-openai/api.d.ts +0 -20
- package/ai/azure-openai/api.js +0 -30
- package/ai/azure-openai/api.js.map +0 -1
- package/ai/azure-openai/index.d.ts +0 -1
- package/ai/azure-openai/index.js +0 -2
- package/ai/azure-openai/index.js.map +0 -1
- package/ai/balance.d.ts +0 -40
- package/ai/balance.js +0 -104
- package/ai/balance.js.map +0 -1
- package/ai/base.d.ts +0 -66
- package/ai/base.js +0 -490
- package/ai/base.js.map +0 -1
- package/ai/cohere/api.d.ts +0 -23
- package/ai/cohere/api.js +0 -267
- package/ai/cohere/api.js.map +0 -1
- package/ai/cohere/index.d.ts +0 -3
- package/ai/cohere/index.js +0 -4
- package/ai/cohere/index.js.map +0 -1
- package/ai/cohere/info.d.ts +0 -2
- package/ai/cohere/info.js +0 -52
- package/ai/cohere/info.js.map +0 -1
- package/ai/cohere/types.d.ts +0 -102
- package/ai/cohere/types.js +0 -23
- package/ai/cohere/types.js.map +0 -1
- package/ai/deepseek/api.d.ts +0 -18
- package/ai/deepseek/api.js +0 -33
- package/ai/deepseek/api.js.map +0 -1
- package/ai/deepseek/index.d.ts +0 -3
- package/ai/deepseek/index.js +0 -4
- package/ai/deepseek/index.js.map +0 -1
- package/ai/deepseek/info.d.ts +0 -2
- package/ai/deepseek/info.js +0 -16
- package/ai/deepseek/info.js.map +0 -1
- package/ai/deepseek/types.d.ts +0 -8
- package/ai/deepseek/types.js +0 -10
- package/ai/deepseek/types.js.map +0 -1
- package/ai/google-gemini/api.d.ts +0 -43
- package/ai/google-gemini/api.js +0 -346
- package/ai/google-gemini/api.js.map +0 -1
- package/ai/google-gemini/index.d.ts +0 -3
- package/ai/google-gemini/index.js +0 -4
- package/ai/google-gemini/index.js.map +0 -1
- package/ai/google-gemini/info.d.ts +0 -6
- package/ai/google-gemini/info.js +0 -36
- package/ai/google-gemini/info.js.map +0 -1
- package/ai/google-gemini/types.d.ts +0 -159
- package/ai/google-gemini/types.js +0 -29
- package/ai/google-gemini/types.js.map +0 -1
- package/ai/groq/api.d.ts +0 -20
- package/ai/groq/api.js +0 -54
- package/ai/groq/api.js.map +0 -1
- package/ai/groq/index.d.ts +0 -3
- package/ai/groq/index.js +0 -4
- package/ai/groq/index.js.map +0 -1
- package/ai/groq/info.d.ts +0 -6
- package/ai/groq/info.js +0 -36
- package/ai/groq/info.js.map +0 -1
- package/ai/groq/types.d.ts +0 -6
- package/ai/groq/types.js +0 -8
- package/ai/groq/types.js.map +0 -1
- package/ai/huggingface/api.d.ts +0 -20
- package/ai/huggingface/api.js +0 -116
- package/ai/huggingface/api.js.map +0 -1
- package/ai/huggingface/index.d.ts +0 -3
- package/ai/huggingface/index.js +0 -4
- package/ai/huggingface/index.js.map +0 -1
- package/ai/huggingface/info.d.ts +0 -6
- package/ai/huggingface/info.js +0 -6
- package/ai/huggingface/info.js.map +0 -1
- package/ai/huggingface/types.d.ts +0 -34
- package/ai/huggingface/types.js +0 -5
- package/ai/huggingface/types.js.map +0 -1
- package/ai/index.d.ts +0 -16
- package/ai/index.js +0 -16
- package/ai/index.js.map +0 -1
- package/ai/mistral/api.d.ts +0 -18
- package/ai/mistral/api.js +0 -33
- package/ai/mistral/api.js.map +0 -1
- package/ai/mistral/index.d.ts +0 -3
- package/ai/mistral/index.js +0 -4
- package/ai/mistral/index.js.map +0 -1
- package/ai/mistral/info.d.ts +0 -2
- package/ai/mistral/info.js +0 -53
- package/ai/mistral/info.js.map +0 -1
- package/ai/mistral/types.d.ts +0 -13
- package/ai/mistral/types.js +0 -17
- package/ai/mistral/types.js.map +0 -1
- package/ai/ollama/api.d.ts +0 -23
- package/ai/ollama/api.js +0 -33
- package/ai/ollama/api.js.map +0 -1
- package/ai/ollama/index.d.ts +0 -1
- package/ai/ollama/index.js +0 -2
- package/ai/ollama/index.js.map +0 -1
- package/ai/openai/api.d.ts +0 -31
- package/ai/openai/api.js +0 -315
- package/ai/openai/api.js.map +0 -1
- package/ai/openai/index.d.ts +0 -3
- package/ai/openai/index.js +0 -4
- package/ai/openai/index.js.map +0 -1
- package/ai/openai/info.d.ts +0 -6
- package/ai/openai/info.js +0 -74
- package/ai/openai/info.js.map +0 -1
- package/ai/openai/types.d.ts +0 -177
- package/ai/openai/types.js +0 -22
- package/ai/openai/types.js.map +0 -1
- package/ai/reka/api.d.ts +0 -27
- package/ai/reka/api.js +0 -203
- package/ai/reka/api.js.map +0 -1
- package/ai/reka/index.d.ts +0 -3
- package/ai/reka/index.js +0 -4
- package/ai/reka/index.js.map +0 -1
- package/ai/reka/info.d.ts +0 -6
- package/ai/reka/info.js +0 -26
- package/ai/reka/info.js.map +0 -1
- package/ai/reka/types.d.ts +0 -67
- package/ai/reka/types.js +0 -7
- package/ai/reka/types.js.map +0 -1
- package/ai/together/api.d.ts +0 -16
- package/ai/together/api.js +0 -29
- package/ai/together/api.js.map +0 -1
- package/ai/together/index.d.ts +0 -2
- package/ai/together/index.js +0 -3
- package/ai/together/index.js.map +0 -1
- package/ai/together/info.d.ts +0 -2
- package/ai/together/info.js +0 -2
- package/ai/together/info.js.map +0 -1
- package/ai/types.d.ts +0 -202
- package/ai/types.js +0 -2
- package/ai/types.js.map +0 -1
- package/ai/util.d.ts +0 -12
- package/ai/util.js +0 -63
- package/ai/util.js.map +0 -1
- package/ai/wrap.d.ts +0 -42
- package/ai/wrap.js +0 -88
- package/ai/wrap.js.map +0 -1
- package/cjs/ai/anthropic/api.d.ts +0 -20
- package/cjs/ai/anthropic/api.js +0 -358
- package/cjs/ai/anthropic/api.js.map +0 -1
- package/cjs/ai/anthropic/index.d.ts +0 -3
- package/cjs/ai/anthropic/index.js +0 -20
- package/cjs/ai/anthropic/index.js.map +0 -1
- package/cjs/ai/anthropic/info.d.ts +0 -2
- package/cjs/ai/anthropic/info.js +0 -52
- package/cjs/ai/anthropic/info.js.map +0 -1
- package/cjs/ai/anthropic/types.d.ts +0 -181
- package/cjs/ai/anthropic/types.js +0 -14
- package/cjs/ai/anthropic/types.js.map +0 -1
- package/cjs/ai/azure-openai/api.d.ts +0 -20
- package/cjs/ai/azure-openai/api.js +0 -34
- package/cjs/ai/azure-openai/api.js.map +0 -1
- package/cjs/ai/azure-openai/index.d.ts +0 -1
- package/cjs/ai/azure-openai/index.js +0 -18
- package/cjs/ai/azure-openai/index.js.map +0 -1
- package/cjs/ai/balance.d.ts +0 -40
- package/cjs/ai/balance.js +0 -110
- package/cjs/ai/balance.js.map +0 -1
- package/cjs/ai/base.d.ts +0 -66
- package/cjs/ai/base.js +0 -496
- package/cjs/ai/base.js.map +0 -1
- package/cjs/ai/cohere/api.d.ts +0 -23
- package/cjs/ai/cohere/api.js +0 -273
- package/cjs/ai/cohere/api.js.map +0 -1
- package/cjs/ai/cohere/index.d.ts +0 -3
- package/cjs/ai/cohere/index.js +0 -20
- package/cjs/ai/cohere/index.js.map +0 -1
- package/cjs/ai/cohere/info.d.ts +0 -2
- package/cjs/ai/cohere/info.js +0 -55
- package/cjs/ai/cohere/info.js.map +0 -1
- package/cjs/ai/cohere/types.d.ts +0 -102
- package/cjs/ai/cohere/types.js +0 -26
- package/cjs/ai/cohere/types.js.map +0 -1
- package/cjs/ai/deepseek/api.d.ts +0 -18
- package/cjs/ai/deepseek/api.js +0 -39
- package/cjs/ai/deepseek/api.js.map +0 -1
- package/cjs/ai/deepseek/index.d.ts +0 -3
- package/cjs/ai/deepseek/index.js +0 -20
- package/cjs/ai/deepseek/index.js.map +0 -1
- package/cjs/ai/deepseek/info.d.ts +0 -2
- package/cjs/ai/deepseek/info.js +0 -19
- package/cjs/ai/deepseek/info.js.map +0 -1
- package/cjs/ai/deepseek/types.d.ts +0 -8
- package/cjs/ai/deepseek/types.js +0 -13
- package/cjs/ai/deepseek/types.js.map +0 -1
- package/cjs/ai/google-gemini/api.d.ts +0 -43
- package/cjs/ai/google-gemini/api.js +0 -352
- package/cjs/ai/google-gemini/api.js.map +0 -1
- package/cjs/ai/google-gemini/index.d.ts +0 -3
- package/cjs/ai/google-gemini/index.js +0 -20
- package/cjs/ai/google-gemini/index.js.map +0 -1
- package/cjs/ai/google-gemini/info.d.ts +0 -6
- package/cjs/ai/google-gemini/info.js +0 -39
- package/cjs/ai/google-gemini/info.js.map +0 -1
- package/cjs/ai/google-gemini/types.d.ts +0 -159
- package/cjs/ai/google-gemini/types.js +0 -32
- package/cjs/ai/google-gemini/types.js.map +0 -1
- package/cjs/ai/groq/api.d.ts +0 -20
- package/cjs/ai/groq/api.js +0 -58
- package/cjs/ai/groq/api.js.map +0 -1
- package/cjs/ai/groq/index.d.ts +0 -3
- package/cjs/ai/groq/index.js +0 -20
- package/cjs/ai/groq/index.js.map +0 -1
- package/cjs/ai/groq/info.d.ts +0 -6
- package/cjs/ai/groq/info.js +0 -39
- package/cjs/ai/groq/info.js.map +0 -1
- package/cjs/ai/groq/types.d.ts +0 -6
- package/cjs/ai/groq/types.js +0 -11
- package/cjs/ai/groq/types.js.map +0 -1
- package/cjs/ai/huggingface/api.d.ts +0 -20
- package/cjs/ai/huggingface/api.js +0 -122
- package/cjs/ai/huggingface/api.js.map +0 -1
- package/cjs/ai/huggingface/index.d.ts +0 -3
- package/cjs/ai/huggingface/index.js +0 -20
- package/cjs/ai/huggingface/index.js.map +0 -1
- package/cjs/ai/huggingface/info.d.ts +0 -6
- package/cjs/ai/huggingface/info.js +0 -9
- package/cjs/ai/huggingface/info.js.map +0 -1
- package/cjs/ai/huggingface/types.d.ts +0 -34
- package/cjs/ai/huggingface/types.js +0 -8
- package/cjs/ai/huggingface/types.js.map +0 -1
- package/cjs/ai/index.d.ts +0 -16
- package/cjs/ai/index.js +0 -32
- package/cjs/ai/index.js.map +0 -1
- package/cjs/ai/mistral/api.d.ts +0 -18
- package/cjs/ai/mistral/api.js +0 -39
- package/cjs/ai/mistral/api.js.map +0 -1
- package/cjs/ai/mistral/index.d.ts +0 -3
- package/cjs/ai/mistral/index.js +0 -20
- package/cjs/ai/mistral/index.js.map +0 -1
- package/cjs/ai/mistral/info.d.ts +0 -2
- package/cjs/ai/mistral/info.js +0 -56
- package/cjs/ai/mistral/info.js.map +0 -1
- package/cjs/ai/mistral/types.d.ts +0 -13
- package/cjs/ai/mistral/types.js +0 -20
- package/cjs/ai/mistral/types.js.map +0 -1
- package/cjs/ai/ollama/api.d.ts +0 -23
- package/cjs/ai/ollama/api.js +0 -39
- package/cjs/ai/ollama/api.js.map +0 -1
- package/cjs/ai/ollama/index.d.ts +0 -1
- package/cjs/ai/ollama/index.js +0 -18
- package/cjs/ai/ollama/index.js.map +0 -1
- package/cjs/ai/openai/api.d.ts +0 -31
- package/cjs/ai/openai/api.js +0 -323
- package/cjs/ai/openai/api.js.map +0 -1
- package/cjs/ai/openai/index.d.ts +0 -3
- package/cjs/ai/openai/index.js +0 -20
- package/cjs/ai/openai/index.js.map +0 -1
- package/cjs/ai/openai/info.d.ts +0 -6
- package/cjs/ai/openai/info.js +0 -77
- package/cjs/ai/openai/info.js.map +0 -1
- package/cjs/ai/openai/types.d.ts +0 -177
- package/cjs/ai/openai/types.js +0 -25
- package/cjs/ai/openai/types.js.map +0 -1
- package/cjs/ai/reka/api.d.ts +0 -27
- package/cjs/ai/reka/api.js +0 -211
- package/cjs/ai/reka/api.js.map +0 -1
- package/cjs/ai/reka/index.d.ts +0 -3
- package/cjs/ai/reka/index.js +0 -20
- package/cjs/ai/reka/index.js.map +0 -1
- package/cjs/ai/reka/info.d.ts +0 -6
- package/cjs/ai/reka/info.js +0 -29
- package/cjs/ai/reka/info.js.map +0 -1
- package/cjs/ai/reka/types.d.ts +0 -67
- package/cjs/ai/reka/types.js +0 -10
- package/cjs/ai/reka/types.js.map +0 -1
- package/cjs/ai/together/api.d.ts +0 -16
- package/cjs/ai/together/api.js +0 -34
- package/cjs/ai/together/api.js.map +0 -1
- package/cjs/ai/together/index.d.ts +0 -2
- package/cjs/ai/together/index.js +0 -19
- package/cjs/ai/together/index.js.map +0 -1
- package/cjs/ai/together/info.d.ts +0 -2
- package/cjs/ai/together/info.js +0 -5
- package/cjs/ai/together/info.js.map +0 -1
- package/cjs/ai/types.d.ts +0 -202
- package/cjs/ai/types.js +0 -3
- package/cjs/ai/types.js.map +0 -1
- package/cjs/ai/util.d.ts +0 -12
- package/cjs/ai/util.js +0 -71
- package/cjs/ai/util.js.map +0 -1
- package/cjs/ai/wrap.d.ts +0 -42
- package/cjs/ai/wrap.js +0 -92
- package/cjs/ai/wrap.js.map +0 -1
- package/cjs/db/base.d.ts +0 -23
- package/cjs/db/base.js +0 -91
- package/cjs/db/base.js.map +0 -1
- package/cjs/db/cloudflare.d.ts +0 -21
- package/cjs/db/cloudflare.js +0 -102
- package/cjs/db/cloudflare.js.map +0 -1
- package/cjs/db/index.d.ts +0 -6
- package/cjs/db/index.js +0 -23
- package/cjs/db/index.js.map +0 -1
- package/cjs/db/memory.d.ts +0 -21
- package/cjs/db/memory.js +0 -103
- package/cjs/db/memory.js.map +0 -1
- package/cjs/db/pinecone.d.ts +0 -21
- package/cjs/db/pinecone.js +0 -75
- package/cjs/db/pinecone.js.map +0 -1
- package/cjs/db/types.d.ts +0 -35
- package/cjs/db/types.js +0 -4
- package/cjs/db/types.js.map +0 -1
- package/cjs/db/weaviate.d.ts +0 -21
- package/cjs/db/weaviate.js +0 -131
- package/cjs/db/weaviate.js.map +0 -1
- package/cjs/db/wrap.d.ts +0 -13
- package/cjs/db/wrap.js +0 -39
- package/cjs/db/wrap.js.map +0 -1
- package/cjs/docs/index.d.ts +0 -4
- package/cjs/docs/index.js +0 -21
- package/cjs/docs/index.js.map +0 -1
- package/cjs/docs/manager.d.ts +0 -45
- package/cjs/docs/manager.js +0 -165
- package/cjs/docs/manager.js.map +0 -1
- package/cjs/docs/reranker.d.ts +0 -7
- package/cjs/docs/reranker.js +0 -30
- package/cjs/docs/reranker.js.map +0 -1
- package/cjs/docs/rewriter.d.ts +0 -4
- package/cjs/docs/rewriter.js +0 -13
- package/cjs/docs/rewriter.js.map +0 -1
- package/cjs/docs/tika.d.ts +0 -18
- package/cjs/docs/tika.js +0 -50
- package/cjs/docs/tika.js.map +0 -1
- package/cjs/dsp/asserts.d.ts +0 -32
- package/cjs/dsp/asserts.js +0 -98
- package/cjs/dsp/asserts.js.map +0 -1
- package/cjs/dsp/datetime.d.ts +0 -4
- package/cjs/dsp/datetime.js +0 -72
- package/cjs/dsp/datetime.js.map +0 -1
- package/cjs/dsp/eval.d.ts +0 -43
- package/cjs/dsp/eval.js +0 -128
- package/cjs/dsp/eval.js.map +0 -1
- package/cjs/dsp/evaluate.d.ts +0 -15
- package/cjs/dsp/evaluate.js +0 -38
- package/cjs/dsp/evaluate.js.map +0 -1
- package/cjs/dsp/extract.d.ts +0 -9
- package/cjs/dsp/extract.js +0 -169
- package/cjs/dsp/extract.js.map +0 -1
- package/cjs/dsp/functions.d.ts +0 -23
- package/cjs/dsp/functions.js +0 -121
- package/cjs/dsp/functions.js.map +0 -1
- package/cjs/dsp/generate.d.ts +0 -58
- package/cjs/dsp/generate.js +0 -254
- package/cjs/dsp/generate.js.map +0 -1
- package/cjs/dsp/index.d.ts +0 -15
- package/cjs/dsp/index.js +0 -27
- package/cjs/dsp/index.js.map +0 -1
- package/cjs/dsp/jsonschema.d.ts +0 -2
- package/cjs/dsp/jsonschema.js +0 -101
- package/cjs/dsp/jsonschema.js.map +0 -1
- package/cjs/dsp/loader.d.ts +0 -30
- package/cjs/dsp/loader.js +0 -85
- package/cjs/dsp/loader.js.map +0 -1
- package/cjs/dsp/modelinfo.d.ts +0 -8
- package/cjs/dsp/modelinfo.js +0 -35
- package/cjs/dsp/modelinfo.js.map +0 -1
- package/cjs/dsp/optimize.d.ts +0 -30
- package/cjs/dsp/optimize.js +0 -101
- package/cjs/dsp/optimize.js.map +0 -1
- package/cjs/dsp/parser.d.ts +0 -40
- package/cjs/dsp/parser.js +0 -169
- package/cjs/dsp/parser.js.map +0 -1
- package/cjs/dsp/program.d.ts +0 -104
- package/cjs/dsp/program.js +0 -198
- package/cjs/dsp/program.js.map +0 -1
- package/cjs/dsp/prompt.d.ts +0 -48
- package/cjs/dsp/prompt.js +0 -380
- package/cjs/dsp/prompt.js.map +0 -1
- package/cjs/dsp/registry.d.ts +0 -6
- package/cjs/dsp/registry.js +0 -19
- package/cjs/dsp/registry.js.map +0 -1
- package/cjs/dsp/router.d.ts +0 -25
- package/cjs/dsp/router.js +0 -75
- package/cjs/dsp/router.js.map +0 -1
- package/cjs/dsp/sig.d.ts +0 -38
- package/cjs/dsp/sig.js +0 -205
- package/cjs/dsp/sig.js.map +0 -1
- package/cjs/dsp/stopwords.d.ts +0 -1
- package/cjs/dsp/stopwords.js +0 -1167
- package/cjs/dsp/stopwords.js.map +0 -1
- package/cjs/dsp/strutil.d.ts +0 -11
- package/cjs/dsp/strutil.js +0 -63
- package/cjs/dsp/strutil.js.map +0 -1
- package/cjs/dsp/util.d.ts +0 -10
- package/cjs/dsp/util.js +0 -169
- package/cjs/dsp/util.js.map +0 -1
- package/cjs/dsp/validate.d.ts +0 -17
- package/cjs/dsp/validate.js +0 -30
- package/cjs/dsp/validate.js.map +0 -1
- package/cjs/funcs/code.d.ts +0 -16
- package/cjs/funcs/code.js +0 -86
- package/cjs/funcs/code.js.map +0 -1
- package/cjs/funcs/docker.d.ts +0 -101
- package/cjs/funcs/docker.js +0 -217
- package/cjs/funcs/docker.js.map +0 -1
- package/cjs/funcs/embed.d.ts +0 -17
- package/cjs/funcs/embed.js +0 -42
- package/cjs/funcs/embed.js.map +0 -1
- package/cjs/funcs/index.d.ts +0 -3
- package/cjs/funcs/index.js +0 -20
- package/cjs/funcs/index.js.map +0 -1
- package/cjs/index.d.ts +0 -9
- package/cjs/index.js +0 -34
- package/cjs/index.js.map +0 -1
- package/cjs/mem/index.d.ts +0 -2
- package/cjs/mem/index.js +0 -19
- package/cjs/mem/index.js.map +0 -1
- package/cjs/mem/memory.d.ts +0 -15
- package/cjs/mem/memory.js +0 -78
- package/cjs/mem/memory.js.map +0 -1
- package/cjs/mem/types.d.ts +0 -14
- package/cjs/mem/types.js +0 -3
- package/cjs/mem/types.js.map +0 -1
- package/cjs/prompts/agent.d.ts +0 -37
- package/cjs/prompts/agent.js +0 -128
- package/cjs/prompts/agent.js.map +0 -1
- package/cjs/prompts/cot.d.ts +0 -8
- package/cjs/prompts/cot.js +0 -21
- package/cjs/prompts/cot.js.map +0 -1
- package/cjs/prompts/index.d.ts +0 -3
- package/cjs/prompts/index.js +0 -20
- package/cjs/prompts/index.js.map +0 -1
- package/cjs/prompts/rag.d.ts +0 -23
- package/cjs/prompts/rag.js +0 -33
- package/cjs/prompts/rag.js.map +0 -1
- package/cjs/trace/index.d.ts +0 -171
- package/cjs/trace/index.js +0 -70
- package/cjs/trace/index.js.map +0 -1
- package/cjs/util/apicall.d.ts +0 -18
- package/cjs/util/apicall.js +0 -58
- package/cjs/util/apicall.js.map +0 -1
- package/cjs/util/log.d.ts +0 -14
- package/cjs/util/log.js +0 -35
- package/cjs/util/log.js.map +0 -1
- package/cjs/util/other.d.ts +0 -1
- package/cjs/util/other.js +0 -8
- package/cjs/util/other.js.map +0 -1
- package/cjs/util/rate-limit.d.ts +0 -24
- package/cjs/util/rate-limit.js +0 -53
- package/cjs/util/rate-limit.js.map +0 -1
- package/cjs/util/sse.d.ts +0 -12
- package/cjs/util/sse.js +0 -97
- package/cjs/util/sse.js.map +0 -1
- package/cjs/util/stream.d.ts +0 -9
- package/cjs/util/stream.js +0 -33
- package/cjs/util/stream.js.map +0 -1
- package/cjs/util/transform.d.ts +0 -4
- package/cjs/util/transform.js +0 -33
- package/cjs/util/transform.js.map +0 -1
- package/db/base.d.ts +0 -23
- package/db/base.js +0 -87
- package/db/base.js.map +0 -1
- package/db/cloudflare.d.ts +0 -21
- package/db/cloudflare.js +0 -98
- package/db/cloudflare.js.map +0 -1
- package/db/index.d.ts +0 -6
- package/db/index.js +0 -7
- package/db/index.js.map +0 -1
- package/db/memory.d.ts +0 -21
- package/db/memory.js +0 -99
- package/db/memory.js.map +0 -1
- package/db/pinecone.d.ts +0 -21
- package/db/pinecone.js +0 -71
- package/db/pinecone.js.map +0 -1
- package/db/types.d.ts +0 -35
- package/db/types.js +0 -3
- package/db/types.js.map +0 -1
- package/db/weaviate.d.ts +0 -21
- package/db/weaviate.js +0 -127
- package/db/weaviate.js.map +0 -1
- package/db/wrap.d.ts +0 -13
- package/db/wrap.js +0 -35
- package/db/wrap.js.map +0 -1
- package/docs/index.d.ts +0 -4
- package/docs/index.js +0 -5
- package/docs/index.js.map +0 -1
- package/docs/manager.d.ts +0 -45
- package/docs/manager.js +0 -162
- package/docs/manager.js.map +0 -1
- package/docs/reranker.d.ts +0 -7
- package/docs/reranker.js +0 -26
- package/docs/reranker.js.map +0 -1
- package/docs/rewriter.d.ts +0 -4
- package/docs/rewriter.js +0 -9
- package/docs/rewriter.js.map +0 -1
- package/docs/tika.d.ts +0 -18
- package/docs/tika.js +0 -46
- package/docs/tika.js.map +0 -1
- package/dsp/asserts.d.ts +0 -32
- package/dsp/asserts.js +0 -91
- package/dsp/asserts.js.map +0 -1
- package/dsp/datetime.d.ts +0 -4
- package/dsp/datetime.js +0 -63
- package/dsp/datetime.js.map +0 -1
- package/dsp/eval.d.ts +0 -43
- package/dsp/eval.js +0 -125
- package/dsp/eval.js.map +0 -1
- package/dsp/evaluate.d.ts +0 -15
- package/dsp/evaluate.js +0 -34
- package/dsp/evaluate.js.map +0 -1
- package/dsp/extract.d.ts +0 -9
- package/dsp/extract.js +0 -159
- package/dsp/extract.js.map +0 -1
- package/dsp/functions.d.ts +0 -23
- package/dsp/functions.js +0 -111
- package/dsp/functions.js.map +0 -1
- package/dsp/generate.d.ts +0 -58
- package/dsp/generate.js +0 -251
- package/dsp/generate.js.map +0 -1
- package/dsp/index.d.ts +0 -15
- package/dsp/index.js +0 -11
- package/dsp/index.js.map +0 -1
- package/dsp/jsonschema.d.ts +0 -2
- package/dsp/jsonschema.js +0 -97
- package/dsp/jsonschema.js.map +0 -1
- package/dsp/loader.d.ts +0 -30
- package/dsp/loader.js +0 -81
- package/dsp/loader.js.map +0 -1
- package/dsp/modelinfo.d.ts +0 -8
- package/dsp/modelinfo.js +0 -32
- package/dsp/modelinfo.js.map +0 -1
- package/dsp/optimize.d.ts +0 -30
- package/dsp/optimize.js +0 -97
- package/dsp/optimize.js.map +0 -1
- package/dsp/parser.d.ts +0 -40
- package/dsp/parser.js +0 -166
- package/dsp/parser.js.map +0 -1
- package/dsp/program.d.ts +0 -104
- package/dsp/program.js +0 -193
- package/dsp/program.js.map +0 -1
- package/dsp/prompt.d.ts +0 -48
- package/dsp/prompt.js +0 -376
- package/dsp/prompt.js.map +0 -1
- package/dsp/registry.d.ts +0 -6
- package/dsp/registry.js +0 -15
- package/dsp/registry.js.map +0 -1
- package/dsp/router.d.ts +0 -25
- package/dsp/router.js +0 -70
- package/dsp/router.js.map +0 -1
- package/dsp/sig.d.ts +0 -38
- package/dsp/sig.js +0 -201
- package/dsp/sig.js.map +0 -1
- package/dsp/stopwords.d.ts +0 -1
- package/dsp/stopwords.js +0 -1164
- package/dsp/stopwords.js.map +0 -1
- package/dsp/strutil.d.ts +0 -11
- package/dsp/strutil.js +0 -60
- package/dsp/strutil.js.map +0 -1
- package/dsp/util.d.ts +0 -10
- package/dsp/util.js +0 -162
- package/dsp/util.js.map +0 -1
- package/dsp/validate.d.ts +0 -17
- package/dsp/validate.js +0 -26
- package/dsp/validate.js.map +0 -1
- package/funcs/code.d.ts +0 -16
- package/funcs/code.js +0 -59
- package/funcs/code.js.map +0 -1
- package/funcs/docker.d.ts +0 -101
- package/funcs/docker.js +0 -213
- package/funcs/docker.js.map +0 -1
- package/funcs/embed.d.ts +0 -17
- package/funcs/embed.js +0 -38
- package/funcs/embed.js.map +0 -1
- package/funcs/index.d.ts +0 -3
- package/funcs/index.js +0 -4
- package/funcs/index.js.map +0 -1
- package/index.d.ts +0 -9
- package/index.js +0 -16
- package/index.js.map +0 -1
- package/mem/index.d.ts +0 -2
- package/mem/index.js +0 -3
- package/mem/index.js.map +0 -1
- package/mem/memory.d.ts +0 -15
- package/mem/memory.js +0 -74
- package/mem/memory.js.map +0 -1
- package/mem/types.d.ts +0 -14
- package/mem/types.js +0 -2
- package/mem/types.js.map +0 -1
- package/prompts/agent.d.ts +0 -37
- package/prompts/agent.js +0 -125
- package/prompts/agent.js.map +0 -1
- package/prompts/cot.d.ts +0 -8
- package/prompts/cot.js +0 -17
- package/prompts/cot.js.map +0 -1
- package/prompts/index.d.ts +0 -3
- package/prompts/index.js +0 -4
- package/prompts/index.js.map +0 -1
- package/prompts/rag.d.ts +0 -23
- package/prompts/rag.js +0 -30
- package/prompts/rag.js.map +0 -1
- package/trace/index.d.ts +0 -171
- package/trace/index.js +0 -67
- package/trace/index.js.map +0 -1
- package/util/apicall.d.ts +0 -18
- package/util/apicall.js +0 -51
- package/util/apicall.js.map +0 -1
- package/util/log.d.ts +0 -14
- package/util/log.js +0 -31
- package/util/log.js.map +0 -1
- package/util/other.d.ts +0 -1
- package/util/other.js +0 -5
- package/util/other.js.map +0 -1
- package/util/rate-limit.d.ts +0 -24
- package/util/rate-limit.js +0 -49
- package/util/rate-limit.js.map +0 -1
- package/util/sse.d.ts +0 -12
- package/util/sse.js +0 -93
- package/util/sse.js.map +0 -1
- package/util/stream.d.ts +0 -9
- package/util/stream.js +0 -29
- package/util/stream.js.map +0 -1
- package/util/transform.d.ts +0 -4
- package/util/transform.js +0 -29
- package/util/transform.js.map +0 -1
package/cjs/prompts/agent.js
DELETED
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AxAgent = void 0;
|
|
4
|
-
const index_js_1 = require("../dsp/index.js");
|
|
5
|
-
const index_js_2 = require("../trace/index.js");
|
|
6
|
-
class AxAgent {
|
|
7
|
-
ai;
|
|
8
|
-
signature;
|
|
9
|
-
program;
|
|
10
|
-
agents;
|
|
11
|
-
name;
|
|
12
|
-
description;
|
|
13
|
-
subAgentList;
|
|
14
|
-
func;
|
|
15
|
-
constructor({ ai, name, description, signature, agents, functions }, options) {
|
|
16
|
-
this.ai = ai;
|
|
17
|
-
this.agents = agents;
|
|
18
|
-
this.signature = new index_js_1.AxSignature(signature);
|
|
19
|
-
this.signature.setDescription(description);
|
|
20
|
-
const funcs = [
|
|
21
|
-
...(functions ?? []),
|
|
22
|
-
...(agents?.map((a) => a.getFunction()) ?? [])
|
|
23
|
-
];
|
|
24
|
-
const opt = { ...options, functions: funcs };
|
|
25
|
-
this.program = new index_js_1.AxGen(this.signature, opt);
|
|
26
|
-
if (!name || name.length < 5) {
|
|
27
|
-
throw new Error(`Agent name must be at least 10 characters (more descriptive): ${name}`);
|
|
28
|
-
}
|
|
29
|
-
if (!description || description.length < 20) {
|
|
30
|
-
throw new Error(`Agent description must be at least 20 characters (explain in detail what the agent does): ${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.signature.toJSONSchema(),
|
|
39
|
-
func: () => this.forward
|
|
40
|
-
};
|
|
41
|
-
for (const agent of agents ?? []) {
|
|
42
|
-
this.program.register(agent);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
setExamples(examples) {
|
|
46
|
-
this.program.setExamples(examples);
|
|
47
|
-
}
|
|
48
|
-
setId(id) {
|
|
49
|
-
this.program.setId(id);
|
|
50
|
-
}
|
|
51
|
-
setParentId(parentId) {
|
|
52
|
-
this.program.setParentId(parentId);
|
|
53
|
-
}
|
|
54
|
-
getTraces() {
|
|
55
|
-
return this.program.getTraces();
|
|
56
|
-
}
|
|
57
|
-
setDemos(demos) {
|
|
58
|
-
this.program.setDemos(demos);
|
|
59
|
-
}
|
|
60
|
-
getUsage() {
|
|
61
|
-
return this.program.getUsage();
|
|
62
|
-
}
|
|
63
|
-
resetUsage() {
|
|
64
|
-
this.program.resetUsage();
|
|
65
|
-
}
|
|
66
|
-
getFunction() {
|
|
67
|
-
const boundFunc = this.forward.bind(this);
|
|
68
|
-
// Create a wrapper function that excludes the 'ai' parameter
|
|
69
|
-
const wrappedFunc = (values, options) => {
|
|
70
|
-
const ai = this.ai ?? options?.ai;
|
|
71
|
-
if (!ai) {
|
|
72
|
-
throw new Error('AI service is required to run the agent');
|
|
73
|
-
}
|
|
74
|
-
return boundFunc(ai, values, options);
|
|
75
|
-
};
|
|
76
|
-
return {
|
|
77
|
-
...this.func,
|
|
78
|
-
func: wrappedFunc
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
async forward(ai, values, options) {
|
|
82
|
-
const _ai = this.ai ?? ai;
|
|
83
|
-
const funcs = [
|
|
84
|
-
...(options?.functions ?? []),
|
|
85
|
-
...(this.agents?.map((a) => a.getFunction()) ?? [])
|
|
86
|
-
];
|
|
87
|
-
const opt = options;
|
|
88
|
-
if (funcs.length > 0) {
|
|
89
|
-
const opt = { ...options, functions: funcs };
|
|
90
|
-
this.program = new index_js_1.AxGen(this.signature, opt);
|
|
91
|
-
}
|
|
92
|
-
if (!options?.tracer) {
|
|
93
|
-
return await this.program.forward(_ai, values, opt);
|
|
94
|
-
}
|
|
95
|
-
const attributes = {
|
|
96
|
-
['agent.name']: this.name,
|
|
97
|
-
['agent.description']: this.description,
|
|
98
|
-
['agent.subAgents']: this.subAgentList ?? 'none'
|
|
99
|
-
};
|
|
100
|
-
return await options?.tracer.startActiveSpan('Agent', {
|
|
101
|
-
kind: index_js_2.AxSpanKind.SERVER,
|
|
102
|
-
attributes
|
|
103
|
-
}, async (span) => {
|
|
104
|
-
const res = await this.program.forward(_ai, values, opt);
|
|
105
|
-
span.end();
|
|
106
|
-
return res;
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
exports.AxAgent = AxAgent;
|
|
111
|
-
function toCamelCase(inputString) {
|
|
112
|
-
// Split the string by any non-alphanumeric character (including underscores, spaces, hyphens)
|
|
113
|
-
const words = inputString.split(/[^a-zA-Z0-9]/);
|
|
114
|
-
// Map through each word, capitalize the first letter of each word except the first word
|
|
115
|
-
const camelCaseString = words
|
|
116
|
-
.map((word, index) => {
|
|
117
|
-
// Lowercase the word to handle cases like uppercase letters in input
|
|
118
|
-
const lowerWord = word.toLowerCase();
|
|
119
|
-
// Capitalize the first letter of each word except the first one
|
|
120
|
-
if (index > 0 && lowerWord && lowerWord[0]) {
|
|
121
|
-
return lowerWord[0].toUpperCase() + lowerWord.slice(1);
|
|
122
|
-
}
|
|
123
|
-
return lowerWord;
|
|
124
|
-
})
|
|
125
|
-
.join('');
|
|
126
|
-
return camelCaseString;
|
|
127
|
-
}
|
|
128
|
-
//# sourceMappingURL=agent.js.map
|
package/cjs/prompts/agent.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"agent.js","sourceRoot":"","sources":["../../../prompts/agent.ts"],"names":[],"mappings":";;;AACA,8CAAwE;AAWxE,gDAA+C;AAQ/C,MAAa,OAAO;IAGV,EAAE,CAAe;IACjB,SAAS,CAAc;IACvB,OAAO,CAAkC;IACzC,MAAM,CAAe;IAErB,IAAI,CAAS;IACb,WAAW,CAAS;IACpB,YAAY,CAAU;IACtB,IAAI,CAAa;IAEzB,YACE,EACE,EAAE,EACF,IAA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,OAAO,MAAM,OAAO,EAAE,MAAM,CAAC,eAAe,CAC1C,OAAO,EACP;YACE,IAAI,EAAE,qBAAU,CAAC,MAAM;YACvB,UAAU;SACX,EACD,KAAK,EAAE,IAAI,EAAE,EAAE;YACb,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC;YACzD,IAAI,CAAC,GAAG,EAAE,CAAC;YACX,OAAO,GAAG,CAAC;QACb,CAAC,CACF,CAAC;IACJ,CAAC;CACF;AApKD,0BAoKC;AAED,SAAS,WAAW,CAAC,WAAmB;IACtC,8FAA8F;IAC9F,MAAM,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;IAEhD,wFAAwF;IACxF,MAAM,eAAe,GAAG,KAAK;SAC1B,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;QACnB,qEAAqE;QACrE,MAAM,SAAS,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;QAErC,gEAAgE;QAChE,IAAI,KAAK,GAAG,CAAC,IAAI,SAAS,IAAI,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;YAC3C,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACzD,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC,CAAC;SACD,IAAI,CAAC,EAAE,CAAC,CAAC;IAEZ,OAAO,eAAe,CAAC;AACzB,CAAC"}
|
package/cjs/prompts/cot.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { AxGen, type AxGenOptions } from '../dsp/generate.js';
|
|
2
|
-
import type { AxGenIn, AxGenOut } from '../dsp/program.js';
|
|
3
|
-
import { AxSignature } from '../dsp/sig.js';
|
|
4
|
-
export declare class AxChainOfThought<IN extends AxGenIn = AxGenIn, OUT extends AxGenOut = AxGenOut> extends AxGen<IN, OUT & {
|
|
5
|
-
reason: string;
|
|
6
|
-
}> {
|
|
7
|
-
constructor(signature: Readonly<AxSignature | string>, options?: Readonly<AxGenOptions>);
|
|
8
|
-
}
|
package/cjs/prompts/cot.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AxChainOfThought = void 0;
|
|
4
|
-
const generate_js_1 = require("../dsp/generate.js");
|
|
5
|
-
const sig_js_1 = require("../dsp/sig.js");
|
|
6
|
-
class AxChainOfThought extends generate_js_1.AxGen {
|
|
7
|
-
constructor(signature, options) {
|
|
8
|
-
const sig = new sig_js_1.AxSignature(signature);
|
|
9
|
-
const description = `Let's work this out in a step by step way in order to ensure we have the right answer.`;
|
|
10
|
-
sig.setOutputFields([
|
|
11
|
-
{
|
|
12
|
-
name: 'reason',
|
|
13
|
-
description
|
|
14
|
-
},
|
|
15
|
-
...sig.getOutputFields()
|
|
16
|
-
]);
|
|
17
|
-
super(sig, options);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
exports.AxChainOfThought = AxChainOfThought;
|
|
21
|
-
//# sourceMappingURL=cot.js.map
|
package/cjs/prompts/cot.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cot.js","sourceRoot":"","sources":["../../../prompts/cot.ts"],"names":[],"mappings":";;;AAAA,oDAA8D;AAE9D,0CAA4C;AAE5C,MAAa,gBAGX,SAAQ,mBAAmC;IAC3C,YACE,SAAyC,EACzC,OAAgC;QAEhC,MAAM,GAAG,GAAG,IAAI,oBAAW,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,GAAG,EAAE,OAAO,CAAC,CAAC;IACtB,CAAC;CACF;AArBD,4CAqBC"}
|
package/cjs/prompts/index.d.ts
DELETED
package/cjs/prompts/index.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./cot.js"), exports);
|
|
18
|
-
__exportStar(require("./rag.js"), exports);
|
|
19
|
-
__exportStar(require("./agent.js"), exports);
|
|
20
|
-
//# sourceMappingURL=index.js.map
|
package/cjs/prompts/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../prompts/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,2CAAyB;AACzB,6CAA2B"}
|
package/cjs/prompts/rag.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { type AxGenOptions } from '../dsp/index.js';
|
|
2
|
-
import { type AxProgramForwardOptions } from '../dsp/program.js';
|
|
3
|
-
import type { AxAIService } from '../index.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(queryFn: (query: string) => Promise<string>, options: Readonly<AxGenOptions & {
|
|
15
|
-
maxHops?: number;
|
|
16
|
-
}>);
|
|
17
|
-
forward(ai: Readonly<AxAIService>, { question }: Readonly<{
|
|
18
|
-
question: string;
|
|
19
|
-
}>, options?: Readonly<AxProgramForwardOptions>): Promise<{
|
|
20
|
-
answer: string;
|
|
21
|
-
reason: string;
|
|
22
|
-
}>;
|
|
23
|
-
}
|
package/cjs/prompts/rag.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AxRAG = void 0;
|
|
4
|
-
const index_js_1 = require("../dsp/index.js");
|
|
5
|
-
const cot_js_1 = require("./cot.js");
|
|
6
|
-
class AxRAG extends cot_js_1.AxChainOfThought {
|
|
7
|
-
genQuery;
|
|
8
|
-
queryFn;
|
|
9
|
-
maxHops;
|
|
10
|
-
constructor(queryFn, options) {
|
|
11
|
-
const sig = '"Answer questions with short factoid answers." context:string[] "may contain relevant facts", question -> answer';
|
|
12
|
-
super(sig, options);
|
|
13
|
-
this.maxHops = options?.maxHops ?? 3;
|
|
14
|
-
const qsig = new index_js_1.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"');
|
|
15
|
-
this.genQuery = new index_js_1.AxGen(qsig);
|
|
16
|
-
this.queryFn = queryFn;
|
|
17
|
-
this.register(this.genQuery);
|
|
18
|
-
}
|
|
19
|
-
async forward(ai, { question }, options) {
|
|
20
|
-
let context = [];
|
|
21
|
-
for (let i = 0; i < this.maxHops; i++) {
|
|
22
|
-
const { query } = await this.genQuery.forward(ai, {
|
|
23
|
-
context,
|
|
24
|
-
question
|
|
25
|
-
}, options);
|
|
26
|
-
const val = await this.queryFn(query);
|
|
27
|
-
context = index_js_1.axStringUtil.dedup([...context, val]);
|
|
28
|
-
}
|
|
29
|
-
return super.forward(ai, { context, question }, options);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
exports.AxRAG = AxRAG;
|
|
33
|
-
//# sourceMappingURL=rag.js.map
|
package/cjs/prompts/rag.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rag.js","sourceRoot":"","sources":["../../../prompts/rag.ts"],"names":[],"mappings":";;;AAAA,8CAKyB;AAIzB,qCAA4C;AAE5C,MAAa,KAAM,SAAQ,yBAG1B;IACS,QAAQ,CAGd;IACM,OAAO,CAAqC;IAC5C,OAAO,CAAS;IAExB,YACE,OAA2C,EAC3C,OAAsD;QAEtD,MAAM,GAAG,GACP,kHAAkH,CAAC;QACrH,KAAK,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAEpB,IAAI,CAAC,OAAO,GAAG,OAAO,EAAE,OAAO,IAAI,CAAC,CAAC;QAErC,MAAM,IAAI,GAAG,IAAI,sBAAW,CAC1B,mLAAmL,CACpL,CAAC;QACF,IAAI,CAAC,QAAQ,GAAG,IAAI,gBAAK,CAGvB,IAAI,CAAC,CAAC;QACR,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC/B,CAAC;IAEe,KAAK,CAAC,OAAO,CAC3B,EAAyB,EACzB,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,EAAE,EACF;gBACE,OAAO;gBACP,QAAQ;aACT,EACD,OAAO,CACR,CAAC;YACF,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YACtC,OAAO,GAAG,uBAAY,CAAC,KAAK,CAAC,CAAC,GAAG,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC;QAClD,CAAC;QAED,OAAO,KAAK,CAAC,OAAO,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,OAAO,CAAC,CAAC;IAC3D,CAAC;CACF;AAtDD,sBAsDC"}
|
package/cjs/trace/index.d.ts
DELETED
|
@@ -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
|
-
}
|
package/cjs/trace/index.js
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AxSpanKind = exports.AxSpanStatusCode = exports.AxSpanKindValues = exports.AxLLMRequestTypeValues = exports.axSpanEvents = exports.axSpanAttributes = void 0;
|
|
4
|
-
exports.axSpanAttributes = {
|
|
5
|
-
// LLM
|
|
6
|
-
LLM_SYSTEM: 'gen_ai.system',
|
|
7
|
-
LLM_REQUEST_MODEL: 'gen_ai.request.model',
|
|
8
|
-
LLM_REQUEST_MAX_TOKENS: 'gen_ai.request.max_tokens',
|
|
9
|
-
LLM_REQUEST_TEMPERATURE: 'gen_ai.request.temperature',
|
|
10
|
-
LLM_REQUEST_TOP_K: 'gen_ai.request.top_k',
|
|
11
|
-
LLM_REQUEST_FREQUENCY_PENALTY: 'gen_ai.request.frequency_penalty',
|
|
12
|
-
LLM_REQUEST_PRESENCE_PENALTY: 'gen_ai.request.presence_penalty',
|
|
13
|
-
LLM_REQUEST_STOP_SEQUENCES: 'gen_ai.request.stop_sequences',
|
|
14
|
-
LLM_REQUEST_LLM_IS_STREAMING: 'gen_ai.request.llm_is_streaming',
|
|
15
|
-
LLM_REQUEST_TOP_P: 'gen_ai.request.top_p',
|
|
16
|
-
LLM_USAGE_PROMPT_TOKENS: 'gen_ai.usage.prompt_tokens',
|
|
17
|
-
LLM_USAGE_COMPLETION_TOKENS: 'gen_ai.usage.completion_tokens',
|
|
18
|
-
// Vector DB
|
|
19
|
-
DB_SYSTEM: 'db.system',
|
|
20
|
-
DB_TABLE: 'db.table',
|
|
21
|
-
DB_NAMESPACE: 'db.namespace',
|
|
22
|
-
DB_ID: 'db.id',
|
|
23
|
-
DB_QUERY_TEXT: 'db.query.text',
|
|
24
|
-
DB_VECTOR: 'db.vector',
|
|
25
|
-
DB_OPERATION_NAME: 'db.operation.name',
|
|
26
|
-
DB_VECTOR_QUERY_TOP_K: 'db.vector.query.top_k',
|
|
27
|
-
DB_QUERY_EMBEDDINGS: 'db.query.embeddings',
|
|
28
|
-
DB_QUERY_RESULT: 'db.query.result',
|
|
29
|
-
// Query Embeddings
|
|
30
|
-
DB_QUERY_EMBEDDINGS_VECTOR: 'db.query.embeddings.vector',
|
|
31
|
-
// Query Result (canonical format)
|
|
32
|
-
DB_QUERY_RESULT_ID: 'db.query.result.id',
|
|
33
|
-
DB_QUERY_RESULT_SCORE: 'db.query.result.score',
|
|
34
|
-
DB_QUERY_RESULT_DISTANCE: 'db.query.result.distance',
|
|
35
|
-
DB_QUERY_RESULT_METADATA: 'db.query.result.metadata',
|
|
36
|
-
DB_QUERY_RESULT_VECTOR: 'db.query.result.vector',
|
|
37
|
-
DB_QUERY_RESULT_DOCUMENT: 'db.query.result.document'
|
|
38
|
-
};
|
|
39
|
-
exports.axSpanEvents = {
|
|
40
|
-
LLM_PROMPT: 'gen_ai.prompt'
|
|
41
|
-
};
|
|
42
|
-
var AxLLMRequestTypeValues;
|
|
43
|
-
(function (AxLLMRequestTypeValues) {
|
|
44
|
-
AxLLMRequestTypeValues["COMPLETION"] = "completion";
|
|
45
|
-
AxLLMRequestTypeValues["CHAT"] = "chat";
|
|
46
|
-
AxLLMRequestTypeValues["RERANK"] = "rerank";
|
|
47
|
-
AxLLMRequestTypeValues["UNKNOWN"] = "unknown";
|
|
48
|
-
})(AxLLMRequestTypeValues || (exports.AxLLMRequestTypeValues = AxLLMRequestTypeValues = {}));
|
|
49
|
-
var AxSpanKindValues;
|
|
50
|
-
(function (AxSpanKindValues) {
|
|
51
|
-
AxSpanKindValues["WORKFLOW"] = "workflow";
|
|
52
|
-
AxSpanKindValues["TASK"] = "task";
|
|
53
|
-
AxSpanKindValues["AGENT"] = "agent";
|
|
54
|
-
AxSpanKindValues["TOOL"] = "tool";
|
|
55
|
-
AxSpanKindValues["UNKNOWN"] = "unknown";
|
|
56
|
-
})(AxSpanKindValues || (exports.AxSpanKindValues = AxSpanKindValues = {}));
|
|
57
|
-
var AxSpanStatusCode;
|
|
58
|
-
(function (AxSpanStatusCode) {
|
|
59
|
-
AxSpanStatusCode["OK"] = "OK";
|
|
60
|
-
AxSpanStatusCode["ERROR"] = "ERROR";
|
|
61
|
-
})(AxSpanStatusCode || (exports.AxSpanStatusCode = AxSpanStatusCode = {}));
|
|
62
|
-
var AxSpanKind;
|
|
63
|
-
(function (AxSpanKind) {
|
|
64
|
-
AxSpanKind["INTERNAL"] = "INTERNAL";
|
|
65
|
-
AxSpanKind["SERVER"] = "SERVER";
|
|
66
|
-
AxSpanKind["CLIENT"] = "CLIENT";
|
|
67
|
-
AxSpanKind["PRODUCER"] = "PRODUCER";
|
|
68
|
-
AxSpanKind["CONSUMER"] = "CONSUMER";
|
|
69
|
-
})(AxSpanKind || (exports.AxSpanKind = AxSpanKind = {}));
|
|
70
|
-
//# sourceMappingURL=index.js.map
|
package/cjs/trace/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,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1B,yCAAqB,CAAA;IACrB,iCAAa,CAAA;IACb,mCAAe,CAAA;IACf,iCAAa,CAAA;IACb,uCAAmB,CAAA;AACrB,CAAC,EANW,gBAAgB,gCAAhB,gBAAgB,QAM3B;AAuBD,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IAC1B,6BAAS,CAAA;IACT,mCAAe,CAAA;AACjB,CAAC,EAHW,gBAAgB,gCAAhB,gBAAgB,QAG3B;AA2DD,IAAY,UAMX;AAND,WAAY,UAAU;IACpB,mCAAqB,CAAA;IACrB,+BAAiB,CAAA;IACjB,+BAAiB,CAAA;IACjB,mCAAqB,CAAA;IACrB,mCAAqB,CAAA;AACvB,CAAC,EANW,UAAU,0BAAV,UAAU,QAMrB"}
|
package/cjs/util/apicall.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { type ReadableStream } from 'stream/web';
|
|
2
|
-
import type { AxSpan } from '../trace/index.js';
|
|
3
|
-
/**
|
|
4
|
-
* Util: API details
|
|
5
|
-
* @export
|
|
6
|
-
*/
|
|
7
|
-
export type API = {
|
|
8
|
-
name?: string;
|
|
9
|
-
headers?: Record<string, string>;
|
|
10
|
-
put?: boolean;
|
|
11
|
-
};
|
|
12
|
-
export declare const apiCall: <TRequest = unknown, TResponse = unknown>(api: Readonly<API & {
|
|
13
|
-
url: string | URL;
|
|
14
|
-
stream?: boolean;
|
|
15
|
-
debug?: boolean;
|
|
16
|
-
fetch?: typeof fetch;
|
|
17
|
-
span?: AxSpan;
|
|
18
|
-
}>, json: TRequest) => Promise<TResponse | ReadableStream<TResponse>>;
|
package/cjs/util/apicall.js
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.apiCall = void 0;
|
|
7
|
-
const path_1 = __importDefault(require("path"));
|
|
8
|
-
const web_1 = require("stream/web");
|
|
9
|
-
const sse_js_1 = require("./sse.js");
|
|
10
|
-
const stream_js_1 = require("./stream.js");
|
|
11
|
-
const textDecoderStream = web_1.TextDecoderStream ?? stream_js_1.TextDecoderStreamPolyfill;
|
|
12
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
13
|
-
const apiCall = async (api, json) => {
|
|
14
|
-
const baseUrl = new URL(process.env['PROXY'] ?? api.url);
|
|
15
|
-
const apiPath = path_1.default.join(baseUrl.pathname, api.name ?? '/', baseUrl.search);
|
|
16
|
-
const apiUrl = new URL(apiPath, baseUrl);
|
|
17
|
-
if (api.span?.isRecording()) {
|
|
18
|
-
api.span.setAttributes({
|
|
19
|
-
'http.request.method': api.put ? 'PUT' : 'POST',
|
|
20
|
-
'url.full': apiUrl.href
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
let res;
|
|
24
|
-
try {
|
|
25
|
-
res = await (api.fetch ?? fetch)(apiUrl, {
|
|
26
|
-
method: api.put ? 'PUT' : 'POST',
|
|
27
|
-
headers: {
|
|
28
|
-
'Content-Type': 'application/json',
|
|
29
|
-
...api.headers
|
|
30
|
-
},
|
|
31
|
-
body: JSON.stringify(json)
|
|
32
|
-
});
|
|
33
|
-
if (res.status >= 400) {
|
|
34
|
-
const reqBody = JSON.stringify(json, null, 2);
|
|
35
|
-
throw new Error(`API Request Error: ${res.status}, ${res.statusText}\n:Request Body: ${reqBody}`);
|
|
36
|
-
}
|
|
37
|
-
if (!api.stream) {
|
|
38
|
-
const resJson = await res.json();
|
|
39
|
-
return resJson;
|
|
40
|
-
}
|
|
41
|
-
if (!res.body) {
|
|
42
|
-
throw new Error('Response body is null');
|
|
43
|
-
}
|
|
44
|
-
const st = res.body
|
|
45
|
-
.pipeThrough(new textDecoderStream())
|
|
46
|
-
.pipeThrough(new sse_js_1.SSEParser());
|
|
47
|
-
return st;
|
|
48
|
-
}
|
|
49
|
-
catch (e) {
|
|
50
|
-
if (api.span?.isRecording()) {
|
|
51
|
-
api.span.recordAxSpanException(e);
|
|
52
|
-
}
|
|
53
|
-
const reqBody = JSON.stringify(json, null, 2);
|
|
54
|
-
throw new Error(`API Response Error: ${apiUrl.href}, ${e}\nRequest Body: ${reqBody}`);
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
exports.apiCall = apiCall;
|
|
58
|
-
//# sourceMappingURL=apicall.js.map
|
package/cjs/util/apicall.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"apicall.js","sourceRoot":"","sources":["../../../util/apicall.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AACxB,oCAGoB;AAIpB,qCAAqC;AACrC,2CAAwD;AAaxD,MAAM,iBAAiB,GAAG,uBAAuB,IAAI,qCAAyB,CAAC;AAE/E,gEAAgE;AACzD,MAAM,OAAO,GAAG,KAAK,EAC1B,GAQC,EACD,IAAc,EACkC,EAAE;IAClD,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;IACzD,MAAM,OAAO,GAAG,cAAI,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC,IAAI,IAAI,GAAG,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IAC7E,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAEzC,IAAI,GAAG,CAAC,IAAI,EAAE,WAAW,EAAE,EAAE,CAAC;QAC5B,GAAG,CAAC,IAAI,CAAC,aAAa,CAAC;YACrB,qBAAqB,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM;YAC/C,UAAU,EAAE,MAAM,CAAC,IAAI;SACxB,CAAC,CAAC;IACL,CAAC;IAED,IAAI,GAAqD,CAAC;IAE1D,IAAI,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AC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QAC9C,MAAM,IAAI,KAAK,CACb,uBAAuB,MAAM,CAAC,IAAI,KAAK,CAAC,mBAAmB,OAAO,EAAE,CACrE,CAAC;IACJ,CAAC;AACH,CAAC,CAAC;AAlEW,QAAA,OAAO,WAkElB"}
|
package/cjs/util/log.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export declare class ColorLog {
|
|
2
|
-
private readonly ANSI_WHITE_BRIGHT;
|
|
3
|
-
private readonly ANSI_GREEN_BRIGHT;
|
|
4
|
-
private readonly ANSI_BLUE_BRIGHT;
|
|
5
|
-
private readonly ANSI_YELLOW;
|
|
6
|
-
private readonly ANSI_RED;
|
|
7
|
-
private readonly ANSI_RESET;
|
|
8
|
-
private colorize;
|
|
9
|
-
whiteBright(text: string): string;
|
|
10
|
-
greenBright(text: string): string;
|
|
11
|
-
blueBright(text: string): string;
|
|
12
|
-
yellow(text: string): string;
|
|
13
|
-
red(text: string): string;
|
|
14
|
-
}
|
package/cjs/util/log.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ColorLog = void 0;
|
|
4
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
5
|
-
class ColorLog {
|
|
6
|
-
// ANSI escape codes for different colors
|
|
7
|
-
ANSI_WHITE_BRIGHT = '\x1b[97m';
|
|
8
|
-
ANSI_GREEN_BRIGHT = '\x1b[92m';
|
|
9
|
-
ANSI_BLUE_BRIGHT = '\x1b[94m';
|
|
10
|
-
ANSI_YELLOW = '\x1b[93m';
|
|
11
|
-
ANSI_RED = '\x1b[91m';
|
|
12
|
-
ANSI_RESET = '\x1b[0m';
|
|
13
|
-
// Method to wrap text with the specified ANSI color code
|
|
14
|
-
colorize(text, colorCode) {
|
|
15
|
-
return `${colorCode}${text}${this.ANSI_RESET}`;
|
|
16
|
-
}
|
|
17
|
-
// Public methods to colorize text in various colors
|
|
18
|
-
whiteBright(text) {
|
|
19
|
-
return this.colorize(text, this.ANSI_WHITE_BRIGHT);
|
|
20
|
-
}
|
|
21
|
-
greenBright(text) {
|
|
22
|
-
return this.colorize(text, this.ANSI_GREEN_BRIGHT);
|
|
23
|
-
}
|
|
24
|
-
blueBright(text) {
|
|
25
|
-
return this.colorize(text, this.ANSI_BLUE_BRIGHT);
|
|
26
|
-
}
|
|
27
|
-
yellow(text) {
|
|
28
|
-
return this.colorize(text, this.ANSI_YELLOW);
|
|
29
|
-
}
|
|
30
|
-
red(text) {
|
|
31
|
-
return this.colorize(text, this.ANSI_RED);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
exports.ColorLog = ColorLog;
|
|
35
|
-
//# sourceMappingURL=log.js.map
|
package/cjs/util/log.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"log.js","sourceRoot":"","sources":["../../../util/log.ts"],"names":[],"mappings":";;;AAAA,gEAAgE;AAChE,MAAa,QAAQ;IACnB,yCAAyC;IACxB,iBAAiB,GAAG,UAAU,CAAC;IAC/B,iBAAiB,GAAG,UAAU,CAAC;IAC/B,gBAAgB,GAAG,UAAU,CAAC;IAC9B,WAAW,GAAG,UAAU,CAAC;IACzB,QAAQ,GAAG,UAAU,CAAC;IACtB,UAAU,GAAG,SAAS,CAAC;IAExC,yDAAyD;IACjD,QAAQ,CAAC,IAAY,EAAE,SAAiB;QAC9C,OAAO,GAAG,SAAS,GAAG,IAAI,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;IACjD,CAAC;IAED,oDAAoD;IAC7C,WAAW,CAAC,IAAY;QAC7B,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,iBAAiB,CAAC,CAAC;IACrD,CAAC;IAEM,WAAW,CAAC,IAAY;QAC7B,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,iBAAiB,CAAC,CAAC;IACrD,CAAC;IAEM,UAAU,CAAC,IAAY;QAC5B,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC;IACpD,CAAC;IAEM,MAAM,CAAC,IAAY;QACxB,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;IAC/C,CAAC;IAEM,GAAG,CAAC,IAAY;QACrB,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC5C,CAAC;CACF;AAlCD,4BAkCC"}
|
package/cjs/util/other.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function sleep(ms: number): Promise<unknown>;
|