@nhonh/qabot 0.2.2 → 0.2.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nhonh/qabot",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "AI-powered universal QA automation tool. Import any project, AI analyzes and runs tests across all layers.",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -9,7 +9,7 @@ export class AIEngine {
9
9
  constructor(config = {}) {
10
10
  this.provider = config.provider || "none";
11
11
  this.model =
12
- config.model || AI_PROVIDER_DEFAULTS[this.provider]?.model || "gpt-4o";
12
+ config.model ?? AI_PROVIDER_DEFAULTS[this.provider]?.model ?? "";
13
13
  this.apiKey = resolveApiKey(config);
14
14
  this.baseUrl =
15
15
  config.baseUrl || AI_PROVIDER_DEFAULTS[this.provider]?.baseUrl || "";
@@ -185,21 +185,23 @@ export class AIEngine {
185
185
  async callProxy(prompt) {
186
186
  if (!this.baseUrl) {
187
187
  throw new Error(
188
- "Proxy provider requires baseUrl. Set ai.baseUrl in qabot.config.js",
188
+ "Proxy provider requires baseUrl. Set ai.baseUrl in qabot.config.json",
189
189
  );
190
190
  }
191
191
 
192
192
  const headers = this.buildAuthHeaders();
193
193
 
194
+ const body = {
195
+ messages: [{ role: "user", content: prompt }],
196
+ temperature: this.temperature,
197
+ max_tokens: this.maxTokens,
198
+ };
199
+ if (this.model) body.model = this.model;
200
+
194
201
  const res = await fetch(this.baseUrl, {
195
202
  method: "POST",
196
203
  headers,
197
- body: JSON.stringify({
198
- model: this.model,
199
- messages: [{ role: "user", content: prompt }],
200
- temperature: this.temperature,
201
- max_tokens: this.maxTokens,
202
- }),
204
+ body: JSON.stringify(body),
203
205
  });
204
206
  if (!res.ok) {
205
207
  const body = await res.text().catch(() => "");
@@ -147,7 +147,7 @@ async function interactiveSetup(projectDir, config, isEmpty) {
147
147
  ]);
148
148
 
149
149
  aiConfig.baseUrl = proxyAnswers.baseUrl;
150
- if (proxyAnswers.model) aiConfig.model = proxyAnswers.model;
150
+ aiConfig.model = proxyAnswers.model || "";
151
151
 
152
152
  if (proxyAnswers.authMethod === "bearer") {
153
153
  aiConfig.authHeader = "Authorization";
@@ -1,4 +1,4 @@
1
- export const VERSION = "0.2.2";
1
+ export const VERSION = "0.2.3";
2
2
  export const TOOL_NAME = "qabot";
3
3
 
4
4
  export const PROJECT_TYPES = [