@smythos/sre 1.7.17 → 1.7.18
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/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import dotenv from"dotenv";import Joi from"joi";import pLimit from"p-limit";import axios,{AxiosHeaders}from"axios";import*as fs from"fs";import fs__default,{existsSync,mkdirSync,writeFileSync,readFileSync,unlinkSync}from"fs";import*as FileType from"file-type";import{fileTypeFromBuffer}from"file-type";import{isBinaryFileSync}from"isbinaryfile";import*as readlineSync from"readline-sync";import{stdin,stdout}from"process";import"dotenv/config";import winston from"winston";import Transport from"winston-transport";import EventEmitter$1,{EventEmitter}from"events";import crypto$1,{createHash,randomUUID,createHmac,timingSafeEqual}from"crypto";import path from"path";import os from"os";import mime from"mime";import{encodeChat,encode}from"gpt-tokenizer";import{Readable}from"stream";import{jsonrepair}from"jsonrepair";import xxhash from"xxhashjs";import yaml from"js-yaml";import{EventSource}from"eventsource";import*as acorn from"acorn";import dayjs from"dayjs";import querystring from"querystring";import{HfInference}from"@huggingface/inference";import{Runware}from"@runware/sdk-js";import FormData from"form-data";import{SocksProxyAgent}from"socks-proxy-agent";import OAuth from"oauth-1.0a";import zl from"zip-lib";import{LambdaClient,GetFunctionCommand,UpdateFunctionCodeCommand,Runtime,InvokeCommand,UpdateFunctionConfigurationCommand,CreateFunctionCommand}from"@aws-sdk/client-lambda";import{IAMClient,GetRoleCommand,CreateRoleCommand}from"@aws-sdk/client-iam";import{Client}from"@modelcontextprotocol/sdk/client/index.js";import{SSEClientTransport}from"@modelcontextprotocol/sdk/client/sse.js";import{StreamableHTTPClientTransport}from"@modelcontextprotocol/sdk/client/streamableHttp.js";import{findAll,isTag,removeElement,innerText}from"domutils";import{parseDocument}from"htmlparser2";import{GetBucketLifecycleConfigurationCommand,PutBucketLifecycleConfigurationCommand,S3Client,HeadObjectCommand,DeleteObjectCommand,GetObjectCommand,PutObjectCommand,PutObjectTaggingCommand,GetObjectTaggingCommand,CopyObjectCommand}from"@aws-sdk/client-s3";import{createServer}from"http";import{WebSocketServer}from"ws";import"ses";import imageSize from"image-size";import{execSync}from"child_process";import{Pinecone}from"@pinecone-database/pinecone";import OpenAI,{toFile,OpenAI as OpenAI$1}from"openai";import{GoogleGenAI as GoogleGenAI$1}from"@google/genai";import{MilvusClient,DataType,ErrorCode}from"@zilliz/milvus2-sdk-node";import{GoogleGenAI,FunctionCallingConfigMode,FileState}from"@google/genai/node";import Anthropic from"@anthropic-ai/sdk";import Groq from"groq-sdk";import{BedrockRuntimeClient,ConverseCommand,ConverseStreamCommand}from"@aws-sdk/client-bedrock-runtime";import{VertexAI}from"@google-cloud/vertexai";import{Ollama}from"ollama";import*as chokidar from"chokidar";import chokidar__default from"chokidar";import fs$1 from"fs/promises";import IORedis from"ioredis";import{trace,context,SpanStatusCode}from"@opentelemetry/api";import{logs,SeverityNumber}from"@opentelemetry/api-logs";import{resourceFromAttributes}from"@opentelemetry/resources";import{ATTR_SERVICE_VERSION,ATTR_SERVICE_NAME}from"@opentelemetry/semantic-conventions";import{BatchSpanProcessor,NodeTracerProvider}from"@opentelemetry/sdk-trace-node";import{OTLPTraceExporter}from"@opentelemetry/exporter-trace-otlp-http";import{BatchLogRecordProcessor,LoggerProvider}from"@opentelemetry/sdk-logs";import{OTLPLogExporter}from"@opentelemetry/exporter-logs-otlp-http";import mysql from"mysql2/promise";import{SecretsManagerClient,ListSecretsCommand,GetSecretValueCommand,PutSecretValueCommand,CreateSecretCommand,DeleteSecretCommand}from"@aws-sdk/client-secrets-manager";var version="1.7.
|
|
1
|
+
import dotenv from"dotenv";import Joi from"joi";import pLimit from"p-limit";import axios,{AxiosHeaders}from"axios";import*as fs from"fs";import fs__default,{existsSync,mkdirSync,writeFileSync,readFileSync,unlinkSync}from"fs";import*as FileType from"file-type";import{fileTypeFromBuffer}from"file-type";import{isBinaryFileSync}from"isbinaryfile";import*as readlineSync from"readline-sync";import{stdin,stdout}from"process";import"dotenv/config";import winston from"winston";import Transport from"winston-transport";import EventEmitter$1,{EventEmitter}from"events";import crypto$1,{createHash,randomUUID,createHmac,timingSafeEqual}from"crypto";import path from"path";import os from"os";import mime from"mime";import{encodeChat,encode}from"gpt-tokenizer";import{Readable}from"stream";import{jsonrepair}from"jsonrepair";import xxhash from"xxhashjs";import yaml from"js-yaml";import{EventSource}from"eventsource";import*as acorn from"acorn";import dayjs from"dayjs";import querystring from"querystring";import{HfInference}from"@huggingface/inference";import{Runware}from"@runware/sdk-js";import FormData from"form-data";import{SocksProxyAgent}from"socks-proxy-agent";import OAuth from"oauth-1.0a";import zl from"zip-lib";import{LambdaClient,GetFunctionCommand,UpdateFunctionCodeCommand,Runtime,InvokeCommand,UpdateFunctionConfigurationCommand,CreateFunctionCommand}from"@aws-sdk/client-lambda";import{IAMClient,GetRoleCommand,CreateRoleCommand}from"@aws-sdk/client-iam";import{Client}from"@modelcontextprotocol/sdk/client/index.js";import{SSEClientTransport}from"@modelcontextprotocol/sdk/client/sse.js";import{StreamableHTTPClientTransport}from"@modelcontextprotocol/sdk/client/streamableHttp.js";import{findAll,isTag,removeElement,innerText}from"domutils";import{parseDocument}from"htmlparser2";import{GetBucketLifecycleConfigurationCommand,PutBucketLifecycleConfigurationCommand,S3Client,HeadObjectCommand,DeleteObjectCommand,GetObjectCommand,PutObjectCommand,PutObjectTaggingCommand,GetObjectTaggingCommand,CopyObjectCommand}from"@aws-sdk/client-s3";import{createServer}from"http";import{WebSocketServer}from"ws";import"ses";import imageSize from"image-size";import{execSync}from"child_process";import{Pinecone}from"@pinecone-database/pinecone";import OpenAI,{toFile,OpenAI as OpenAI$1}from"openai";import{GoogleGenAI as GoogleGenAI$1}from"@google/genai";import{MilvusClient,DataType,ErrorCode}from"@zilliz/milvus2-sdk-node";import{GoogleGenAI,FunctionCallingConfigMode,FileState}from"@google/genai/node";import Anthropic from"@anthropic-ai/sdk";import Groq from"groq-sdk";import{BedrockRuntimeClient,ConverseCommand,ConverseStreamCommand}from"@aws-sdk/client-bedrock-runtime";import{VertexAI}from"@google-cloud/vertexai";import{Ollama}from"ollama";import*as chokidar from"chokidar";import chokidar__default from"chokidar";import fs$1 from"fs/promises";import IORedis from"ioredis";import{trace,context,SpanStatusCode}from"@opentelemetry/api";import{logs,SeverityNumber}from"@opentelemetry/api-logs";import{resourceFromAttributes}from"@opentelemetry/resources";import{ATTR_SERVICE_VERSION,ATTR_SERVICE_NAME}from"@opentelemetry/semantic-conventions";import{BatchSpanProcessor,NodeTracerProvider}from"@opentelemetry/sdk-trace-node";import{OTLPTraceExporter}from"@opentelemetry/exporter-trace-otlp-http";import{BatchLogRecordProcessor,LoggerProvider}from"@opentelemetry/sdk-logs";import{OTLPLogExporter}from"@opentelemetry/exporter-logs-otlp-http";import mysql from"mysql2/promise";import{SecretsManagerClient,ListSecretsCommand,GetSecretValueCommand,PutSecretValueCommand,CreateSecretCommand,DeleteSecretCommand}from"@aws-sdk/client-secrets-manager";var version="1.7.18",pkg={version};dotenv.config();const config={env:{LOG_LEVEL:process.env.LOG_LEVEL||"none",LOG_FILTER:process.env.LOG_FILTER||"",NODE_ENV:process.env?.NODE_ENV}},REQUEST_METHODS=["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"],REQUEST_CONTENT_TYPES={none:"none",urlEncodedFormData:"application/x-www-form-urlencoded",multipartFormData:"multipart/form-data",json:"application/json",text:"text/plain",xml:"application/xml",binary:"binary"};var EMBODIMENT_TYPES=(EMBODIMENT_TYPES2=>(EMBODIMENT_TYPES2.ChatBot="chatBot",EMBODIMENT_TYPES2.ChatGPT="chatGPT",EMBODIMENT_TYPES2))(EMBODIMENT_TYPES||{});const ERR_MSG_INVALID_IMAGE_SOURCE="Please provide a valid Image Source. Supported image sources are: HTTP(S) URL, Base64 string, Data URL, Output Image from other component(s).",ERR_MSG_INVALID_BINARY="Please provide a valid data that is either a Blob, SmythFileObject (Binary Output from any Component), ArrayBuffer, Buffer, Base64 string, Data URL, or HTTP(s) URL",ERR_MSG_MAX_DEPTH="The maximum depth has been exceeded for the provided array or object.",ERR_MSG_MAX_ARRAY_SIZE="The maximum array size has been exceeded for the provided array.",ERR_MSG_MAX_OBJECT_SIZE="The maximum object size has been exceeded for the provided object.",MAX_DEPTH=10,MAX_OBJECT_SIZE=1e3,MAX_ARRAY_SIZE=1e3,MAX_FILE_SIZE=10*1024*1024,MAX_FILE_COUNT=10,DEFAULT_MAX_TOKENS_FOR_LLM=2048,S3_DAILY_PURGE_LIFECYCLE_TAG="ExpirationPolicy=DeleteDaily",S3_WEEKLY_PURGE_LIFECYCLE_TAG="ExpirationPolicy=DeleteWeekly",S3_MONTHLY_PURGE_LIFECYCLE_TAG="ExpirationPolicy=DeleteMonthly",TOOL_USE_DEFAULT_MODEL="gpt-4o-mini",COMP_NAMES={apiCall:"APICall",code:"Code",llmPrompt:"PromptGenerator",visionLLM:"VisionLLM"},JSON_RESPONSE_INSTRUCTION=`
|
|
2
2
|
Respond ONLY with a valid, parsable JSON object. Follow these strict guidelines:
|
|
3
3
|
1. The response must begin with '{' and end with '}'.
|
|
4
4
|
2. Use double quotes for all keys and string values.
|