shield360 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +310 -0
- package/dist/__tests__/manual-trace.test.d.ts +1 -0
- package/dist/__tests__/manual-trace.test.js +118 -0
- package/dist/__tests__/manual-trace.test.js.map +1 -0
- package/dist/__tests__/register.test.d.ts +0 -0
- package/dist/__tests__/register.test.js +90 -0
- package/dist/__tests__/register.test.js.map +1 -0
- package/dist/config.d.ts +28 -0
- package/dist/config.js +22 -0
- package/dist/config.js.map +1 -0
- package/dist/constant.d.ts +6 -0
- package/dist/constant.js +14 -0
- package/dist/constant.js.map +1 -0
- package/dist/evals/__tests__/offline.test.d.ts +1 -0
- package/dist/evals/__tests__/offline.test.js +427 -0
- package/dist/evals/__tests__/offline.test.js.map +1 -0
- package/dist/evals/index.d.ts +2 -0
- package/dist/evals/index.js +15 -0
- package/dist/evals/index.js.map +1 -0
- package/dist/evals/offline.d.ts +6 -0
- package/dist/evals/offline.js +350 -0
- package/dist/evals/offline.js.map +1 -0
- package/dist/evals/types.d.ts +74 -0
- package/dist/evals/types.js +23 -0
- package/dist/evals/types.js.map +1 -0
- package/dist/features/__tests__/rule-engine.test.d.ts +1 -0
- package/dist/features/__tests__/rule-engine.test.js +146 -0
- package/dist/features/__tests__/rule-engine.test.js.map +1 -0
- package/dist/features/base.d.ts +8 -0
- package/dist/features/base.js +15 -0
- package/dist/features/base.js.map +1 -0
- package/dist/features/prompt-hub.d.ts +4 -0
- package/dist/features/prompt-hub.js +66 -0
- package/dist/features/prompt-hub.js.map +1 -0
- package/dist/features/rule-engine.d.ts +6 -0
- package/dist/features/rule-engine.js +60 -0
- package/dist/features/rule-engine.js.map +1 -0
- package/dist/features/vault.d.ts +4 -0
- package/dist/features/vault.js +63 -0
- package/dist/features/vault.js.map +1 -0
- package/dist/guard/__tests__/findings.test.d.ts +1 -0
- package/dist/guard/__tests__/findings.test.js +79 -0
- package/dist/guard/__tests__/findings.test.js.map +1 -0
- package/dist/guard/__tests__/integration.test.d.ts +1 -0
- package/dist/guard/__tests__/integration.test.js +215 -0
- package/dist/guard/__tests__/integration.test.js.map +1 -0
- package/dist/guard/__tests__/pii.test.d.ts +1 -0
- package/dist/guard/__tests__/pii.test.js +131 -0
- package/dist/guard/__tests__/pii.test.js.map +1 -0
- package/dist/guard/__tests__/pipeline.test.d.ts +1 -0
- package/dist/guard/__tests__/pipeline.test.js +162 -0
- package/dist/guard/__tests__/pipeline.test.js.map +1 -0
- package/dist/guard/__tests__/prompt-injection.test.d.ts +1 -0
- package/dist/guard/__tests__/prompt-injection.test.js +92 -0
- package/dist/guard/__tests__/prompt-injection.test.js.map +1 -0
- package/dist/guard/__tests__/report.test.d.ts +1 -0
- package/dist/guard/__tests__/report.test.js +50 -0
- package/dist/guard/__tests__/report.test.js.map +1 -0
- package/dist/guard/base.d.ts +79 -0
- package/dist/guard/base.js +136 -0
- package/dist/guard/base.js.map +1 -0
- package/dist/guard/custom.d.ts +19 -0
- package/dist/guard/custom.js +46 -0
- package/dist/guard/custom.js.map +1 -0
- package/dist/guard/findings.d.ts +31 -0
- package/dist/guard/findings.js +156 -0
- package/dist/guard/findings.js.map +1 -0
- package/dist/guard/index.d.ts +24 -0
- package/dist/guard/index.js +42 -0
- package/dist/guard/index.js.map +1 -0
- package/dist/guard/integration.d.ts +44 -0
- package/dist/guard/integration.js +363 -0
- package/dist/guard/integration.js.map +1 -0
- package/dist/guard/moderation.d.ts +18 -0
- package/dist/guard/moderation.js +61 -0
- package/dist/guard/moderation.js.map +1 -0
- package/dist/guard/pii.d.ts +17 -0
- package/dist/guard/pii.js +114 -0
- package/dist/guard/pii.js.map +1 -0
- package/dist/guard/pipeline.d.ts +26 -0
- package/dist/guard/pipeline.js +139 -0
- package/dist/guard/pipeline.js.map +1 -0
- package/dist/guard/prompt-injection.d.ts +21 -0
- package/dist/guard/prompt-injection.js +70 -0
- package/dist/guard/prompt-injection.js.map +1 -0
- package/dist/guard/report.d.ts +34 -0
- package/dist/guard/report.js +182 -0
- package/dist/guard/report.js.map +1 -0
- package/dist/guard/schema.d.ts +20 -0
- package/dist/guard/schema.js +99 -0
- package/dist/guard/schema.js.map +1 -0
- package/dist/guard/sensitive-topic.d.ts +23 -0
- package/dist/guard/sensitive-topic.js +89 -0
- package/dist/guard/sensitive-topic.js.map +1 -0
- package/dist/guard/topic-restriction.d.ts +22 -0
- package/dist/guard/topic-restriction.js +54 -0
- package/dist/guard/topic-restriction.js.map +1 -0
- package/dist/helpers.d.ts +246 -0
- package/dist/helpers.js +903 -0
- package/dist/helpers.js.map +1 -0
- package/dist/index.d.ts +71 -0
- package/dist/index.js +234 -0
- package/dist/index.js.map +1 -0
- package/dist/instrumentation/__tests__/ai21-rag-trace-comparison.test.d.ts +13 -0
- package/dist/instrumentation/__tests__/ai21-rag-trace-comparison.test.js +176 -0
- package/dist/instrumentation/__tests__/ai21-rag-trace-comparison.test.js.map +1 -0
- package/dist/instrumentation/__tests__/ai21-trace-comparison.test.d.ts +10 -0
- package/dist/instrumentation/__tests__/ai21-trace-comparison.test.js +203 -0
- package/dist/instrumentation/__tests__/ai21-trace-comparison.test.js.map +1 -0
- package/dist/instrumentation/__tests__/anthropic-wrapper.test.d.ts +1 -0
- package/dist/instrumentation/__tests__/anthropic-wrapper.test.js +284 -0
- package/dist/instrumentation/__tests__/anthropic-wrapper.test.js.map +1 -0
- package/dist/instrumentation/__tests__/assemblyai-wrapper.test.d.ts +1 -0
- package/dist/instrumentation/__tests__/assemblyai-wrapper.test.js +284 -0
- package/dist/instrumentation/__tests__/assemblyai-wrapper.test.js.map +1 -0
- package/dist/instrumentation/__tests__/astra-trace-comparison.test.d.ts +7 -0
- package/dist/instrumentation/__tests__/astra-trace-comparison.test.js +160 -0
- package/dist/instrumentation/__tests__/astra-trace-comparison.test.js.map +1 -0
- package/dist/instrumentation/__tests__/base-wrapper.test.d.ts +1 -0
- package/dist/instrumentation/__tests__/base-wrapper.test.js +171 -0
- package/dist/instrumentation/__tests__/base-wrapper.test.js.map +1 -0
- package/dist/instrumentation/__tests__/bedrock-trace-comparison.test.d.ts +1 -0
- package/dist/instrumentation/__tests__/bedrock-trace-comparison.test.js +422 -0
- package/dist/instrumentation/__tests__/bedrock-trace-comparison.test.js.map +1 -0
- package/dist/instrumentation/__tests__/browser-use-wrapper.test.d.ts +1 -0
- package/dist/instrumentation/__tests__/browser-use-wrapper.test.js +284 -0
- package/dist/instrumentation/__tests__/browser-use-wrapper.test.js.map +1 -0
- package/dist/instrumentation/__tests__/cache-pricing.test.d.ts +15 -0
- package/dist/instrumentation/__tests__/cache-pricing.test.js +155 -0
- package/dist/instrumentation/__tests__/cache-pricing.test.js.map +1 -0
- package/dist/instrumentation/__tests__/chroma-trace-comparison.test.d.ts +18 -0
- package/dist/instrumentation/__tests__/chroma-trace-comparison.test.js +209 -0
- package/dist/instrumentation/__tests__/chroma-trace-comparison.test.js.map +1 -0
- package/dist/instrumentation/__tests__/cohere-wrapper.test.d.ts +1 -0
- package/dist/instrumentation/__tests__/cohere-wrapper.test.js +256 -0
- package/dist/instrumentation/__tests__/cohere-wrapper.test.js.map +1 -0
- package/dist/instrumentation/__tests__/elevenlabs-wrapper.test.d.ts +1 -0
- package/dist/instrumentation/__tests__/elevenlabs-wrapper.test.js +282 -0
- package/dist/instrumentation/__tests__/elevenlabs-wrapper.test.js.map +1 -0
- package/dist/instrumentation/__tests__/firecrawl-wrapper.test.d.ts +1 -0
- package/dist/instrumentation/__tests__/firecrawl-wrapper.test.js +238 -0
- package/dist/instrumentation/__tests__/firecrawl-wrapper.test.js.map +1 -0
- package/dist/instrumentation/__tests__/google-ai-trace-comparison.test.d.ts +4 -0
- package/dist/instrumentation/__tests__/google-ai-trace-comparison.test.js +229 -0
- package/dist/instrumentation/__tests__/google-ai-trace-comparison.test.js.map +1 -0
- package/dist/instrumentation/__tests__/gpu-collector.test.d.ts +1 -0
- package/dist/instrumentation/__tests__/gpu-collector.test.js +247 -0
- package/dist/instrumentation/__tests__/gpu-collector.test.js.map +1 -0
- package/dist/instrumentation/__tests__/gradient-trace-comparison.test.d.ts +11 -0
- package/dist/instrumentation/__tests__/gradient-trace-comparison.test.js +391 -0
- package/dist/instrumentation/__tests__/gradient-trace-comparison.test.js.map +1 -0
- package/dist/instrumentation/__tests__/groq-trace-comparison.test.d.ts +7 -0
- package/dist/instrumentation/__tests__/groq-trace-comparison.test.js +687 -0
- package/dist/instrumentation/__tests__/groq-trace-comparison.test.js.map +1 -0
- package/dist/instrumentation/__tests__/helpers-genai.test.d.ts +14 -0
- package/dist/instrumentation/__tests__/helpers-genai.test.js +347 -0
- package/dist/instrumentation/__tests__/helpers-genai.test.js.map +1 -0
- package/dist/instrumentation/__tests__/huggingface-trace-comparison.test.d.ts +7 -0
- package/dist/instrumentation/__tests__/huggingface-trace-comparison.test.js +529 -0
- package/dist/instrumentation/__tests__/huggingface-trace-comparison.test.js.map +1 -0
- package/dist/instrumentation/__tests__/langchain-role-map.test.d.ts +1 -0
- package/dist/instrumentation/__tests__/langchain-role-map.test.js +19 -0
- package/dist/instrumentation/__tests__/langchain-role-map.test.js.map +1 -0
- package/dist/instrumentation/__tests__/langchain-wrapper.test.d.ts +1 -0
- package/dist/instrumentation/__tests__/langchain-wrapper.test.js +282 -0
- package/dist/instrumentation/__tests__/langchain-wrapper.test.js.map +1 -0
- package/dist/instrumentation/__tests__/letta-wrapper.test.d.ts +1 -0
- package/dist/instrumentation/__tests__/letta-wrapper.test.js +285 -0
- package/dist/instrumentation/__tests__/letta-wrapper.test.js.map +1 -0
- package/dist/instrumentation/__tests__/mem0-trace-comparison.test.d.ts +13 -0
- package/dist/instrumentation/__tests__/mem0-trace-comparison.test.js +208 -0
- package/dist/instrumentation/__tests__/mem0-trace-comparison.test.js.map +1 -0
- package/dist/instrumentation/__tests__/milvus-trace-comparison.test.d.ts +17 -0
- package/dist/instrumentation/__tests__/milvus-trace-comparison.test.js +206 -0
- package/dist/instrumentation/__tests__/milvus-trace-comparison.test.js.map +1 -0
- package/dist/instrumentation/__tests__/mistral-trace-comparison.test.d.ts +1 -0
- package/dist/instrumentation/__tests__/mistral-trace-comparison.test.js +345 -0
- package/dist/instrumentation/__tests__/mistral-trace-comparison.test.js.map +1 -0
- package/dist/instrumentation/__tests__/openai-wrapper.test.d.ts +1 -0
- package/dist/instrumentation/__tests__/openai-wrapper.test.js +179 -0
- package/dist/instrumentation/__tests__/openai-wrapper.test.js.map +1 -0
- package/dist/instrumentation/__tests__/pg-trace-comparison.test.d.ts +21 -0
- package/dist/instrumentation/__tests__/pg-trace-comparison.test.js +455 -0
- package/dist/instrumentation/__tests__/pg-trace-comparison.test.js.map +1 -0
- package/dist/instrumentation/__tests__/qdrant-trace-comparison.test.d.ts +17 -0
- package/dist/instrumentation/__tests__/qdrant-trace-comparison.test.js +182 -0
- package/dist/instrumentation/__tests__/qdrant-trace-comparison.test.js.map +1 -0
- package/dist/instrumentation/__tests__/replicate-trace-comparison.test.d.ts +8 -0
- package/dist/instrumentation/__tests__/replicate-trace-comparison.test.js +346 -0
- package/dist/instrumentation/__tests__/replicate-trace-comparison.test.js.map +1 -0
- package/dist/instrumentation/__tests__/together-trace-comparison.test.d.ts +4 -0
- package/dist/instrumentation/__tests__/together-trace-comparison.test.js +289 -0
- package/dist/instrumentation/__tests__/together-trace-comparison.test.js.map +1 -0
- package/dist/instrumentation/__tests__/trace-comparison-utils.d.ts +67 -0
- package/dist/instrumentation/__tests__/trace-comparison-utils.js +255 -0
- package/dist/instrumentation/__tests__/trace-comparison-utils.js.map +1 -0
- package/dist/instrumentation/__tests__/transformers-trace-comparison.test.d.ts +11 -0
- package/dist/instrumentation/__tests__/transformers-trace-comparison.test.js +214 -0
- package/dist/instrumentation/__tests__/transformers-trace-comparison.test.js.map +1 -0
- package/dist/instrumentation/__tests__/vercel-ai-trace-comparison.test.d.ts +8 -0
- package/dist/instrumentation/__tests__/vercel-ai-trace-comparison.test.js +446 -0
- package/dist/instrumentation/__tests__/vercel-ai-trace-comparison.test.js.map +1 -0
- package/dist/instrumentation/__tests__/vertexai-trace-comparison.test.d.ts +6 -0
- package/dist/instrumentation/__tests__/vertexai-trace-comparison.test.js +409 -0
- package/dist/instrumentation/__tests__/vertexai-trace-comparison.test.js.map +1 -0
- package/dist/instrumentation/__tests__/vllm-trace-comparison.test.d.ts +1 -0
- package/dist/instrumentation/__tests__/vllm-trace-comparison.test.js +519 -0
- package/dist/instrumentation/__tests__/vllm-trace-comparison.test.js.map +1 -0
- package/dist/instrumentation/ai21/index.d.ts +11 -0
- package/dist/instrumentation/ai21/index.js +67 -0
- package/dist/instrumentation/ai21/index.js.map +1 -0
- package/dist/instrumentation/ai21/wrapper.d.ts +54 -0
- package/dist/instrumentation/ai21/wrapper.js +511 -0
- package/dist/instrumentation/ai21/wrapper.js.map +1 -0
- package/dist/instrumentation/anthropic/index.d.ts +11 -0
- package/dist/instrumentation/anthropic/index.js +45 -0
- package/dist/instrumentation/anthropic/index.js.map +1 -0
- package/dist/instrumentation/anthropic/wrapper.d.ts +34 -0
- package/dist/instrumentation/anthropic/wrapper.js +426 -0
- package/dist/instrumentation/anthropic/wrapper.js.map +1 -0
- package/dist/instrumentation/assemblyai/index.d.ts +12 -0
- package/dist/instrumentation/assemblyai/index.js +91 -0
- package/dist/instrumentation/assemblyai/index.js.map +1 -0
- package/dist/instrumentation/assemblyai/wrapper.d.ts +35 -0
- package/dist/instrumentation/assemblyai/wrapper.js +238 -0
- package/dist/instrumentation/assemblyai/wrapper.js.map +1 -0
- package/dist/instrumentation/astra/index.d.ts +11 -0
- package/dist/instrumentation/astra/index.js +87 -0
- package/dist/instrumentation/astra/index.js.map +1 -0
- package/dist/instrumentation/astra/wrapper.d.ts +39 -0
- package/dist/instrumentation/astra/wrapper.js +349 -0
- package/dist/instrumentation/astra/wrapper.js.map +1 -0
- package/dist/instrumentation/azure-ai-inference/index.d.ts +11 -0
- package/dist/instrumentation/azure-ai-inference/index.js +76 -0
- package/dist/instrumentation/azure-ai-inference/index.js.map +1 -0
- package/dist/instrumentation/azure-ai-inference/wrapper.d.ts +55 -0
- package/dist/instrumentation/azure-ai-inference/wrapper.js +580 -0
- package/dist/instrumentation/azure-ai-inference/wrapper.js.map +1 -0
- package/dist/instrumentation/base-wrapper.d.ts +16 -0
- package/dist/instrumentation/base-wrapper.js +139 -0
- package/dist/instrumentation/base-wrapper.js.map +1 -0
- package/dist/instrumentation/bedrock/index.d.ts +11 -0
- package/dist/instrumentation/bedrock/index.js +52 -0
- package/dist/instrumentation/bedrock/index.js.map +1 -0
- package/dist/instrumentation/bedrock/wrapper.d.ts +41 -0
- package/dist/instrumentation/bedrock/wrapper.js +494 -0
- package/dist/instrumentation/bedrock/wrapper.js.map +1 -0
- package/dist/instrumentation/browser-use/index.d.ts +11 -0
- package/dist/instrumentation/browser-use/index.js +98 -0
- package/dist/instrumentation/browser-use/index.js.map +1 -0
- package/dist/instrumentation/browser-use/wrapper.d.ts +12 -0
- package/dist/instrumentation/browser-use/wrapper.js +706 -0
- package/dist/instrumentation/browser-use/wrapper.js.map +1 -0
- package/dist/instrumentation/chroma/index.d.ts +11 -0
- package/dist/instrumentation/chroma/index.js +70 -0
- package/dist/instrumentation/chroma/index.js.map +1 -0
- package/dist/instrumentation/chroma/wrapper.d.ts +10 -0
- package/dist/instrumentation/chroma/wrapper.js +127 -0
- package/dist/instrumentation/chroma/wrapper.js.map +1 -0
- package/dist/instrumentation/claude-agent-sdk/index.d.ts +23 -0
- package/dist/instrumentation/claude-agent-sdk/index.js +83 -0
- package/dist/instrumentation/claude-agent-sdk/index.js.map +1 -0
- package/dist/instrumentation/claude-agent-sdk/wrapper.d.ts +13 -0
- package/dist/instrumentation/claude-agent-sdk/wrapper.js +1123 -0
- package/dist/instrumentation/claude-agent-sdk/wrapper.js.map +1 -0
- package/dist/instrumentation/cohere/index.d.ts +11 -0
- package/dist/instrumentation/cohere/index.js +53 -0
- package/dist/instrumentation/cohere/index.js.map +1 -0
- package/dist/instrumentation/cohere/wrapper.d.ts +50 -0
- package/dist/instrumentation/cohere/wrapper.js +452 -0
- package/dist/instrumentation/cohere/wrapper.js.map +1 -0
- package/dist/instrumentation/cursor-sdk/index.d.ts +21 -0
- package/dist/instrumentation/cursor-sdk/index.js +58 -0
- package/dist/instrumentation/cursor-sdk/index.js.map +1 -0
- package/dist/instrumentation/cursor-sdk/wrapper.d.ts +17 -0
- package/dist/instrumentation/cursor-sdk/wrapper.js +789 -0
- package/dist/instrumentation/cursor-sdk/wrapper.js.map +1 -0
- package/dist/instrumentation/elevenlabs/index.d.ts +12 -0
- package/dist/instrumentation/elevenlabs/index.js +92 -0
- package/dist/instrumentation/elevenlabs/index.js.map +1 -0
- package/dist/instrumentation/elevenlabs/wrapper.d.ts +34 -0
- package/dist/instrumentation/elevenlabs/wrapper.js +280 -0
- package/dist/instrumentation/elevenlabs/wrapper.js.map +1 -0
- package/dist/instrumentation/firecrawl/index.d.ts +13 -0
- package/dist/instrumentation/firecrawl/index.js +115 -0
- package/dist/instrumentation/firecrawl/index.js.map +1 -0
- package/dist/instrumentation/firecrawl/wrapper.d.ts +22 -0
- package/dist/instrumentation/firecrawl/wrapper.js +378 -0
- package/dist/instrumentation/firecrawl/wrapper.js.map +1 -0
- package/dist/instrumentation/google-adk/index.d.ts +57 -0
- package/dist/instrumentation/google-adk/index.js +371 -0
- package/dist/instrumentation/google-adk/index.js.map +1 -0
- package/dist/instrumentation/google-adk/utils.d.ts +45 -0
- package/dist/instrumentation/google-adk/utils.js +663 -0
- package/dist/instrumentation/google-adk/utils.js.map +1 -0
- package/dist/instrumentation/google-adk/wrapper.d.ts +11 -0
- package/dist/instrumentation/google-adk/wrapper.js +391 -0
- package/dist/instrumentation/google-adk/wrapper.js.map +1 -0
- package/dist/instrumentation/google-ai/index.d.ts +11 -0
- package/dist/instrumentation/google-ai/index.js +48 -0
- package/dist/instrumentation/google-ai/index.js.map +1 -0
- package/dist/instrumentation/google-ai/wrapper.d.ts +52 -0
- package/dist/instrumentation/google-ai/wrapper.js +466 -0
- package/dist/instrumentation/google-ai/wrapper.js.map +1 -0
- package/dist/instrumentation/gpu/index.d.ts +38 -0
- package/dist/instrumentation/gpu/index.js +233 -0
- package/dist/instrumentation/gpu/index.js.map +1 -0
- package/dist/instrumentation/gradient/index.d.ts +12 -0
- package/dist/instrumentation/gradient/index.js +74 -0
- package/dist/instrumentation/gradient/index.js.map +1 -0
- package/dist/instrumentation/gradient/utils.d.ts +14 -0
- package/dist/instrumentation/gradient/utils.js +119 -0
- package/dist/instrumentation/gradient/utils.js.map +1 -0
- package/dist/instrumentation/gradient/wrapper.d.ts +76 -0
- package/dist/instrumentation/gradient/wrapper.js +584 -0
- package/dist/instrumentation/gradient/wrapper.js.map +1 -0
- package/dist/instrumentation/groq/index.d.ts +11 -0
- package/dist/instrumentation/groq/index.js +43 -0
- package/dist/instrumentation/groq/index.js.map +1 -0
- package/dist/instrumentation/groq/wrapper.d.ts +35 -0
- package/dist/instrumentation/groq/wrapper.js +442 -0
- package/dist/instrumentation/groq/wrapper.js.map +1 -0
- package/dist/instrumentation/huggingface/index.d.ts +13 -0
- package/dist/instrumentation/huggingface/index.js +110 -0
- package/dist/instrumentation/huggingface/index.js.map +1 -0
- package/dist/instrumentation/huggingface/wrapper.d.ts +54 -0
- package/dist/instrumentation/huggingface/wrapper.js +514 -0
- package/dist/instrumentation/huggingface/wrapper.js.map +1 -0
- package/dist/instrumentation/index.d.ts +7 -0
- package/dist/instrumentation/index.js +176 -0
- package/dist/instrumentation/index.js.map +1 -0
- package/dist/instrumentation/langchain/index.d.ts +16 -0
- package/dist/instrumentation/langchain/index.js +91 -0
- package/dist/instrumentation/langchain/index.js.map +1 -0
- package/dist/instrumentation/langchain/wrapper.d.ts +41 -0
- package/dist/instrumentation/langchain/wrapper.js +1235 -0
- package/dist/instrumentation/langchain/wrapper.js.map +1 -0
- package/dist/instrumentation/langgraph/index.d.ts +12 -0
- package/dist/instrumentation/langgraph/index.js +99 -0
- package/dist/instrumentation/langgraph/index.js.map +1 -0
- package/dist/instrumentation/langgraph/wrapper.d.ts +20 -0
- package/dist/instrumentation/langgraph/wrapper.js +620 -0
- package/dist/instrumentation/langgraph/wrapper.js.map +1 -0
- package/dist/instrumentation/letta/index.d.ts +10 -0
- package/dist/instrumentation/letta/index.js +122 -0
- package/dist/instrumentation/letta/index.js.map +1 -0
- package/dist/instrumentation/letta/utils.d.ts +24 -0
- package/dist/instrumentation/letta/utils.js +343 -0
- package/dist/instrumentation/letta/utils.js.map +1 -0
- package/dist/instrumentation/letta/wrapper.d.ts +37 -0
- package/dist/instrumentation/letta/wrapper.js +180 -0
- package/dist/instrumentation/letta/wrapper.js.map +1 -0
- package/dist/instrumentation/llamaindex/index.d.ts +36 -0
- package/dist/instrumentation/llamaindex/index.js +221 -0
- package/dist/instrumentation/llamaindex/index.js.map +1 -0
- package/dist/instrumentation/llamaindex/wrapper.d.ts +36 -0
- package/dist/instrumentation/llamaindex/wrapper.js +811 -0
- package/dist/instrumentation/llamaindex/wrapper.js.map +1 -0
- package/dist/instrumentation/mcp/index.d.ts +20 -0
- package/dist/instrumentation/mcp/index.js +282 -0
- package/dist/instrumentation/mcp/index.js.map +1 -0
- package/dist/instrumentation/mcp/wrapper.d.ts +72 -0
- package/dist/instrumentation/mcp/wrapper.js +571 -0
- package/dist/instrumentation/mcp/wrapper.js.map +1 -0
- package/dist/instrumentation/mem0/index.d.ts +17 -0
- package/dist/instrumentation/mem0/index.js +113 -0
- package/dist/instrumentation/mem0/index.js.map +1 -0
- package/dist/instrumentation/mem0/wrapper.d.ts +37 -0
- package/dist/instrumentation/mem0/wrapper.js +298 -0
- package/dist/instrumentation/mem0/wrapper.js.map +1 -0
- package/dist/instrumentation/milvus/index.d.ts +11 -0
- package/dist/instrumentation/milvus/index.js +67 -0
- package/dist/instrumentation/milvus/index.js.map +1 -0
- package/dist/instrumentation/milvus/wrapper.d.ts +15 -0
- package/dist/instrumentation/milvus/wrapper.js +219 -0
- package/dist/instrumentation/milvus/wrapper.js.map +1 -0
- package/dist/instrumentation/mistral/index.d.ts +11 -0
- package/dist/instrumentation/mistral/index.js +66 -0
- package/dist/instrumentation/mistral/index.js.map +1 -0
- package/dist/instrumentation/mistral/wrapper.d.ts +49 -0
- package/dist/instrumentation/mistral/wrapper.js +482 -0
- package/dist/instrumentation/mistral/wrapper.js.map +1 -0
- package/dist/instrumentation/ollama/index.d.ts +11 -0
- package/dist/instrumentation/ollama/index.js +72 -0
- package/dist/instrumentation/ollama/index.js.map +1 -0
- package/dist/instrumentation/ollama/wrapper.d.ts +73 -0
- package/dist/instrumentation/ollama/wrapper.js +629 -0
- package/dist/instrumentation/ollama/wrapper.js.map +1 -0
- package/dist/instrumentation/openai/index.d.ts +11 -0
- package/dist/instrumentation/openai/index.js +79 -0
- package/dist/instrumentation/openai/index.js.map +1 -0
- package/dist/instrumentation/openai/wrapper.d.ts +80 -0
- package/dist/instrumentation/openai/wrapper.js +1121 -0
- package/dist/instrumentation/openai/wrapper.js.map +1 -0
- package/dist/instrumentation/openai-agents/index.d.ts +20 -0
- package/dist/instrumentation/openai-agents/index.js +174 -0
- package/dist/instrumentation/openai-agents/index.js.map +1 -0
- package/dist/instrumentation/openai-agents/processor.d.ts +35 -0
- package/dist/instrumentation/openai-agents/processor.js +249 -0
- package/dist/instrumentation/openai-agents/processor.js.map +1 -0
- package/dist/instrumentation/openai-agents/utils.d.ts +20 -0
- package/dist/instrumentation/openai-agents/utils.js +624 -0
- package/dist/instrumentation/openai-agents/utils.js.map +1 -0
- package/dist/instrumentation/pg/index.d.ts +20 -0
- package/dist/instrumentation/pg/index.js +74 -0
- package/dist/instrumentation/pg/index.js.map +1 -0
- package/dist/instrumentation/pg/wrapper.d.ts +66 -0
- package/dist/instrumentation/pg/wrapper.js +441 -0
- package/dist/instrumentation/pg/wrapper.js.map +1 -0
- package/dist/instrumentation/pinecone/index.d.ts +11 -0
- package/dist/instrumentation/pinecone/index.js +79 -0
- package/dist/instrumentation/pinecone/index.js.map +1 -0
- package/dist/instrumentation/pinecone/wrapper.d.ts +14 -0
- package/dist/instrumentation/pinecone/wrapper.js +198 -0
- package/dist/instrumentation/pinecone/wrapper.js.map +1 -0
- package/dist/instrumentation/qdrant/index.d.ts +11 -0
- package/dist/instrumentation/qdrant/index.js +67 -0
- package/dist/instrumentation/qdrant/index.js.map +1 -0
- package/dist/instrumentation/qdrant/wrapper.d.ts +14 -0
- package/dist/instrumentation/qdrant/wrapper.js +213 -0
- package/dist/instrumentation/qdrant/wrapper.js.map +1 -0
- package/dist/instrumentation/replicate/index.d.ts +11 -0
- package/dist/instrumentation/replicate/index.js +57 -0
- package/dist/instrumentation/replicate/index.js.map +1 -0
- package/dist/instrumentation/replicate/wrapper.d.ts +28 -0
- package/dist/instrumentation/replicate/wrapper.js +242 -0
- package/dist/instrumentation/replicate/wrapper.js.map +1 -0
- package/dist/instrumentation/strands/index.d.ts +21 -0
- package/dist/instrumentation/strands/index.js +83 -0
- package/dist/instrumentation/strands/index.js.map +1 -0
- package/dist/instrumentation/strands/processor.d.ts +51 -0
- package/dist/instrumentation/strands/processor.js +625 -0
- package/dist/instrumentation/strands/processor.js.map +1 -0
- package/dist/instrumentation/strands/utils.d.ts +24 -0
- package/dist/instrumentation/strands/utils.js +373 -0
- package/dist/instrumentation/strands/utils.js.map +1 -0
- package/dist/instrumentation/together/index.d.ts +11 -0
- package/dist/instrumentation/together/index.js +43 -0
- package/dist/instrumentation/together/index.js.map +1 -0
- package/dist/instrumentation/together/wrapper.d.ts +48 -0
- package/dist/instrumentation/together/wrapper.js +409 -0
- package/dist/instrumentation/together/wrapper.js.map +1 -0
- package/dist/instrumentation/transformers/index.d.ts +35 -0
- package/dist/instrumentation/transformers/index.js +119 -0
- package/dist/instrumentation/transformers/index.js.map +1 -0
- package/dist/instrumentation/transformers/wrapper.d.ts +49 -0
- package/dist/instrumentation/transformers/wrapper.js +472 -0
- package/dist/instrumentation/transformers/wrapper.js.map +1 -0
- package/dist/instrumentation/vercel-ai/index.d.ts +10 -0
- package/dist/instrumentation/vercel-ai/index.js +59 -0
- package/dist/instrumentation/vercel-ai/index.js.map +1 -0
- package/dist/instrumentation/vercel-ai/wrapper.d.ts +50 -0
- package/dist/instrumentation/vercel-ai/wrapper.js +539 -0
- package/dist/instrumentation/vercel-ai/wrapper.js.map +1 -0
- package/dist/instrumentation/vertexai/index.d.ts +11 -0
- package/dist/instrumentation/vertexai/index.js +70 -0
- package/dist/instrumentation/vertexai/index.js.map +1 -0
- package/dist/instrumentation/vertexai/wrapper.d.ts +67 -0
- package/dist/instrumentation/vertexai/wrapper.js +530 -0
- package/dist/instrumentation/vertexai/wrapper.js.map +1 -0
- package/dist/instrumentation/vllm/index.d.ts +13 -0
- package/dist/instrumentation/vllm/index.js +67 -0
- package/dist/instrumentation/vllm/index.js.map +1 -0
- package/dist/instrumentation/vllm/wrapper.d.ts +60 -0
- package/dist/instrumentation/vllm/wrapper.js +482 -0
- package/dist/instrumentation/vllm/wrapper.js.map +1 -0
- package/dist/llm/anthropic.d.ts +5 -0
- package/dist/llm/anthropic.js +39 -0
- package/dist/llm/anthropic.js.map +1 -0
- package/dist/llm/index.d.ts +10 -0
- package/dist/llm/index.js +93 -0
- package/dist/llm/index.js.map +1 -0
- package/dist/llm/openai.d.ts +6 -0
- package/dist/llm/openai.js +52 -0
- package/dist/llm/openai.js.map +1 -0
- package/dist/llm/providers.d.ts +7 -0
- package/dist/llm/providers.js +10 -0
- package/dist/llm/providers.js.map +1 -0
- package/dist/manual-trace.d.ts +40 -0
- package/dist/manual-trace.js +103 -0
- package/dist/manual-trace.js.map +1 -0
- package/dist/otel/__tests__/metrics.test.d.ts +1 -0
- package/dist/otel/__tests__/metrics.test.js +40 -0
- package/dist/otel/__tests__/metrics.test.js.map +1 -0
- package/dist/otel/events.d.ts +11 -0
- package/dist/otel/events.js +74 -0
- package/dist/otel/events.js.map +1 -0
- package/dist/otel/metrics.d.ts +35 -0
- package/dist/otel/metrics.js +219 -0
- package/dist/otel/metrics.js.map +1 -0
- package/dist/otel/tracing.d.ts +12 -0
- package/dist/otel/tracing.js +93 -0
- package/dist/otel/tracing.js.map +1 -0
- package/dist/otel/utils.d.ts +11 -0
- package/dist/otel/utils.js +34 -0
- package/dist/otel/utils.js.map +1 -0
- package/dist/pricing.json +951 -0
- package/dist/prompt-hub.d.ts +4 -0
- package/dist/prompt-hub.js +66 -0
- package/dist/prompt-hub.js.map +1 -0
- package/dist/register.d.ts +4 -0
- package/dist/register.js +52 -0
- package/dist/register.js.map +1 -0
- package/dist/score/__tests__/score.test.d.ts +1 -0
- package/dist/score/__tests__/score.test.js +143 -0
- package/dist/score/__tests__/score.test.js.map +1 -0
- package/dist/score/index.d.ts +2 -0
- package/dist/score/index.js +6 -0
- package/dist/score/index.js.map +1 -0
- package/dist/score/score.d.ts +15 -0
- package/dist/score/score.js +135 -0
- package/dist/score/score.js.map +1 -0
- package/dist/semantic-convention.d.ts +555 -0
- package/dist/semantic-convention.js +630 -0
- package/dist/semantic-convention.js.map +1 -0
- package/dist/types.d.ts +131 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/package.json +136 -0
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Cross-Language Trace Comparison Tests for Qdrant Integration
|
|
4
|
+
*
|
|
5
|
+
* Verifies TypeScript SDK trace attributes match Python SDK.
|
|
6
|
+
*
|
|
7
|
+
* Python SDK reference: sdk/python/src/shield360/instrumentation/qdrant/utils.py
|
|
8
|
+
*
|
|
9
|
+
* Key alignment:
|
|
10
|
+
* - db.system.name = 'qdrant'
|
|
11
|
+
* - db.operation.name: SEARCH, UPSERT, DELETE, GET
|
|
12
|
+
* - server.address, server.port (default localhost:6333)
|
|
13
|
+
* - db.vector.query.top_k for search
|
|
14
|
+
* - db.filter for filtered operations
|
|
15
|
+
* - db.vector.count for upsert
|
|
16
|
+
* - db.query.summary
|
|
17
|
+
*/
|
|
18
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
19
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
20
|
+
};
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
const wrapper_1 = __importDefault(require("../qdrant/wrapper"));
|
|
23
|
+
const config_1 = __importDefault(require("../../config"));
|
|
24
|
+
const helpers_1 = __importDefault(require("../../helpers"));
|
|
25
|
+
const semantic_convention_1 = __importDefault(require("../../semantic-convention"));
|
|
26
|
+
jest.mock('../../config');
|
|
27
|
+
jest.mock('../../helpers');
|
|
28
|
+
describe('Qdrant Cross-Language Trace Comparison', () => {
|
|
29
|
+
let mockSpan;
|
|
30
|
+
let mockTracer;
|
|
31
|
+
beforeEach(() => {
|
|
32
|
+
mockSpan = {
|
|
33
|
+
setAttribute: jest.fn(),
|
|
34
|
+
addEvent: jest.fn(),
|
|
35
|
+
end: jest.fn(),
|
|
36
|
+
setStatus: jest.fn(),
|
|
37
|
+
};
|
|
38
|
+
mockTracer = {
|
|
39
|
+
startSpan: jest.fn().mockReturnValue(mockSpan),
|
|
40
|
+
};
|
|
41
|
+
config_1.default.environment = 'shield360-testing';
|
|
42
|
+
config_1.default.applicationName = 'shield360-test';
|
|
43
|
+
config_1.default.captureMessageContent = true;
|
|
44
|
+
helpers_1.default.handleException = jest.fn();
|
|
45
|
+
});
|
|
46
|
+
afterEach(() => {
|
|
47
|
+
jest.clearAllMocks();
|
|
48
|
+
});
|
|
49
|
+
// ── Common attributes ────────────────────────────────────────────────────
|
|
50
|
+
it('should set db.system.name = "qdrant" matching Python DB_SYSTEM_QDRANT', async () => {
|
|
51
|
+
const patchFn = wrapper_1.default._patchSearch(mockTracer);
|
|
52
|
+
const originalMethod = jest.fn().mockResolvedValue([{ id: 1, score: 0.9 }]);
|
|
53
|
+
const wrapped = patchFn(originalMethod);
|
|
54
|
+
await wrapped.call({}, 'my_collection', { vector: [0.1, 0.2], limit: 5 });
|
|
55
|
+
expect(mockSpan.setAttribute).toHaveBeenCalledWith(semantic_convention_1.default.DB_SYSTEM_NAME, 'qdrant');
|
|
56
|
+
});
|
|
57
|
+
it('should set server.address = localhost and server.port = 6333 (Python defaults)', async () => {
|
|
58
|
+
const patchFn = wrapper_1.default._patchSearch(mockTracer);
|
|
59
|
+
const originalMethod = jest.fn().mockResolvedValue([]);
|
|
60
|
+
const wrapped = patchFn(originalMethod);
|
|
61
|
+
await wrapped.call({}, 'col', { vector: [0.1], limit: 5 });
|
|
62
|
+
expect(mockSpan.setAttribute).toHaveBeenCalledWith(semantic_convention_1.default.SERVER_ADDRESS, 'localhost');
|
|
63
|
+
expect(mockSpan.setAttribute).toHaveBeenCalledWith(semantic_convention_1.default.SERVER_PORT, 6333);
|
|
64
|
+
});
|
|
65
|
+
// ── search → SEARCH ───────────────────────────────────────────────────────
|
|
66
|
+
describe('search() → SEARCH (matches Python DB_OPERATION_SEARCH)', () => {
|
|
67
|
+
async function runSearch(collectionName, params, returnValue = []) {
|
|
68
|
+
const patchFn = wrapper_1.default._patchSearch(mockTracer);
|
|
69
|
+
const originalMethod = jest.fn().mockResolvedValue(returnValue);
|
|
70
|
+
const wrapped = patchFn(originalMethod);
|
|
71
|
+
await wrapped.call({}, collectionName, params);
|
|
72
|
+
}
|
|
73
|
+
it('should set db.operation.name = "SEARCH"', async () => {
|
|
74
|
+
await runSearch('my_col', { vector: [0.1, 0.2], limit: 10 });
|
|
75
|
+
expect(mockSpan.setAttribute).toHaveBeenCalledWith(semantic_convention_1.default.DB_OPERATION_NAME, 'SEARCH');
|
|
76
|
+
});
|
|
77
|
+
it('should set db.collection.name', async () => {
|
|
78
|
+
await runSearch('embeddings', { vector: [0.1], limit: 5 });
|
|
79
|
+
expect(mockSpan.setAttribute).toHaveBeenCalledWith(semantic_convention_1.default.DB_COLLECTION_NAME, 'embeddings');
|
|
80
|
+
});
|
|
81
|
+
it('should set db.vector.query.top_k from limit param', async () => {
|
|
82
|
+
await runSearch('col', { vector: [0.1], limit: 20 });
|
|
83
|
+
expect(mockSpan.setAttribute).toHaveBeenCalledWith(semantic_convention_1.default.DB_VECTOR_QUERY_TOP_K, 20);
|
|
84
|
+
});
|
|
85
|
+
it('should set db.filter when filter provided', async () => {
|
|
86
|
+
const filter = { must: [{ key: 'city', match: { value: 'Paris' } }] };
|
|
87
|
+
await runSearch('col', { vector: [0.1], limit: 5, filter });
|
|
88
|
+
expect(mockSpan.setAttribute).toHaveBeenCalledWith(semantic_convention_1.default.DB_FILTER, JSON.stringify(filter));
|
|
89
|
+
});
|
|
90
|
+
it('should set db.n_results to response array length', async () => {
|
|
91
|
+
await runSearch('col', { vector: [0.1], limit: 5 }, [
|
|
92
|
+
{ id: 1, score: 0.9 },
|
|
93
|
+
{ id: 2, score: 0.8 },
|
|
94
|
+
]);
|
|
95
|
+
expect(mockSpan.setAttribute).toHaveBeenCalledWith(semantic_convention_1.default.DB_N_RESULTS, 2);
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
// ── upsert → UPSERT ───────────────────────────────────────────────────────
|
|
99
|
+
describe('upsert() → UPSERT (matches Python DB_OPERATION_UPSERT)', () => {
|
|
100
|
+
async function runUpsert(collectionName, params) {
|
|
101
|
+
const patchFn = wrapper_1.default._patchUpsert(mockTracer);
|
|
102
|
+
const originalMethod = jest.fn().mockResolvedValue({ status: 'completed' });
|
|
103
|
+
const wrapped = patchFn(originalMethod);
|
|
104
|
+
await wrapped.call({}, collectionName, params);
|
|
105
|
+
}
|
|
106
|
+
it('should set db.operation.name = "UPSERT"', async () => {
|
|
107
|
+
await runUpsert('col', { points: [{ id: 1, vector: [0.1], payload: {} }] });
|
|
108
|
+
expect(mockSpan.setAttribute).toHaveBeenCalledWith(semantic_convention_1.default.DB_OPERATION_NAME, 'UPSERT');
|
|
109
|
+
});
|
|
110
|
+
it('should set db.vector.count from points length', async () => {
|
|
111
|
+
await runUpsert('col', {
|
|
112
|
+
points: [
|
|
113
|
+
{ id: 1, vector: [0.1] },
|
|
114
|
+
{ id: 2, vector: [0.2] },
|
|
115
|
+
{ id: 3, vector: [0.3] },
|
|
116
|
+
],
|
|
117
|
+
});
|
|
118
|
+
expect(mockSpan.setAttribute).toHaveBeenCalledWith(semantic_convention_1.default.DB_VECTOR_COUNT, 3);
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
// ── delete → DELETE ───────────────────────────────────────────────────────
|
|
122
|
+
describe('delete() → DELETE (matches Python DB_OPERATION_DELETE)', () => {
|
|
123
|
+
async function runDelete(collectionName, params) {
|
|
124
|
+
const patchFn = wrapper_1.default._patchDelete(mockTracer);
|
|
125
|
+
const originalMethod = jest.fn().mockResolvedValue({ status: 'completed' });
|
|
126
|
+
const wrapped = patchFn(originalMethod);
|
|
127
|
+
await wrapped.call({}, collectionName, params);
|
|
128
|
+
}
|
|
129
|
+
it('should set db.operation.name = "DELETE"', async () => {
|
|
130
|
+
await runDelete('col', { points: [1, 2] });
|
|
131
|
+
expect(mockSpan.setAttribute).toHaveBeenCalledWith(semantic_convention_1.default.DB_OPERATION_NAME, 'DELETE');
|
|
132
|
+
});
|
|
133
|
+
it('should set db.ids_count from points array', async () => {
|
|
134
|
+
await runDelete('col', { points: [1, 2, 3] });
|
|
135
|
+
expect(mockSpan.setAttribute).toHaveBeenCalledWith(semantic_convention_1.default.DB_ID_COUNT, 3);
|
|
136
|
+
});
|
|
137
|
+
it('should set db.filter when filter provided', async () => {
|
|
138
|
+
const filter = { must: [{ key: 'city', match: { value: 'London' } }] };
|
|
139
|
+
await runDelete('col', { filter });
|
|
140
|
+
expect(mockSpan.setAttribute).toHaveBeenCalledWith(semantic_convention_1.default.DB_FILTER, JSON.stringify(filter));
|
|
141
|
+
});
|
|
142
|
+
});
|
|
143
|
+
// ── retrieve → GET ────────────────────────────────────────────────────────
|
|
144
|
+
describe('retrieve() → GET (matches Python DB_OPERATION_GET)', () => {
|
|
145
|
+
it('should set db.operation.name = "GET"', async () => {
|
|
146
|
+
const patchFn = wrapper_1.default._patchRetrieve(mockTracer);
|
|
147
|
+
const originalMethod = jest.fn().mockResolvedValue([{ id: 1 }, { id: 2 }]);
|
|
148
|
+
const wrapped = patchFn(originalMethod);
|
|
149
|
+
await wrapped.call({}, 'col', { ids: [1, 2] });
|
|
150
|
+
expect(mockSpan.setAttribute).toHaveBeenCalledWith(semantic_convention_1.default.DB_OPERATION_NAME, 'GET');
|
|
151
|
+
});
|
|
152
|
+
it('should set db.ids_count and db.response.returned_rows', async () => {
|
|
153
|
+
const patchFn = wrapper_1.default._patchRetrieve(mockTracer);
|
|
154
|
+
const originalMethod = jest.fn().mockResolvedValue([{ id: 1 }, { id: 2 }]);
|
|
155
|
+
const wrapped = patchFn(originalMethod);
|
|
156
|
+
await wrapped.call({}, 'col', { ids: [1, 2] });
|
|
157
|
+
expect(mockSpan.setAttribute).toHaveBeenCalledWith(semantic_convention_1.default.DB_ID_COUNT, 2);
|
|
158
|
+
expect(mockSpan.setAttribute).toHaveBeenCalledWith(semantic_convention_1.default.DB_RESPONSE_RETURNED_ROWS, 2);
|
|
159
|
+
});
|
|
160
|
+
});
|
|
161
|
+
// ── scroll → GET ─────────────────────────────────────────────────────────
|
|
162
|
+
describe('scroll() → GET (matches Python DB_OPERATION_GET)', () => {
|
|
163
|
+
it('should set db.operation.name = "GET"', async () => {
|
|
164
|
+
const patchFn = wrapper_1.default._patchScroll(mockTracer);
|
|
165
|
+
const originalMethod = jest.fn().mockResolvedValue({ points: [{ id: 1 }, { id: 2 }] });
|
|
166
|
+
const wrapped = patchFn(originalMethod);
|
|
167
|
+
await wrapped.call({}, 'col', { limit: 100 });
|
|
168
|
+
expect(mockSpan.setAttribute).toHaveBeenCalledWith(semantic_convention_1.default.DB_OPERATION_NAME, 'GET');
|
|
169
|
+
});
|
|
170
|
+
});
|
|
171
|
+
// ── Error handling ────────────────────────────────────────────────────────
|
|
172
|
+
it('should call handleException and end span on error', async () => {
|
|
173
|
+
const patchFn = wrapper_1.default._patchSearch(mockTracer);
|
|
174
|
+
const error = new Error('Qdrant connection refused');
|
|
175
|
+
const originalMethod = jest.fn().mockRejectedValue(error);
|
|
176
|
+
const wrapped = patchFn(originalMethod);
|
|
177
|
+
await expect(wrapped.call({}, 'col', { vector: [0.1], limit: 5 })).rejects.toThrow();
|
|
178
|
+
expect(helpers_1.default.handleException).toHaveBeenCalledWith(mockSpan, error);
|
|
179
|
+
expect(mockSpan.end).toHaveBeenCalled();
|
|
180
|
+
});
|
|
181
|
+
});
|
|
182
|
+
//# sourceMappingURL=qdrant-trace-comparison.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"qdrant-trace-comparison.test.js","sourceRoot":"","sources":["../../../src/instrumentation/__tests__/qdrant-trace-comparison.test.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;;;AAEH,gEAA8C;AAC9C,0DAA2C;AAC3C,4DAA4C;AAC5C,oFAA2D;AAE3D,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;AAC1B,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;AAE3B,QAAQ,CAAC,wCAAwC,EAAE,GAAG,EAAE;IACtD,IAAI,QAAa,CAAC;IAClB,IAAI,UAAe,CAAC;IAEpB,UAAU,CAAC,GAAG,EAAE;QACd,QAAQ,GAAG;YACT,YAAY,EAAE,IAAI,CAAC,EAAE,EAAE;YACvB,QAAQ,EAAE,IAAI,CAAC,EAAE,EAAE;YACnB,GAAG,EAAE,IAAI,CAAC,EAAE,EAAE;YACd,SAAS,EAAE,IAAI,CAAC,EAAE,EAAE;SACrB,CAAC;QAEF,UAAU,GAAG;YACX,SAAS,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,eAAe,CAAC,QAAQ,CAAC;SAC/C,CAAC;QAED,gBAAuB,CAAC,WAAW,GAAG,mBAAmB,CAAC;QAC1D,gBAAuB,CAAC,eAAe,GAAG,gBAAgB,CAAC;QAC3D,gBAAuB,CAAC,qBAAqB,GAAG,IAAI,CAAC;QACrD,iBAAuB,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,iBAAa,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;QACvD,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;QACrD,MAAM,cAAc,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;QAC1D,MAAM,OAAO,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;QAExC,MAAM,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;QACrF,MAAM,CAAC,iBAAe,CAAC,eAAe,CAAC,CAAC,oBAAoB,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;QAC9E,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,gBAAgB,EAAE,CAAC;IAC1C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Trace Comparison Tests for Replicate Integration
|
|
4
|
+
*
|
|
5
|
+
* Verifies that the TypeScript SDK generates consistent traces for
|
|
6
|
+
* Replicate model runs, aligned with OTel semantic conventions and
|
|
7
|
+
* the OpenAI reference implementation pattern.
|
|
8
|
+
*/
|
|
9
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
10
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
const wrapper_1 = __importDefault(require("../replicate/wrapper"));
|
|
14
|
+
const config_1 = __importDefault(require("../../config"));
|
|
15
|
+
const helpers_1 = __importDefault(require("../../helpers"));
|
|
16
|
+
const base_wrapper_1 = __importDefault(require("../base-wrapper"));
|
|
17
|
+
const semantic_convention_1 = __importDefault(require("../../semantic-convention"));
|
|
18
|
+
jest.mock('../../config');
|
|
19
|
+
jest.mock('../../helpers');
|
|
20
|
+
jest.mock('../base-wrapper');
|
|
21
|
+
describe('Replicate Trace Comparison', () => {
|
|
22
|
+
let mockSpan;
|
|
23
|
+
beforeEach(() => {
|
|
24
|
+
mockSpan = {
|
|
25
|
+
setAttribute: jest.fn(),
|
|
26
|
+
addEvent: jest.fn(),
|
|
27
|
+
end: jest.fn(),
|
|
28
|
+
setStatus: jest.fn(),
|
|
29
|
+
};
|
|
30
|
+
config_1.default.environment = 'shield360-testing';
|
|
31
|
+
config_1.default.applicationName = 'shield360-test';
|
|
32
|
+
config_1.default.captureMessageContent = true;
|
|
33
|
+
config_1.default.pricingInfo = {};
|
|
34
|
+
config_1.default.disableEvents = false;
|
|
35
|
+
helpers_1.default.getChatModelCost = jest.fn().mockReturnValue(0.001);
|
|
36
|
+
helpers_1.default.generalTokens = jest.fn().mockReturnValue(10);
|
|
37
|
+
helpers_1.default.handleException = jest.fn();
|
|
38
|
+
helpers_1.default.buildInputMessages = jest.fn().mockReturnValue('[{"role":"user","parts":[{"type":"text","content":"What is the capital of France?"}]}]');
|
|
39
|
+
helpers_1.default.buildOutputMessages = jest.fn().mockReturnValue('[{"role":"assistant","parts":[{"type":"text","content":"Paris."}],"finish_reason":"stop"}]');
|
|
40
|
+
helpers_1.default.emitInferenceEvent = jest.fn();
|
|
41
|
+
base_wrapper_1.default.recordMetrics = jest.fn();
|
|
42
|
+
base_wrapper_1.default.setBaseSpanAttributes = jest.fn().mockImplementation((span, attrs) => {
|
|
43
|
+
span.setAttribute(semantic_convention_1.default.GEN_AI_PROVIDER_NAME_OTEL, attrs.aiSystem);
|
|
44
|
+
span.setAttribute(semantic_convention_1.default.GEN_AI_REQUEST_MODEL, attrs.model);
|
|
45
|
+
if (attrs.cost !== undefined) {
|
|
46
|
+
span.setAttribute(semantic_convention_1.default.GEN_AI_USAGE_COST, attrs.cost);
|
|
47
|
+
}
|
|
48
|
+
if (attrs.serverAddress) {
|
|
49
|
+
span.setAttribute(semantic_convention_1.default.SERVER_ADDRESS, attrs.serverAddress);
|
|
50
|
+
}
|
|
51
|
+
if (attrs.serverPort !== undefined) {
|
|
52
|
+
span.setAttribute(semantic_convention_1.default.SERVER_PORT, attrs.serverPort);
|
|
53
|
+
}
|
|
54
|
+
span.setAttribute(semantic_convention_1.default.GEN_AI_SDK_VERSION, '1.9.0');
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
afterEach(() => {
|
|
58
|
+
jest.clearAllMocks();
|
|
59
|
+
});
|
|
60
|
+
describe('run() — core attributes', () => {
|
|
61
|
+
const identifier = 'meta/llama-2-70b-chat';
|
|
62
|
+
const mockArgs = [
|
|
63
|
+
identifier,
|
|
64
|
+
{ input: { prompt: 'What is the capital of France?' } },
|
|
65
|
+
];
|
|
66
|
+
it('should set gen_ai.provider.name = "replicate"', async () => {
|
|
67
|
+
await wrapper_1.default._run({
|
|
68
|
+
args: mockArgs,
|
|
69
|
+
genAIEndpoint: 'replicate.run',
|
|
70
|
+
response: 'Paris.',
|
|
71
|
+
span: mockSpan,
|
|
72
|
+
});
|
|
73
|
+
expect(mockSpan.setAttribute).toHaveBeenCalledWith(semantic_convention_1.default.GEN_AI_PROVIDER_NAME_OTEL, 'replicate');
|
|
74
|
+
});
|
|
75
|
+
it('should set gen_ai.request.model stripped of version hash', async () => {
|
|
76
|
+
await wrapper_1.default._run({
|
|
77
|
+
args: mockArgs,
|
|
78
|
+
genAIEndpoint: 'replicate.run',
|
|
79
|
+
response: 'Paris.',
|
|
80
|
+
span: mockSpan,
|
|
81
|
+
});
|
|
82
|
+
expect(mockSpan.setAttribute).toHaveBeenCalledWith(semantic_convention_1.default.GEN_AI_REQUEST_MODEL, 'meta/llama-2-70b-chat');
|
|
83
|
+
});
|
|
84
|
+
it('should strip version hash from identifier with colon', async () => {
|
|
85
|
+
const argsWithVersion = [
|
|
86
|
+
'stability-ai/sdxl:abc123def456',
|
|
87
|
+
{ input: { prompt: 'A sunset over mountains' } },
|
|
88
|
+
];
|
|
89
|
+
await wrapper_1.default._run({
|
|
90
|
+
args: argsWithVersion,
|
|
91
|
+
genAIEndpoint: 'replicate.run',
|
|
92
|
+
response: ['https://example.com/image.png'],
|
|
93
|
+
span: mockSpan,
|
|
94
|
+
});
|
|
95
|
+
expect(mockSpan.setAttribute).toHaveBeenCalledWith(semantic_convention_1.default.GEN_AI_REQUEST_MODEL, 'stability-ai/sdxl');
|
|
96
|
+
});
|
|
97
|
+
it('should set gen_ai.response.model', async () => {
|
|
98
|
+
await wrapper_1.default._run({
|
|
99
|
+
args: mockArgs,
|
|
100
|
+
genAIEndpoint: 'replicate.run',
|
|
101
|
+
response: 'Paris.',
|
|
102
|
+
span: mockSpan,
|
|
103
|
+
});
|
|
104
|
+
expect(mockSpan.setAttribute).toHaveBeenCalledWith(semantic_convention_1.default.GEN_AI_RESPONSE_MODEL, 'meta/llama-2-70b-chat');
|
|
105
|
+
});
|
|
106
|
+
it('should set gen_ai.request.is_stream = false', async () => {
|
|
107
|
+
await wrapper_1.default._run({
|
|
108
|
+
args: mockArgs,
|
|
109
|
+
genAIEndpoint: 'replicate.run',
|
|
110
|
+
response: 'Paris.',
|
|
111
|
+
span: mockSpan,
|
|
112
|
+
});
|
|
113
|
+
expect(mockSpan.setAttribute).toHaveBeenCalledWith(semantic_convention_1.default.GEN_AI_REQUEST_IS_STREAM, false);
|
|
114
|
+
});
|
|
115
|
+
it('should set gen_ai.response.finish_reasons = ["stop"]', async () => {
|
|
116
|
+
await wrapper_1.default._run({
|
|
117
|
+
args: mockArgs,
|
|
118
|
+
genAIEndpoint: 'replicate.run',
|
|
119
|
+
response: 'Paris.',
|
|
120
|
+
span: mockSpan,
|
|
121
|
+
});
|
|
122
|
+
expect(mockSpan.setAttribute).toHaveBeenCalledWith(semantic_convention_1.default.GEN_AI_RESPONSE_FINISH_REASON, ['stop']);
|
|
123
|
+
});
|
|
124
|
+
it('should set server.address and server.port', async () => {
|
|
125
|
+
await wrapper_1.default._run({
|
|
126
|
+
args: mockArgs,
|
|
127
|
+
genAIEndpoint: 'replicate.run',
|
|
128
|
+
response: 'Paris.',
|
|
129
|
+
span: mockSpan,
|
|
130
|
+
});
|
|
131
|
+
expect(mockSpan.setAttribute).toHaveBeenCalledWith(semantic_convention_1.default.SERVER_ADDRESS, 'api.replicate.com');
|
|
132
|
+
expect(mockSpan.setAttribute).toHaveBeenCalledWith(semantic_convention_1.default.SERVER_PORT, 443);
|
|
133
|
+
});
|
|
134
|
+
it('should set token usage attributes', async () => {
|
|
135
|
+
await wrapper_1.default._run({
|
|
136
|
+
args: mockArgs,
|
|
137
|
+
genAIEndpoint: 'replicate.run',
|
|
138
|
+
response: 'Paris.',
|
|
139
|
+
span: mockSpan,
|
|
140
|
+
});
|
|
141
|
+
expect(mockSpan.setAttribute).toHaveBeenCalledWith(semantic_convention_1.default.GEN_AI_USAGE_INPUT_TOKENS, 10);
|
|
142
|
+
expect(mockSpan.setAttribute).toHaveBeenCalledWith(semantic_convention_1.default.GEN_AI_USAGE_OUTPUT_TOKENS, 10);
|
|
143
|
+
});
|
|
144
|
+
});
|
|
145
|
+
describe('run() — output types', () => {
|
|
146
|
+
const mockArgs = [
|
|
147
|
+
'meta/llama-2-70b-chat',
|
|
148
|
+
{ input: { prompt: 'What is the capital of France?' } },
|
|
149
|
+
];
|
|
150
|
+
it('should set output_type=text for string responses', async () => {
|
|
151
|
+
await wrapper_1.default._run({
|
|
152
|
+
args: mockArgs,
|
|
153
|
+
genAIEndpoint: 'replicate.run',
|
|
154
|
+
response: 'Paris.',
|
|
155
|
+
span: mockSpan,
|
|
156
|
+
});
|
|
157
|
+
expect(mockSpan.setAttribute).toHaveBeenCalledWith(semantic_convention_1.default.GEN_AI_OUTPUT_TYPE, semantic_convention_1.default.GEN_AI_OUTPUT_TYPE_TEXT);
|
|
158
|
+
});
|
|
159
|
+
it('should set output_type=text for array responses (text chunks)', async () => {
|
|
160
|
+
await wrapper_1.default._run({
|
|
161
|
+
args: mockArgs,
|
|
162
|
+
genAIEndpoint: 'replicate.run',
|
|
163
|
+
response: ['Par', 'is', '.'],
|
|
164
|
+
span: mockSpan,
|
|
165
|
+
});
|
|
166
|
+
expect(mockSpan.setAttribute).toHaveBeenCalledWith(semantic_convention_1.default.GEN_AI_OUTPUT_TYPE, semantic_convention_1.default.GEN_AI_OUTPUT_TYPE_TEXT);
|
|
167
|
+
});
|
|
168
|
+
it('should set output_type=json for object responses', async () => {
|
|
169
|
+
await wrapper_1.default._run({
|
|
170
|
+
args: mockArgs,
|
|
171
|
+
genAIEndpoint: 'replicate.run',
|
|
172
|
+
response: { answer: 'Paris', confidence: 0.99 },
|
|
173
|
+
span: mockSpan,
|
|
174
|
+
});
|
|
175
|
+
expect(mockSpan.setAttribute).toHaveBeenCalledWith(semantic_convention_1.default.GEN_AI_OUTPUT_TYPE, semantic_convention_1.default.GEN_AI_OUTPUT_TYPE_JSON);
|
|
176
|
+
});
|
|
177
|
+
});
|
|
178
|
+
describe('run() — no sentinel values', () => {
|
|
179
|
+
it('should NOT set total_tokens or client.token.usage on span', async () => {
|
|
180
|
+
const mockArgs = [
|
|
181
|
+
'meta/llama-2-70b-chat',
|
|
182
|
+
{ input: { prompt: 'Test' } },
|
|
183
|
+
];
|
|
184
|
+
await wrapper_1.default._run({
|
|
185
|
+
args: mockArgs,
|
|
186
|
+
genAIEndpoint: 'replicate.run',
|
|
187
|
+
response: 'Response',
|
|
188
|
+
span: mockSpan,
|
|
189
|
+
});
|
|
190
|
+
const setAttributeCalls = mockSpan.setAttribute.mock.calls;
|
|
191
|
+
const attributeKeys = setAttributeCalls.map(([key]) => key);
|
|
192
|
+
expect(attributeKeys).not.toContain(semantic_convention_1.default.GEN_AI_USAGE_TOTAL_TOKENS);
|
|
193
|
+
expect(attributeKeys).not.toContain(semantic_convention_1.default.GEN_AI_CLIENT_TOKEN_USAGE);
|
|
194
|
+
});
|
|
195
|
+
});
|
|
196
|
+
describe('run() — content capture', () => {
|
|
197
|
+
const mockArgs = [
|
|
198
|
+
'meta/llama-2-70b-chat',
|
|
199
|
+
{ input: { prompt: 'What is the capital of France?' } },
|
|
200
|
+
];
|
|
201
|
+
it('should capture input/output messages when captureMessageContent=true', async () => {
|
|
202
|
+
config_1.default.captureMessageContent = true;
|
|
203
|
+
await wrapper_1.default._run({
|
|
204
|
+
args: mockArgs,
|
|
205
|
+
genAIEndpoint: 'replicate.run',
|
|
206
|
+
response: 'Paris.',
|
|
207
|
+
span: mockSpan,
|
|
208
|
+
});
|
|
209
|
+
expect(helpers_1.default.buildInputMessages).toHaveBeenCalled();
|
|
210
|
+
expect(helpers_1.default.buildOutputMessages).toHaveBeenCalled();
|
|
211
|
+
expect(mockSpan.setAttribute).toHaveBeenCalledWith(semantic_convention_1.default.GEN_AI_INPUT_MESSAGES, expect.any(String));
|
|
212
|
+
expect(mockSpan.setAttribute).toHaveBeenCalledWith(semantic_convention_1.default.GEN_AI_OUTPUT_MESSAGES, expect.any(String));
|
|
213
|
+
});
|
|
214
|
+
it('should NOT capture messages when captureMessageContent=false', async () => {
|
|
215
|
+
config_1.default.captureMessageContent = false;
|
|
216
|
+
await wrapper_1.default._run({
|
|
217
|
+
args: mockArgs,
|
|
218
|
+
genAIEndpoint: 'replicate.run',
|
|
219
|
+
response: 'Paris.',
|
|
220
|
+
span: mockSpan,
|
|
221
|
+
});
|
|
222
|
+
const setAttributeCalls = mockSpan.setAttribute.mock.calls;
|
|
223
|
+
const attributeKeys = setAttributeCalls.map(([key]) => key);
|
|
224
|
+
expect(attributeKeys).not.toContain(semantic_convention_1.default.GEN_AI_INPUT_MESSAGES);
|
|
225
|
+
expect(attributeKeys).not.toContain(semantic_convention_1.default.GEN_AI_OUTPUT_MESSAGES);
|
|
226
|
+
});
|
|
227
|
+
});
|
|
228
|
+
describe('run() — events', () => {
|
|
229
|
+
const mockArgs = [
|
|
230
|
+
'meta/llama-2-70b-chat',
|
|
231
|
+
{ input: { prompt: 'Test' } },
|
|
232
|
+
];
|
|
233
|
+
it('should emit inference event via LoggerProvider', async () => {
|
|
234
|
+
await wrapper_1.default._run({
|
|
235
|
+
args: mockArgs,
|
|
236
|
+
genAIEndpoint: 'replicate.run',
|
|
237
|
+
response: 'Response',
|
|
238
|
+
span: mockSpan,
|
|
239
|
+
});
|
|
240
|
+
expect(helpers_1.default.emitInferenceEvent).toHaveBeenCalledWith(mockSpan, expect.objectContaining({
|
|
241
|
+
[semantic_convention_1.default.GEN_AI_OPERATION]: semantic_convention_1.default.GEN_AI_OPERATION_TYPE_TEXT_COMPLETION,
|
|
242
|
+
[semantic_convention_1.default.GEN_AI_REQUEST_MODEL]: 'meta/llama-2-70b-chat',
|
|
243
|
+
[semantic_convention_1.default.GEN_AI_RESPONSE_MODEL]: 'meta/llama-2-70b-chat',
|
|
244
|
+
[semantic_convention_1.default.SERVER_ADDRESS]: 'api.replicate.com',
|
|
245
|
+
[semantic_convention_1.default.SERVER_PORT]: 443,
|
|
246
|
+
[semantic_convention_1.default.GEN_AI_RESPONSE_FINISH_REASON]: ['stop'],
|
|
247
|
+
[semantic_convention_1.default.GEN_AI_USAGE_INPUT_TOKENS]: 10,
|
|
248
|
+
[semantic_convention_1.default.GEN_AI_USAGE_OUTPUT_TOKENS]: 10,
|
|
249
|
+
}));
|
|
250
|
+
});
|
|
251
|
+
it('should include message content in event when captureMessageContent=true', async () => {
|
|
252
|
+
config_1.default.captureMessageContent = true;
|
|
253
|
+
await wrapper_1.default._run({
|
|
254
|
+
args: mockArgs,
|
|
255
|
+
genAIEndpoint: 'replicate.run',
|
|
256
|
+
response: 'Response',
|
|
257
|
+
span: mockSpan,
|
|
258
|
+
});
|
|
259
|
+
expect(helpers_1.default.emitInferenceEvent).toHaveBeenCalledWith(mockSpan, expect.objectContaining({
|
|
260
|
+
[semantic_convention_1.default.GEN_AI_INPUT_MESSAGES]: expect.any(String),
|
|
261
|
+
[semantic_convention_1.default.GEN_AI_OUTPUT_MESSAGES]: expect.any(String),
|
|
262
|
+
}));
|
|
263
|
+
});
|
|
264
|
+
it('should NOT include message content in event when captureMessageContent=false', async () => {
|
|
265
|
+
config_1.default.captureMessageContent = false;
|
|
266
|
+
await wrapper_1.default._run({
|
|
267
|
+
args: mockArgs,
|
|
268
|
+
genAIEndpoint: 'replicate.run',
|
|
269
|
+
response: 'Response',
|
|
270
|
+
span: mockSpan,
|
|
271
|
+
});
|
|
272
|
+
const eventCall = helpers_1.default.emitInferenceEvent.mock.calls[0];
|
|
273
|
+
const eventAttrs = eventCall[1];
|
|
274
|
+
expect(eventAttrs).not.toHaveProperty(semantic_convention_1.default.GEN_AI_INPUT_MESSAGES);
|
|
275
|
+
expect(eventAttrs).not.toHaveProperty(semantic_convention_1.default.GEN_AI_OUTPUT_MESSAGES);
|
|
276
|
+
});
|
|
277
|
+
it('should NOT emit events when disableEvents=true', async () => {
|
|
278
|
+
config_1.default.disableEvents = true;
|
|
279
|
+
await wrapper_1.default._run({
|
|
280
|
+
args: mockArgs,
|
|
281
|
+
genAIEndpoint: 'replicate.run',
|
|
282
|
+
response: 'Response',
|
|
283
|
+
span: mockSpan,
|
|
284
|
+
});
|
|
285
|
+
expect(helpers_1.default.emitInferenceEvent).not.toHaveBeenCalled();
|
|
286
|
+
});
|
|
287
|
+
});
|
|
288
|
+
describe('run() — metrics', () => {
|
|
289
|
+
it('should record metrics via BaseWrapper.recordMetrics', async () => {
|
|
290
|
+
const mockArgs = [
|
|
291
|
+
'meta/llama-2-70b-chat',
|
|
292
|
+
{ input: { prompt: 'Test' } },
|
|
293
|
+
];
|
|
294
|
+
await wrapper_1.default._run({
|
|
295
|
+
args: mockArgs,
|
|
296
|
+
genAIEndpoint: 'replicate.run',
|
|
297
|
+
response: 'Response',
|
|
298
|
+
span: mockSpan,
|
|
299
|
+
});
|
|
300
|
+
expect(base_wrapper_1.default.recordMetrics).toHaveBeenCalledWith(mockSpan, expect.objectContaining({
|
|
301
|
+
genAIEndpoint: 'replicate.run',
|
|
302
|
+
model: 'meta/llama-2-70b-chat',
|
|
303
|
+
aiSystem: 'replicate',
|
|
304
|
+
}));
|
|
305
|
+
});
|
|
306
|
+
it('should use Shield360Config.pricingInfo for cost calculation', async () => {
|
|
307
|
+
config_1.default.pricingInfo = { chat: { 'meta/llama-2-70b-chat': { promptPrice: 0.05, completionPrice: 0.08 } } };
|
|
308
|
+
const mockArgs = [
|
|
309
|
+
'meta/llama-2-70b-chat',
|
|
310
|
+
{ input: { prompt: 'Test' } },
|
|
311
|
+
];
|
|
312
|
+
await wrapper_1.default._run({
|
|
313
|
+
args: mockArgs,
|
|
314
|
+
genAIEndpoint: 'replicate.run',
|
|
315
|
+
response: 'Response',
|
|
316
|
+
span: mockSpan,
|
|
317
|
+
});
|
|
318
|
+
expect(helpers_1.default.getChatModelCost).toHaveBeenCalledWith('meta/llama-2-70b-chat', expect.any(Object), 10, 10);
|
|
319
|
+
});
|
|
320
|
+
it('should end span and record metrics', async () => {
|
|
321
|
+
const mockArgs = [
|
|
322
|
+
'meta/llama-2-70b-chat',
|
|
323
|
+
{ input: { prompt: 'Test' } },
|
|
324
|
+
];
|
|
325
|
+
await wrapper_1.default._run({
|
|
326
|
+
args: mockArgs,
|
|
327
|
+
genAIEndpoint: 'replicate.run',
|
|
328
|
+
response: 'Response',
|
|
329
|
+
span: mockSpan,
|
|
330
|
+
});
|
|
331
|
+
expect(mockSpan.end).toHaveBeenCalled();
|
|
332
|
+
expect(base_wrapper_1.default.recordMetrics).toHaveBeenCalled();
|
|
333
|
+
});
|
|
334
|
+
});
|
|
335
|
+
describe('Span Creation Attributes', () => {
|
|
336
|
+
it('should use aiSystem from SemanticConvention.GEN_AI_SYSTEM_REPLICATE', () => {
|
|
337
|
+
expect(wrapper_1.default.aiSystem).toBe(semantic_convention_1.default.GEN_AI_SYSTEM_REPLICATE);
|
|
338
|
+
expect(wrapper_1.default.aiSystem).toBe('replicate');
|
|
339
|
+
});
|
|
340
|
+
it('should set correct server address and port', () => {
|
|
341
|
+
expect(wrapper_1.default.serverAddress).toBe('api.replicate.com');
|
|
342
|
+
expect(wrapper_1.default.serverPort).toBe(443);
|
|
343
|
+
});
|
|
344
|
+
});
|
|
345
|
+
});
|
|
346
|
+
//# sourceMappingURL=replicate-trace-comparison.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replicate-trace-comparison.test.js","sourceRoot":"","sources":["../../../src/instrumentation/__tests__/replicate-trace-comparison.test.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;AAEH,mEAAoD;AACpD,0DAA2C;AAC3C,4DAA4C;AAC5C,mEAA0C;AAC1C,oFAA2D;AAE3D,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;AAC1B,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;AAC3B,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;AAE7B,QAAQ,CAAC,4BAA4B,EAAE,GAAG,EAAE;IAC1C,IAAI,QAAa,CAAC;IAElB,UAAU,CAAC,GAAG,EAAE;QACd,QAAQ,GAAG;YACT,YAAY,EAAE,IAAI,CAAC,EAAE,EAAE;YACvB,QAAQ,EAAE,IAAI,CAAC,EAAE,EAAE;YACnB,GAAG,EAAE,IAAI,CAAC,EAAE,EAAE;YACd,SAAS,EAAE,IAAI,CAAC,EAAE,EAAE;SACrB,CAAC;QAED,gBAAuB,CAAC,WAAW,GAAG,mBAAmB,CAAC;QAC1D,gBAAuB,CAAC,eAAe,GAAG,gBAAgB,CAAC;QAC3D,gBAAuB,CAAC,qBAAqB,GAAG,IAAI,CAAC;QACrD,gBAAuB,CAAC,WAAW,GAAG,EAAE,CAAC;QACzC,gBAAuB,CAAC,aAAa,GAAG,KAAK,CAAC;QAE9C,iBAAuB,CAAC,gBAAgB,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;QAC5E,iBAAuB,CAAC,aAAa,GAAG,IAAI,CAAC,EAAE,EA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