groq-rag 0.1.4 → 0.1.5
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/README.md +34 -0
- package/dist/index.cjs +2 -1
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -7,6 +7,9 @@
|
|
|
7
7
|
[](https://nodejs.org/)
|
|
8
8
|
[](https://groq-rag.onrender.com)
|
|
9
9
|
[](https://github.com/groq/groq-typescript)
|
|
10
|
+
[](https://context7.com/mithun50/groq-rag)
|
|
11
|
+
[](#benchmarks)
|
|
12
|
+
[](#benchmarks)
|
|
10
13
|
|
|
11
14
|
Extended [Groq TypeScript SDK](https://github.com/groq/groq-typescript) with RAG (Retrieval-Augmented Generation), web browsing, and autonomous agent capabilities. Build intelligent AI applications that can search the web, fetch URLs, query knowledge bases, and reason through complex tasks.
|
|
12
15
|
|
|
@@ -988,6 +991,37 @@ npm run lint
|
|
|
988
991
|
npm run typecheck
|
|
989
992
|
```
|
|
990
993
|
|
|
994
|
+
## Benchmarks
|
|
995
|
+
|
|
996
|
+
Performance benchmarks for groq-rag SDK operations.
|
|
997
|
+
|
|
998
|
+
### Local Processing (CPU-bound)
|
|
999
|
+
|
|
1000
|
+
| Operation | Ops/sec | Avg Time |
|
|
1001
|
+
|-----------|---------|----------|
|
|
1002
|
+
| Content Truncation | **1,743,317** | 0.0006ms |
|
|
1003
|
+
| Context Formatting | **330,914** | 0.003ms |
|
|
1004
|
+
| Text Chunking | **84,861** | 0.01ms |
|
|
1005
|
+
|
|
1006
|
+
### Network Operations (I/O-bound)
|
|
1007
|
+
|
|
1008
|
+
| Operation | Ops/sec | Avg Time |
|
|
1009
|
+
|-----------|---------|----------|
|
|
1010
|
+
| Groq Chat Completion | 5.27 | 190ms |
|
|
1011
|
+
| URL Fetch | 5.05 | 198ms |
|
|
1012
|
+
| Content Limiting (Total) | 4.87 | 205ms |
|
|
1013
|
+
| Content Limiting (Snippet) | 3.09 | 323ms |
|
|
1014
|
+
| Chat with URL | 2.61 | 383ms |
|
|
1015
|
+
| Web Search (DuckDuckGo) | 1.83 | 546ms |
|
|
1016
|
+
| Chat with Web Search | 0.98 | 1024ms |
|
|
1017
|
+
|
|
1018
|
+
> **Note**: Network operations are limited by external API latency (Groq, DuckDuckGo), not SDK performance. Local processing shows the SDK's actual code efficiency.
|
|
1019
|
+
|
|
1020
|
+
Run benchmarks:
|
|
1021
|
+
```bash
|
|
1022
|
+
npm run benchmark
|
|
1023
|
+
```
|
|
1024
|
+
|
|
991
1025
|
## Changelog
|
|
992
1026
|
|
|
993
1027
|
### v0.1.4
|
package/dist/index.cjs
CHANGED
|
@@ -1735,7 +1735,8 @@ var GroqRAG = class {
|
|
|
1735
1735
|
apiKey: config.apiKey || process.env.GROQ_API_KEY,
|
|
1736
1736
|
baseURL: config.baseURL,
|
|
1737
1737
|
timeout: config.timeout,
|
|
1738
|
-
maxRetries: config.maxRetries
|
|
1738
|
+
maxRetries: config.maxRetries,
|
|
1739
|
+
dangerouslyAllowBrowser: config.dangerouslyAllowBrowser
|
|
1739
1740
|
});
|
|
1740
1741
|
this.fetcher = createFetcher(config.web);
|
|
1741
1742
|
this.searchProvider = createSearchProvider();
|
package/dist/index.d.cts
CHANGED
|
@@ -8,6 +8,8 @@ interface GroqRAGConfig {
|
|
|
8
8
|
baseURL?: string;
|
|
9
9
|
timeout?: number;
|
|
10
10
|
maxRetries?: number;
|
|
11
|
+
/** Allow usage in browser environments (exposes API key - use with caution) */
|
|
12
|
+
dangerouslyAllowBrowser?: boolean;
|
|
11
13
|
embedding?: EmbeddingConfig;
|
|
12
14
|
vectorStore?: VectorStoreConfig;
|
|
13
15
|
web?: WebConfig;
|
package/dist/index.d.ts
CHANGED
|
@@ -8,6 +8,8 @@ interface GroqRAGConfig {
|
|
|
8
8
|
baseURL?: string;
|
|
9
9
|
timeout?: number;
|
|
10
10
|
maxRetries?: number;
|
|
11
|
+
/** Allow usage in browser environments (exposes API key - use with caution) */
|
|
12
|
+
dangerouslyAllowBrowser?: boolean;
|
|
11
13
|
embedding?: EmbeddingConfig;
|
|
12
14
|
vectorStore?: VectorStoreConfig;
|
|
13
15
|
web?: WebConfig;
|
package/dist/index.js
CHANGED
|
@@ -1661,7 +1661,8 @@ var GroqRAG = class {
|
|
|
1661
1661
|
apiKey: config.apiKey || process.env.GROQ_API_KEY,
|
|
1662
1662
|
baseURL: config.baseURL,
|
|
1663
1663
|
timeout: config.timeout,
|
|
1664
|
-
maxRetries: config.maxRetries
|
|
1664
|
+
maxRetries: config.maxRetries,
|
|
1665
|
+
dangerouslyAllowBrowser: config.dangerouslyAllowBrowser
|
|
1665
1666
|
});
|
|
1666
1667
|
this.fetcher = createFetcher(config.web);
|
|
1667
1668
|
this.searchProvider = createSearchProvider();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "groq-rag",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "Extended Groq TypeScript SDK with RAG, web browsing, and agent capabilities - 100% groq-sdk API compatible",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"test:watch": "vitest",
|
|
25
25
|
"test:coverage": "vitest run --coverage",
|
|
26
26
|
"typecheck": "tsc --noEmit",
|
|
27
|
+
"benchmark": "npx tsx benchmarks/benchmark.ts",
|
|
27
28
|
"prepublishOnly": "npm run build",
|
|
28
29
|
"publish:npm": "npm publish",
|
|
29
30
|
"publish:github": "npm run build && sed -i 's/\"name\": \"groq-rag\"/\"name\": \"@mithun50\\/groq-rag\"/' package.json && npm publish --registry=https://npm.pkg.github.com; sed -i 's/\"name\": \"@mithun50\\/groq-rag\"/\"name\": \"groq-rag\"/' package.json",
|