@retrivora-ai/rag-engine 1.7.2 → 1.7.3

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@retrivora-ai/rag-engine",
3
- "version": "1.7.2",
3
+ "version": "1.7.3",
4
4
  "description": "Retrivora AI is a plug-and-play AI engine for RAG chat experiences — generic vector DB + LLM provider, embeddable or standalone.",
5
5
  "author": "Abhinav Alkuchi",
6
6
  "license": "MIT",
@@ -3,7 +3,7 @@ import { VectorPlugin } from '../core/VectorPlugin';
3
3
  import { RagConfig } from '../config/RagConfig';
4
4
  import { ChatMessage, ChatResponse } from '../types';
5
5
  import { DocumentParser } from '../utils/DocumentParser';
6
- import { UITransformer } from '../utils/UITransformer';
6
+ import { UITransformer } from '../utils/UITransformer'
7
7
 
8
8
  // ─── SSE helpers ──────────────────────────────────────────────────────────────
9
9
 
@@ -1,54 +0,0 @@
1
- import { useState, useCallback } from 'react';
2
- import { UITransformer, UITransformationResponse } from '@/utils/UITransformer';
3
- import { VectorMatch } from '@/types';
4
-
5
- /**
6
- * useUITransform hook — Transforms vector database results into UI components
7
- *
8
- * @example
9
- * const { transform, result, loading } = useUITransform();
10
- *
11
- * const handleSearch = async (query: string) => {
12
- * const results = await fetchSearchResults(query);
13
- * transform(query, results);
14
- * };
15
- *
16
- * return (
17
- * <>
18
- * {result && <DynamicChart data={result} />}
19
- * </>
20
- * );
21
- */
22
- export function useUITransform() {
23
- const [result, setResult] = useState<UITransformationResponse | null>(null);
24
- const [loading, setLoading] = useState(false);
25
- const [error, setError] = useState<string | null>(null);
26
-
27
- const transform = useCallback(
28
- (query: string, data: VectorMatch[]) => {
29
- try {
30
- setLoading(true);
31
- setError(null);
32
-
33
- const transformed = UITransformer.transform(query, data);
34
- setResult(transformed);
35
-
36
- return transformed;
37
- } catch (err) {
38
- const message = err instanceof Error ? err.message : 'Transformation error';
39
- setError(message);
40
- return null;
41
- } finally {
42
- setLoading(false);
43
- }
44
- },
45
- []
46
- );
47
-
48
- const reset = useCallback(() => {
49
- setResult(null);
50
- setError(null);
51
- }, []);
52
-
53
- return { transform, result, loading, error, reset };
54
- }