bhai-cli 0.2.3__tar.gz → 0.2.4__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bhai-cli
3
- Version: 0.2.3
3
+ Version: 0.2.4
4
4
  Summary: BHAI — The Dual-Brain AI Coding Agent with Punjabi Swagger. Indic-native voice + universal LLM tool-calling.
5
5
  License: Apache-2.0
6
6
  License-File: LICENSE
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "bhai-cli"
3
- version = "0.2.3"
3
+ version = "0.2.4"
4
4
  description = "BHAI — The Dual-Brain AI Coding Agent with Punjabi Swagger. Indic-native voice + universal LLM tool-calling."
5
5
  authors = ["Madhav Kapila <smartatk04@gmail.com>"]
6
6
  readme = "README.md"
@@ -62,7 +62,8 @@ CODER_SYSTEM_PROMPT = (
62
62
  "5. Use read_file to see exact file contents before edit_file.\n"
63
63
  "6. Use execute_bash for running tests, git, docker, and system commands.\n"
64
64
  "7. Verify your changes work by running relevant commands.\n"
65
- "8. Report results factually — what you did, what worked, what failed.\n\n"
65
+ "8. Report results factually — what you did, what worked, what failed.\n"
66
+ "9. IMPORTANT: When you are done with a task or providing an explanation, simply output plain text. DO NOT format your explanation as a JSON tool call if no tools are needed.\n\n"
66
67
  "## Tools Available:\n"
67
68
  "- list_directory: Explore project structure\n"
68
69
  "- codebase_context: Get function/class signatures (AST-based)\n"
@@ -106,6 +107,8 @@ class BhaiOrchestrator:
106
107
  }
107
108
  if self.config.vibe.api_base:
108
109
  kwargs["api_base"] = self.config.vibe.api_base
110
+ if self.config.vibe.api_key:
111
+ kwargs["api_key"] = self.config.vibe.api_key
109
112
  response = await litellm.acompletion(**kwargs)
110
113
  title = response.choices[0].message.content.strip().strip('"\'')
111
114
  if title:
@@ -163,6 +166,8 @@ class BhaiOrchestrator:
163
166
  }
164
167
  if self.config.vibe.api_base:
165
168
  kwargs["api_base"] = self.config.vibe.api_base
169
+ if self.config.vibe.api_key:
170
+ kwargs["api_key"] = self.config.vibe.api_key
166
171
 
167
172
  try:
168
173
  response = await litellm.acompletion(**kwargs)
@@ -232,6 +237,8 @@ class BhaiOrchestrator:
232
237
  }
233
238
  if self.config.coder.api_base:
234
239
  kwargs["api_base"] = self.config.coder.api_base
240
+ if self.config.coder.api_key:
241
+ kwargs["api_key"] = self.config.coder.api_key
235
242
 
236
243
  try:
237
244
  response = await litellm.acompletion(**kwargs)
@@ -269,6 +276,18 @@ class BhaiOrchestrator:
269
276
  })
270
277
 
271
278
  except Exception as e:
279
+ error_str = str(e)
280
+ if "failed_generation" in error_str:
281
+ try:
282
+ json_start = error_str.find("{")
283
+ if json_start != -1:
284
+ error_json = json.loads(error_str[json_start:])
285
+ failed_gen = error_json.get("error", {}).get("failed_generation", "")
286
+ if failed_gen:
287
+ return failed_gen
288
+ except Exception:
289
+ pass
290
+
272
291
  error = f"CoderAgent error ({type(e).__name__}): {e}"
273
292
  console.print(f"[bold red]⚠ {error}[/]")
274
293
  return error
@@ -313,6 +332,8 @@ class BhaiOrchestrator:
313
332
  }
314
333
  if self.config.vibe.api_base:
315
334
  kwargs["api_base"] = self.config.vibe.api_base
335
+ if self.config.vibe.api_key:
336
+ kwargs["api_key"] = self.config.vibe.api_key
316
337
 
317
338
  response = await litellm.acompletion(**kwargs)
318
339
  summary = (response.choices[0].message.content or "Conversation compressed.").strip()
File without changes
File without changes
File without changes