hanzo 0.3.28__tar.gz → 0.3.29__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.

Potentially problematic release.


This version of hanzo might be problematic. Click here for more details.

Files changed (47) hide show
  1. {hanzo-0.3.28 → hanzo-0.3.29}/PKG-INFO +1 -1
  2. {hanzo-0.3.28 → hanzo-0.3.29}/pyproject.toml +1 -1
  3. {hanzo-0.3.28 → hanzo-0.3.29}/src/hanzo/__init__.py +1 -1
  4. {hanzo-0.3.28 → hanzo-0.3.29}/src/hanzo/interactive/enhanced_repl.py +19 -2
  5. {hanzo-0.3.28 → hanzo-0.3.29}/src/hanzo/tools/detector.py +42 -15
  6. {hanzo-0.3.28 → hanzo-0.3.29}/.gitignore +0 -0
  7. {hanzo-0.3.28 → hanzo-0.3.29}/README.md +0 -0
  8. {hanzo-0.3.28 → hanzo-0.3.29}/src/hanzo/__main__.py +0 -0
  9. {hanzo-0.3.28 → hanzo-0.3.29}/src/hanzo/base_agent.py +0 -0
  10. {hanzo-0.3.28 → hanzo-0.3.29}/src/hanzo/batch_orchestrator.py +0 -0
  11. {hanzo-0.3.28 → hanzo-0.3.29}/src/hanzo/cli.py +0 -0
  12. {hanzo-0.3.28 → hanzo-0.3.29}/src/hanzo/commands/__init__.py +0 -0
  13. {hanzo-0.3.28 → hanzo-0.3.29}/src/hanzo/commands/agent.py +0 -0
  14. {hanzo-0.3.28 → hanzo-0.3.29}/src/hanzo/commands/auth.py +0 -0
  15. {hanzo-0.3.28 → hanzo-0.3.29}/src/hanzo/commands/auth_broken.py +0 -0
  16. {hanzo-0.3.28 → hanzo-0.3.29}/src/hanzo/commands/chat.py +0 -0
  17. {hanzo-0.3.28 → hanzo-0.3.29}/src/hanzo/commands/config.py +0 -0
  18. {hanzo-0.3.28 → hanzo-0.3.29}/src/hanzo/commands/mcp.py +0 -0
  19. {hanzo-0.3.28 → hanzo-0.3.29}/src/hanzo/commands/miner.py +0 -0
  20. {hanzo-0.3.28 → hanzo-0.3.29}/src/hanzo/commands/network.py +0 -0
  21. {hanzo-0.3.28 → hanzo-0.3.29}/src/hanzo/commands/node.py +0 -0
  22. {hanzo-0.3.28 → hanzo-0.3.29}/src/hanzo/commands/repl.py +0 -0
  23. {hanzo-0.3.28 → hanzo-0.3.29}/src/hanzo/commands/router.py +0 -0
  24. {hanzo-0.3.28 → hanzo-0.3.29}/src/hanzo/commands/tools.py +0 -0
  25. {hanzo-0.3.28 → hanzo-0.3.29}/src/hanzo/dev.py +0 -0
  26. {hanzo-0.3.28 → hanzo-0.3.29}/src/hanzo/fallback_handler.py +0 -0
  27. {hanzo-0.3.28 → hanzo-0.3.29}/src/hanzo/interactive/__init__.py +0 -0
  28. {hanzo-0.3.28 → hanzo-0.3.29}/src/hanzo/interactive/dashboard.py +0 -0
  29. {hanzo-0.3.28 → hanzo-0.3.29}/src/hanzo/interactive/model_selector.py +0 -0
  30. {hanzo-0.3.28 → hanzo-0.3.29}/src/hanzo/interactive/repl.py +0 -0
  31. {hanzo-0.3.28 → hanzo-0.3.29}/src/hanzo/interactive/todo_manager.py +0 -0
  32. {hanzo-0.3.28 → hanzo-0.3.29}/src/hanzo/mcp_server.py +0 -0
  33. {hanzo-0.3.28 → hanzo-0.3.29}/src/hanzo/memory_manager.py +0 -0
  34. {hanzo-0.3.28 → hanzo-0.3.29}/src/hanzo/model_registry.py +0 -0
  35. {hanzo-0.3.28 → hanzo-0.3.29}/src/hanzo/orchestrator_config.py +0 -0
  36. {hanzo-0.3.28 → hanzo-0.3.29}/src/hanzo/rate_limiter.py +0 -0
  37. {hanzo-0.3.28 → hanzo-0.3.29}/src/hanzo/repl.py +0 -0
  38. {hanzo-0.3.28 → hanzo-0.3.29}/src/hanzo/router/__init__.py +0 -0
  39. {hanzo-0.3.28 → hanzo-0.3.29}/src/hanzo/streaming.py +0 -0
  40. {hanzo-0.3.28 → hanzo-0.3.29}/src/hanzo/tools/__init__.py +0 -0
  41. {hanzo-0.3.28 → hanzo-0.3.29}/src/hanzo/ui/__init__.py +0 -0
  42. {hanzo-0.3.28 → hanzo-0.3.29}/src/hanzo/ui/inline_startup.py +0 -0
  43. {hanzo-0.3.28 → hanzo-0.3.29}/src/hanzo/ui/startup.py +0 -0
  44. {hanzo-0.3.28 → hanzo-0.3.29}/src/hanzo/utils/__init__.py +0 -0
  45. {hanzo-0.3.28 → hanzo-0.3.29}/src/hanzo/utils/config.py +0 -0
  46. {hanzo-0.3.28 → hanzo-0.3.29}/src/hanzo/utils/net_check.py +0 -0
  47. {hanzo-0.3.28 → hanzo-0.3.29}/src/hanzo/utils/output.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hanzo
