hai-api 1.1.4 → 1.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/dist/index.d.ts CHANGED
@@ -75,6 +75,10 @@ export declare class HAIClient {
75
75
  private baseUrl;
76
76
  private memory;
77
77
  constructor(apiKey?: string, baseUrl?: string);
78
+ /**
79
+ * Create a client pre-configured for local development (http://localhost:5000).
80
+ */
81
+ static local(apiKey?: string): HAIClient;
78
82
  private buildPayload;
79
83
  private createResponse;
80
84
  /**
package/dist/index.js CHANGED
@@ -124,6 +124,12 @@ class HAIClient {
124
124
  this.baseUrl = baseUrl.replace(/\/$/, "");
125
125
  this.memory = new MemoryStore();
126
126
  }
127
+ /**
128
+ * Create a client pre-configured for local development (http://localhost:5000).
129
+ */
130
+ static local(apiKey) {
131
+ return new HAIClient(apiKey, "http://localhost:5000");
132
+ }
127
133
  buildPayload(prompt, options) {
128
134
  const { sessionId, thinking = false, search = false, chatSessionId, parentMessageId, system, temperature, maxTokens, jsonMode, translate, codeMode, verify, summarize, includeThought, image, memoryDepth = 10, } = options;
129
135
  // Build messages array
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hai-api",
3
- "version": "1.1.4",
3
+ "version": "1.1.5",
4
4
  "description": "The official Node.js SDK for hAI Private AI.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/index.ts CHANGED
@@ -162,6 +162,13 @@ export class HAIClient {
162
162
  this.memory = new MemoryStore();
163
163
  }
164
164
 
165
+ /**
166
+ * Create a client pre-configured for local development (http://localhost:5000).
167
+ */
168
+ static local(apiKey?: string): HAIClient {
169
+ return new HAIClient(apiKey, "http://localhost:5000");
170
+ }
171
+
165
172
  private buildPayload(prompt: string, options: ChatOptions): Record<string, unknown> {
166
173
  const {
167
174
  sessionId, thinking = false, search = false,