@memberjunction/ai-groq 2.11.0 → 2.13.0
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/models/groq.d.ts +12 -1
- package/dist/models/groq.d.ts.map +1 -1
- package/dist/models/groq.js +19 -18
- package/dist/models/groq.js.map +1 -1
- package/package.json +3 -3
package/dist/models/groq.d.ts
CHANGED
|
@@ -1,8 +1,19 @@
|
|
|
1
1
|
import { BaseLLM, ChatParams, ChatResult, ClassifyParams, ClassifyResult, SummarizeParams, SummarizeResult } from '@memberjunction/ai';
|
|
2
2
|
import Groq from 'groq-sdk';
|
|
3
|
+
/**
|
|
4
|
+
* Groq implementation of the BaseLLM class
|
|
5
|
+
*/
|
|
3
6
|
export declare class GroqLLM extends BaseLLM {
|
|
4
|
-
|
|
7
|
+
private _client;
|
|
5
8
|
constructor(apiKey: string);
|
|
9
|
+
/**
|
|
10
|
+
* Read only getter method to get the Groq client instance
|
|
11
|
+
*/
|
|
12
|
+
get GroqClient(): Groq;
|
|
13
|
+
/**
|
|
14
|
+
* Read only getter method to get the Groq client instance, deprecated
|
|
15
|
+
* @deprecated
|
|
16
|
+
*/
|
|
6
17
|
get client(): Groq;
|
|
7
18
|
ChatCompletion(params: ChatParams): Promise<ChatResult>;
|
|
8
19
|
SummarizeText(params: SummarizeParams): Promise<SummarizeResult>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"groq.d.ts","sourceRoot":"","sources":["../../src/models/groq.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAoB,cAAc,EAAE,cAAc,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAEzJ,OAAO,IAAI,MAAM,UAAU,CAAC;AAE5B,qBACa,OAAQ,SAAQ,OAAO;IAChC,
|
|
1
|
+
{"version":3,"file":"groq.d.ts","sourceRoot":"","sources":["../../src/models/groq.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAoB,cAAc,EAAE,cAAc,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAEzJ,OAAO,IAAI,MAAM,UAAU,CAAC;AAE5B;;GAEG;AACH,qBACa,OAAQ,SAAQ,OAAO;IAChC,OAAO,CAAC,OAAO,CAAO;gBACV,MAAM,EAAE,MAAM;IAK1B;;OAEG;IACH,IAAW,UAAU,IAAI,IAAI,CAE5B;IAED;;;OAGG;IACH,IAAW,MAAM,IAAI,IAAI,CAExB;IAEY,cAAc,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;IA0CvD,aAAa,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;IAIhE,YAAY,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC;CAG7E;AAED,wBAAgB,WAAW,SAE1B"}
|
package/dist/models/groq.js
CHANGED
|
@@ -8,33 +8,34 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
8
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
9
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
10
|
};
|
|
11
|
-
var GroqLLM_1;
|
|
12
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
12
|
exports.LoadGroqLLM = exports.GroqLLM = void 0;
|
|
14
13
|
const ai_1 = require("@memberjunction/ai");
|
|
15
14
|
const global_1 = require("@memberjunction/global");
|
|
16
15
|
const groq_sdk_1 = __importDefault(require("groq-sdk"));
|
|
17
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Groq implementation of the BaseLLM class
|
|
18
|
+
*/
|
|
19
|
+
let GroqLLM = class GroqLLM extends ai_1.BaseLLM {
|
|
18
20
|
constructor(apiKey) {
|
|
19
21
|
super(apiKey);
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
this._client = new groq_sdk_1.default({ apiKey: apiKey });
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Read only getter method to get the Groq client instance
|
|
26
|
+
*/
|
|
27
|
+
get GroqClient() {
|
|
28
|
+
return this._client;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Read only getter method to get the Groq client instance, deprecated
|
|
32
|
+
* @deprecated
|
|
33
|
+
*/
|
|
34
|
+
get client() {
|
|
35
|
+
return this.GroqClient;
|
|
23
36
|
}
|
|
24
|
-
get client() { return GroqLLM_1._client; }
|
|
25
37
|
async ChatCompletion(params) {
|
|
26
38
|
const startTime = new Date();
|
|
27
|
-
// const completion = await groq.chat.completions.create({
|
|
28
|
-
// messages: [
|
|
29
|
-
// {
|
|
30
|
-
// role: "user",
|
|
31
|
-
// content: "Explain the importance of low latency LLMs"
|
|
32
|
-
// }
|
|
33
|
-
// ],
|
|
34
|
-
// model: "mixtral-8x7b-32768"
|
|
35
|
-
// }).then((chatCompletion)=>{
|
|
36
|
-
// process.stdout.write(chatCompletion.choices[0]?.message?.content || "");
|
|
37
|
-
// });
|
|
38
39
|
const chatResponse = await this.client.chat.completions.create({
|
|
39
40
|
model: params.model,
|
|
40
41
|
messages: params.messages,
|
|
@@ -78,7 +79,7 @@ let GroqLLM = GroqLLM_1 = class GroqLLM extends ai_1.BaseLLM {
|
|
|
78
79
|
}
|
|
79
80
|
};
|
|
80
81
|
exports.GroqLLM = GroqLLM;
|
|
81
|
-
exports.GroqLLM = GroqLLM =
|
|
82
|
+
exports.GroqLLM = GroqLLM = __decorate([
|
|
82
83
|
(0, global_1.RegisterClass)(ai_1.BaseLLM, "GroqLLM")
|
|
83
84
|
], GroqLLM);
|
|
84
85
|
function LoadGroqLLM() {
|
package/dist/models/groq.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"groq.js","sourceRoot":"","sources":["../../src/models/groq.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"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EAAE,IAAI;YAChB,SAAS,EAAE,SAAS;YACpB,OAAO,EAAE,OAAO;YAChB,WAAW,EAAE,OAAO,CAAC,OAAO,EAAE,GAAG,SAAS,CAAC,OAAO,EAAE;YACpD,IAAI,EAAE;gBACF,OAAO,EAAE,OAAO;gBAChB,KAAK,EAAE;oBACH,WAAW,EAAE,YAAY,CAAC,KAAK,CAAC,YAAY;oBAC5C,YAAY,EAAE,YAAY,CAAC,KAAK,CAAC,aAAa;oBAC9C,gBAAgB,EAAE,YAAY,CAAC,KAAK,CAAC,iBAAiB;iBACzD;aACJ;YACD,YAAY,EAAE,EAAE;YAChB,SAAS,EAAE,IAAI;SAClB,CAAA;IACL,CAAC;IAEM,KAAK,CAAC,aAAa,CAAC,MAAuB;QAC9C,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC/C,CAAC;IAEM,KAAK,CAAC,YAAY,CAAC,MAAsB;QAC5C,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC/C,CAAC;CACJ,CAAA;AAvEY,0BAAO;kBAAP,OAAO;IADnB,IAAA,sBAAa,EAAC,YAAO,EAAE,SAAS,CAAC;GACrB,OAAO,CAuEnB;AAED,SAAgB,WAAW;IACvB,iFAAiF;AACrF,CAAC;AAFD,kCAEC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memberjunction/ai-groq",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.13.0",
|
|
4
4
|
"description": "MemberJunction Wrapper for Groq AI LPU inference engine",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"typescript": "^5.4.5"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@memberjunction/ai": "2.
|
|
23
|
-
"@memberjunction/global": "2.
|
|
22
|
+
"@memberjunction/ai": "2.13.0",
|
|
23
|
+
"@memberjunction/global": "2.13.0",
|
|
24
24
|
"groq-sdk": "0.4.0"
|
|
25
25
|
}
|
|
26
26
|
}
|