@vitalfit/sdk 0.4.3 → 0.4.4
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 +55 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +48 -1
- package/dist/index.d.ts +48 -1
- package/dist/index.js +54 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -31,6 +31,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
31
31
|
var index_exports = {};
|
|
32
32
|
__export(index_exports, {
|
|
33
33
|
APIError: () => APIError,
|
|
34
|
+
ChatRole: () => ChatRole,
|
|
34
35
|
UserGender: () => UserGender,
|
|
35
36
|
VitalFit: () => VitalFit,
|
|
36
37
|
isAPIError: () => isAPIError,
|
|
@@ -2848,6 +2849,44 @@ var RoutineService = class {
|
|
|
2848
2849
|
}
|
|
2849
2850
|
};
|
|
2850
2851
|
|
|
2852
|
+
// src/services/LLM.ts
|
|
2853
|
+
var LLMService = class {
|
|
2854
|
+
client;
|
|
2855
|
+
constructor(client) {
|
|
2856
|
+
this.client = client;
|
|
2857
|
+
this.chat = this.chat.bind(this);
|
|
2858
|
+
this.getHistory = this.getHistory.bind(this);
|
|
2859
|
+
this.resetChat = this.resetChat.bind(this);
|
|
2860
|
+
}
|
|
2861
|
+
async chat(data, jwt) {
|
|
2862
|
+
const response = await this.client.post({
|
|
2863
|
+
url: "/llm/chat",
|
|
2864
|
+
jwt,
|
|
2865
|
+
data
|
|
2866
|
+
});
|
|
2867
|
+
return response;
|
|
2868
|
+
}
|
|
2869
|
+
async getHistory(jwt, { page = 1, limit = 50, sort = "desc" } = {}) {
|
|
2870
|
+
const response = await this.client.get({
|
|
2871
|
+
url: "/llm/history",
|
|
2872
|
+
jwt,
|
|
2873
|
+
params: {
|
|
2874
|
+
page,
|
|
2875
|
+
limit,
|
|
2876
|
+
sort
|
|
2877
|
+
}
|
|
2878
|
+
});
|
|
2879
|
+
return response;
|
|
2880
|
+
}
|
|
2881
|
+
async resetChat(jwt) {
|
|
2882
|
+
const response = await this.client.post({
|
|
2883
|
+
url: "/llm/reset",
|
|
2884
|
+
jwt
|
|
2885
|
+
});
|
|
2886
|
+
return response;
|
|
2887
|
+
}
|
|
2888
|
+
};
|
|
2889
|
+
|
|
2851
2890
|
// src/types/auth.ts
|
|
2852
2891
|
var UserGender = /* @__PURE__ */ ((UserGender2) => {
|
|
2853
2892
|
UserGender2["male"] = "male";
|
|
@@ -2948,6 +2987,18 @@ var mainCurrencies = [
|
|
|
2948
2987
|
}
|
|
2949
2988
|
];
|
|
2950
2989
|
|
|
2990
|
+
// src/types/LLM.ts
|
|
2991
|
+
var ChatRole = /* @__PURE__ */ ((ChatRole2) => {
|
|
2992
|
+
ChatRole2["User"] = "user";
|
|
2993
|
+
ChatRole2["Recepcionist"] = "recepcionist";
|
|
2994
|
+
ChatRole2["Instructor"] = "instructor";
|
|
2995
|
+
ChatRole2["Client"] = "client";
|
|
2996
|
+
ChatRole2["System"] = "system";
|
|
2997
|
+
ChatRole2["Tool"] = "tool";
|
|
2998
|
+
ChatRole2["Assistant"] = "assistant";
|
|
2999
|
+
return ChatRole2;
|
|
3000
|
+
})(ChatRole || {});
|
|
3001
|
+
|
|
2951
3002
|
// src/index.ts
|
|
2952
3003
|
var VitalFit = class _VitalFit {
|
|
2953
3004
|
static instance;
|
|
@@ -2976,6 +3027,7 @@ var VitalFit = class _VitalFit {
|
|
|
2976
3027
|
notification;
|
|
2977
3028
|
exports;
|
|
2978
3029
|
routine;
|
|
3030
|
+
llm;
|
|
2979
3031
|
constructor(isDevMode, origin) {
|
|
2980
3032
|
this.client = new Client(isDevMode, origin);
|
|
2981
3033
|
this.auth = new AuthService(this.client);
|
|
@@ -3002,6 +3054,7 @@ var VitalFit = class _VitalFit {
|
|
|
3002
3054
|
this.notification = new NotificationService(this.client);
|
|
3003
3055
|
this.exports = new ExportsService(this.client);
|
|
3004
3056
|
this.routine = new RoutineService(this.client);
|
|
3057
|
+
this.llm = new LLMService(this.client);
|
|
3005
3058
|
}
|
|
3006
3059
|
static getInstance(isDevMode = false) {
|
|
3007
3060
|
if (!_VitalFit.instance) {
|
|
@@ -3010,12 +3063,13 @@ var VitalFit = class _VitalFit {
|
|
|
3010
3063
|
return _VitalFit.instance;
|
|
3011
3064
|
}
|
|
3012
3065
|
version() {
|
|
3013
|
-
return "0.4.
|
|
3066
|
+
return "0.4.4";
|
|
3014
3067
|
}
|
|
3015
3068
|
};
|
|
3016
3069
|
// Annotate the CommonJS export names for ESM import in node:
|
|
3017
3070
|
0 && (module.exports = {
|
|
3018
3071
|
APIError,
|
|
3072
|
+
ChatRole,
|
|
3019
3073
|
UserGender,
|
|
3020
3074
|
VitalFit,
|
|
3021
3075
|
isAPIError,
|