@snap-agent/rag-ecommerce 0.1.1 → 0.1.2

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.d.mts CHANGED
@@ -127,8 +127,8 @@ declare class EcommerceRAGPlugin implements RAGPlugin {
127
127
  /**
128
128
  * Main retrieval method - called by the SDK
129
129
  */
130
- retrieveContext(message: string, options: {
131
- agentId: string;
130
+ retrieveContext(message: string, options?: {
131
+ agentId?: string;
132
132
  threadId?: string;
133
133
  filters?: Record<string, any>;
134
134
  metadata?: Record<string, any>;
package/dist/index.d.ts CHANGED
@@ -127,8 +127,8 @@ declare class EcommerceRAGPlugin implements RAGPlugin {
127
127
  /**
128
128
  * Main retrieval method - called by the SDK
129
129
  */
130
- retrieveContext(message: string, options: {
131
- agentId: string;
130
+ retrieveContext(message: string, options?: {
131
+ agentId?: string;
132
132
  threadId?: string;
133
133
  filters?: Record<string, any>;
134
134
  metadata?: Record<string, any>;
package/dist/index.js CHANGED
@@ -116,7 +116,7 @@ var EcommerceRAGPlugin = class {
116
116
  /**
117
117
  * Main retrieval method - called by the SDK
118
118
  */
119
- async retrieveContext(message, options) {
119
+ async retrieveContext(message, options = {}) {
120
120
  const queryVector = await this.embedText(message);
121
121
  let attributes = {};
122
122
  if (this.config.enableAttributeExtraction) {
@@ -124,7 +124,7 @@ var EcommerceRAGPlugin = class {
124
124
  }
125
125
  const searchResults = await this.vectorSearch({
126
126
  queryVector,
127
- agentId: options.agentId,
127
+ ...options.agentId && { agentId: options.agentId },
128
128
  hardFilters: options.filters || {}
129
129
  });
130
130
  const rescored = this.softRescore(searchResults, attributes);
package/dist/index.mjs CHANGED
@@ -80,7 +80,7 @@ var EcommerceRAGPlugin = class {
80
80
  /**
81
81
  * Main retrieval method - called by the SDK
82
82
  */
83
- async retrieveContext(message, options) {
83
+ async retrieveContext(message, options = {}) {
84
84
  const queryVector = await this.embedText(message);
85
85
  let attributes = {};
86
86
  if (this.config.enableAttributeExtraction) {
@@ -88,7 +88,7 @@ var EcommerceRAGPlugin = class {
88
88
  }
89
89
  const searchResults = await this.vectorSearch({
90
90
  queryVector,
91
- agentId: options.agentId,
91
+ ...options.agentId && { agentId: options.agentId },
92
92
  hardFilters: options.filters || {}
93
93
  });
94
94
  const rescored = this.softRescore(searchResults, attributes);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@snap-agent/rag-ecommerce",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "E-commerce RAG plugin for SnapAgent SDK - Product search with vector embeddings",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",