3
- Version: 0.3.28
3
+ Version: 0.3.29
4
4
  Summary: Hanzo AI - Complete AI Infrastructure Platform with CLI, Router, MCP, and Agent Runtime
5
5
  Project-URL: Homepage, https://hanzo.ai
6
6
  Project-URL: Repository, https://github.com/hanzoai/python-sdk
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "hanzo"
3
- version = "0.3.28"
3
+ version = "0.3.29"
4
4
  description = "Hanzo AI - Complete AI Infrastructure Platform with CLI, Router, MCP, and Agent Runtime"
5
5
  authors = [
6
6
  {name = "Hanzo AI", email = "dev@hanzo.ai"},
@@ -1,6 +1,6 @@
1
1
  """Hanzo - Complete AI Infrastructure Platform with CLI, Router, MCP, and Agent Runtime."""
2
2
 
3
- __version__ = "0.3.28"
3
+ __version__ = "0.3.29"
4
4
  __all__ = ["main", "cli", "__version__"]
5
5
 
6
6
  from .cli import cli, main
@@ -645,8 +645,25 @@ class EnhancedHanzoREPL:
645
645
  if success:
646
646
  self.console.print(output)
647
647
  else:
648
- # Fallback to regular model
649
- self.console.print(f"[yellow]{self.current_tool.display_name} failed, trying cloud model...[/yellow]")
648
+ # Show error and try fallback
649
+ self.console.print(f"[red]Error: {output}[/red]")
650
+
651
+ # Try to find next available tool
652
+ if self.tool_detector and self.tool_detector.detected_tools:
653
+ for fallback_tool in self.tool_detector.detected_tools:
654
+ if fallback_tool != self.current_tool:
655
+ self.console.print(f"[yellow]Trying {fallback_tool.display_name}...[/yellow]")
656
+ success, output = self.tool_detector.execute_with_tool(fallback_tool, message)
657
+ if success:
658
+ self.console.print(output)
659
+ # Suggest switching to working tool
660
+ self.console.print(f"\n[dim]Tip: Switch to {fallback_tool.display_name} with /model {fallback_tool.name}[/dim]")
661
+ return
662
+ else:
663
+ self.console.print(f"[red]{fallback_tool.display_name} also failed[/red]")
664
+
665
+ # Final fallback to cloud model
666
+ self.console.print(f"[yellow]Falling back to cloud model...[/yellow]")
650
667
  await self.execute_command("ask", f"--cloud --model gpt-3.5-turbo {message}")
651
668
  else:
652
669
  # Use regular model through hanzo ask
@@ -170,22 +170,46 @@ class ToolDetector:
170
170
  try:
171
171
  response = httpx.get(tool.api_endpoint, timeout=1.0)
172
172
  if response.status_code == 200:
173
- tool.detected = True
174
- tool.version = "Running"
175
-
176
- # Special handling for Hanzo services
173
+ # For Hanzo Node, verify it can actually handle chat completions
177
174
  if tool.name == "hanzod":
178
- # Check if models are loaded
179
175
  try:
180
- models_response = httpx.get("http://localhost:8000/models", timeout=1.0)
181
- if models_response.status_code == 200:
182
- models = models_response.json()
183
- if models:
184
- tool.version = f"Running ({len(models)} models)"
176
+ # Check if the chat completions endpoint works
177
+ test_response = httpx.post(
178
+ "http://localhost:8000/v1/chat/completions",
179
+ json={
180
+ "messages": [{"role": "user", "content": "test"}],
181
+ "model": "test",
182
+ "max_tokens": 1
183
+ },
184
+ timeout=2.0
185
+ )
186
+ # Only mark as detected if we get a valid response or specific error
187
+ # 404 means the endpoint doesn't exist
188
+ if test_response.status_code == 404:
189
+ return False
190
+
191
+ tool.detected = True
192
+ tool.version = "Running (Local AI)"
193
+
194
+ # Try to get model info
195
+ try:
196
+ models_response = httpx.get("http://localhost:8000/v1/models", timeout=1.0)
197
+ if models_response.status_code == 200:
198
+ models = models_response.json().get("data", [])
199
+ if models:
200
+ tool.version = f"Running ({len(models)} models)"
201
+ except:
202
+ pass
203
+
204
+ return True
185
205
  except:
186
- pass
187
-
188
- return True
206
+ # If chat endpoint doesn't work, node isn't useful
207
+ return False
208
+ else:
209
+ # For other services, just check health endpoint
210
+ tool.detected = True
211
+ tool.version = "Running"
212
+ return True
189
213
  except:
190
214
  pass
191
215
 
@@ -318,12 +342,13 @@ class ToolDetector:
318
342
  try:
319
343
  # Special handling for Hanzo services
320
344
  if tool.name == "hanzod":
321
- # Use the local API directly
345
+ # Use the local API directly with correct endpoint
322
346
  try:
323
347
  response = httpx.post(
324
- "http://localhost:8000/chat/completions",
348
+ "http://localhost:8000/v1/chat/completions",
325
349
  json={
326
350
  "messages": [{"role": "user", "content": prompt}],
351
+ "model": "default", # Use default model
327
352
  "stream": False
328
353
  },
329
354
  timeout=30.0
@@ -331,6 +356,8 @@ class ToolDetector:
331
356
  if response.status_code == 200:
332
357
  result = response.json()
333
358
  return True, result.get("choices", [{}])[0].get("message", {}).get("content", "")
359
+ else:
360
+ return False, f"Hanzo Node returned {response.status_code}: {response.text}"
334
361
  except Exception as e:
335
362
  return False, f"Hanzo Node error: {e}"
336
363
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes