smoltalk 0.0.65 → 0.0.66

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.
@@ -21,6 +21,7 @@ export declare class StatelogClient {
21
21
  private traceId;
22
22
  private apiKey;
23
23
  private projectId;
24
+ private enabled;
24
25
  constructor(config: StatelogConfig);
25
26
  toJSON(): {
26
27
  traceId: string;
@@ -16,6 +16,7 @@ export class StatelogClient {
16
16
  traceId;
17
17
  apiKey;
18
18
  projectId;
19
+ enabled = true;
19
20
  constructor(config) {
20
21
  const { host, apiKey, projectId, traceId, debugMode } = config;
21
22
  this.host = host;
@@ -27,7 +28,10 @@ export class StatelogClient {
27
28
  console.log(`Statelog client initialized with host: ${host} and traceId: ${this.traceId}`, { ...config, apiKey: "unset or [REDACTED]" });
28
29
  }
29
30
  if (!this.apiKey || this.apiKey.trim() === "") {
30
- throw new Error("API key is required for StatelogClient");
31
+ this.enabled = false;
32
+ if (this.debugMode) {
33
+ console.warn("API key is required for StatelogClient. Client will be disabled.");
34
+ }
31
35
  }
32
36
  }
33
37
  toJSON() {
@@ -264,6 +268,12 @@ export class StatelogClient {
264
268
  if (!this.host) {
265
269
  return;
266
270
  }
271
+ if (!this.enabled) {
272
+ if (this.debugMode) {
273
+ console.warn("StatelogClient is disabled. Skipping log post.");
274
+ }
275
+ return;
276
+ }
267
277
  const postBody = JSON.stringify({
268
278
  trace_id: this.traceId,
269
279
  project_id: this.projectId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "smoltalk",
3
- "version": "0.0.65",
3
+ "version": "0.0.66",
4
4
  "description": "A common interface for LLM APIs",
5
5
  "homepage": "https://github.com/egonSchiele/smoltalk",
6
6
  "scripts": {
@@ -48,4 +48,4 @@
48
48
  "openai": "^6.15.0",
49
49
  "zod": "^4.3.6"
50
50
  }
51
- }
51
+ }