@antfly/sdk 0.0.8 → 0.0.10

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.cjs CHANGED
@@ -1074,10 +1074,15 @@ function geoBoundingBox(field, bounds, boost) {
1074
1074
 
1075
1075
  // src/types.ts
1076
1076
  var embedderProviders = [
1077
+ "termite",
1077
1078
  "ollama",
1078
1079
  "gemini",
1080
+ "vertex",
1079
1081
  "openai",
1080
- "bedrock"
1082
+ "openrouter",
1083
+ "bedrock",
1084
+ "cohere",
1085
+ "mock"
1081
1086
  ];
1082
1087
  var generatorProviders = [
1083
1088
  "ollama",
package/dist/index.d.cts CHANGED
@@ -4598,11 +4598,45 @@ interface components$1 {
4598
4598
  */
4599
4599
  truncate?: "NONE" | "START" | "END";
4600
4600
  };
4601
+ /**
4602
+ * @description Configuration for the Termite embedding provider.
4603
+ *
4604
+ * Termite is Antfly's built-in ML service for local embeddings using ONNX models.
4605
+ * It provides embedding generation with multi-tier caching (memory + persistent).
4606
+ *
4607
+ * **Features:**
4608
+ * - Local ONNX-based embedding generation
4609
+ * - L1 memory cache with configurable TTL
4610
+ * - L2 persistent Pebble database cache
4611
+ * - Singleflight deduplication for concurrent identical requests
4612
+ *
4613
+ * **Example Models:** bge-base-en-v1.5 (768 dims), all-MiniLM-L6-v2 (384 dims)
4614
+ *
4615
+ * Models are loaded from the `models/embedders/{name}/` directory.
4616
+ * @example {
4617
+ * "provider": "termite",
4618
+ * "model": "bge-base-en-v1.5",
4619
+ * "api_url": "http://localhost:8082"
4620
+ * }
4621
+ */
4622
+ TermiteEmbedderConfig: {
4623
+ /**
4624
+ * @description The embedding model name (maps to models/embedders/{name}/ directory).
4625
+ * @example bge-base-en-v1.5
4626
+ */
4627
+ model: string;
4628
+ /**
4629
+ * Format: uri
4630
+ * @description The URL of the Termite API endpoint. Can also be set via ANTFLY_TERMITE_URL environment variable.
4631
+ * @example http://localhost:8082
4632
+ */
4633
+ api_url?: string;
4634
+ };
4601
4635
  /**
4602
4636
  * @description The embedding provider to use.
4603
4637
  * @enum {string}
4604
4638
  */
4605
- EmbedderProvider: "gemini" | "vertex" | "ollama" | "openai" | "openrouter" | "bedrock" | "cohere" | "mock";
4639
+ EmbedderProvider: "gemini" | "vertex" | "ollama" | "openai" | "openrouter" | "bedrock" | "cohere" | "mock" | "termite";
4606
4640
  /**
4607
4641
  * @description A unified configuration for an embedding provider.
4608
4642
  *
@@ -4776,7 +4810,7 @@ interface components$1 {
4776
4810
  * "model": "text-embedding-3-small"
4777
4811
  * }
4778
4812
  */
4779
- EmbedderConfig: (components$1["schemas"]["GoogleEmbedderConfig"] | components$1["schemas"]["VertexEmbedderConfig"] | components$1["schemas"]["OllamaEmbedderConfig"] | components$1["schemas"]["OpenAIEmbedderConfig"] | components$1["schemas"]["OpenRouterEmbedderConfig"] | components$1["schemas"]["BedrockEmbedderConfig"] | components$1["schemas"]["CohereEmbedderConfig"]) & {
4813
+ EmbedderConfig: (components$1["schemas"]["GoogleEmbedderConfig"] | components$1["schemas"]["VertexEmbedderConfig"] | components$1["schemas"]["OllamaEmbedderConfig"] | components$1["schemas"]["OpenAIEmbedderConfig"] | components$1["schemas"]["OpenRouterEmbedderConfig"] | components$1["schemas"]["BedrockEmbedderConfig"] | components$1["schemas"]["CohereEmbedderConfig"] | components$1["schemas"]["TermiteEmbedderConfig"]) & {
4780
4814
  provider: components$1["schemas"]["EmbedderProvider"];
4781
4815
  };
4782
4816
  /** @description Per-request configuration for chunking. All fields are optional - zero/omitted values use chunker defaults. */
package/dist/index.d.ts CHANGED
@@ -4598,11 +4598,45 @@ interface components$1 {
4598
4598
  */
4599
4599
  truncate?: "NONE" | "START" | "END";
4600
4600
  };
4601
+ /**
4602
+ * @description Configuration for the Termite embedding provider.
4603
+ *
4604
+ * Termite is Antfly's built-in ML service for local embeddings using ONNX models.
4605
+ * It provides embedding generation with multi-tier caching (memory + persistent).
4606
+ *
4607
+ * **Features:**
4608
+ * - Local ONNX-based embedding generation
4609
+ * - L1 memory cache with configurable TTL
4610
+ * - L2 persistent Pebble database cache
4611
+ * - Singleflight deduplication for concurrent identical requests
4612
+ *
4613
+ * **Example Models:** bge-base-en-v1.5 (768 dims), all-MiniLM-L6-v2 (384 dims)
4614
+ *
4615
+ * Models are loaded from the `models/embedders/{name}/` directory.
4616
+ * @example {
4617
+ * "provider": "termite",
4618
+ * "model": "bge-base-en-v1.5",
4619
+ * "api_url": "http://localhost:8082"
4620
+ * }
4621
+ */
4622
+ TermiteEmbedderConfig: {
4623
+ /**
4624
+ * @description The embedding model name (maps to models/embedders/{name}/ directory).
4625
+ * @example bge-base-en-v1.5
4626
+ */
4627
+ model: string;
4628
+ /**
4629
+ * Format: uri
4630
+ * @description The URL of the Termite API endpoint. Can also be set via ANTFLY_TERMITE_URL environment variable.
4631
+ * @example http://localhost:8082
4632
+ */
4633
+ api_url?: string;
4634
+ };
4601
4635
  /**
4602
4636
  * @description The embedding provider to use.
4603
4637
  * @enum {string}
4604
4638
  */
4605
- EmbedderProvider: "gemini" | "vertex" | "ollama" | "openai" | "openrouter" | "bedrock" | "cohere" | "mock";
4639
+ EmbedderProvider: "gemini" | "vertex" | "ollama" | "openai" | "openrouter" | "bedrock" | "cohere" | "mock" | "termite";
4606
4640
  /**
4607
4641
  * @description A unified configuration for an embedding provider.
4608
4642
  *
@@ -4776,7 +4810,7 @@ interface components$1 {
4776
4810
  * "model": "text-embedding-3-small"
4777
4811
  * }
4778
4812
  */
4779
- EmbedderConfig: (components$1["schemas"]["GoogleEmbedderConfig"] | components$1["schemas"]["VertexEmbedderConfig"] | components$1["schemas"]["OllamaEmbedderConfig"] | components$1["schemas"]["OpenAIEmbedderConfig"] | components$1["schemas"]["OpenRouterEmbedderConfig"] | components$1["schemas"]["BedrockEmbedderConfig"] | components$1["schemas"]["CohereEmbedderConfig"]) & {
4813
+ EmbedderConfig: (components$1["schemas"]["GoogleEmbedderConfig"] | components$1["schemas"]["VertexEmbedderConfig"] | components$1["schemas"]["OllamaEmbedderConfig"] | components$1["schemas"]["OpenAIEmbedderConfig"] | components$1["schemas"]["OpenRouterEmbedderConfig"] | components$1["schemas"]["BedrockEmbedderConfig"] | components$1["schemas"]["CohereEmbedderConfig"] | components$1["schemas"]["TermiteEmbedderConfig"]) & {
4780
4814
  provider: components$1["schemas"]["EmbedderProvider"];
4781
4815
  };
4782
4816
  /** @description Per-request configuration for chunking. All fields are optional - zero/omitted values use chunker defaults. */
package/dist/index.js CHANGED
@@ -1019,10 +1019,15 @@ function geoBoundingBox(field, bounds, boost) {
1019
1019
 
1020
1020
  // src/types.ts
1021
1021
  var embedderProviders = [
1022
+ "termite",
1022
1023
  "ollama",
1023
1024
  "gemini",
1025
+ "vertex",
1024
1026
  "openai",
1025
- "bedrock"
1027
+ "openrouter",
1028
+ "bedrock",
1029
+ "cohere",
1030
+ "mock"
1026
1031
  ];
1027
1032
  var generatorProviders = [
1028
1033
  "ollama",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antfly/sdk",
3
- "version": "0.0.8",
3
+ "version": "0.0.10",
4
4
  "description": "TypeScript SDK for Antfly API",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",