hanzo 0.3.28__py3-none-any.whl → 0.3.30__py3-none-any.whl

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.

hanzo/__init__.py CHANGED
@@ -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.30"
4
4
  __all__ = ["main", "cli", "__version__"]
5
5
 
6
6
  from .cli import cli, main
@@ -351,9 +351,9 @@ class EnhancedHanzoREPL:
351
351
 
352
352
  # Node status
353
353
  try:
354
- response = httpx.get("http://localhost:8000/health", timeout=1)
354
+ response = httpx.get("http://localhost:3690/health", timeout=1)
355
355
  node_status = "✅ Running" if response.status_code == 200 else "⚠️ Unhealthy"
356
- node_details = "Port 8000"
356
+ node_details = "Port 3690"
357
357
  except:
358
358
  node_status = "❌ Offline"
359
359
  node_details = "Run 'hanzo node start'"
@@ -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
hanzo/tools/detector.py CHANGED
@@ -42,7 +42,7 @@ class ToolDetector:
42
42
  provider="hanzo-local",
43
43
  priority=0, # Highest priority - local and private
44
44
  check_command=None, # Check via API endpoint
45
- api_endpoint="http://localhost:8000/health",
45
+ api_endpoint="http://localhost:3690/health",
46
46
  env_var=None
47
47
  ),
48
48
  AITool(
@@ -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:3690/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:3690/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 (port 3690)
322
346
  try:
323
347
  response = httpx.post(
324
- "http://localhost:8000/chat/completions",
348
+ "http://localhost:3690/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
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hanzo
3
- Version: 0.3.28
3
+ Version: 0.3.30
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,4 +1,4 @@
1
- hanzo/__init__.py,sha256=g4XELSN8aLffy0YoVIjALuubohGyKAN9lejacSqkEOs,185
1
+ hanzo/__init__.py,sha256=Z1_t__2GIU5l0zf7t0NnQjhp_BXVYubReDwzaUDOvB0,185
2
2
  hanzo/__main__.py,sha256=F3Vz0Ty3bdAj_8oxyETMIqxlmNRnJOAFB1XPxbyfouI,105
3
3
  hanzo/base_agent.py,sha256=ojPaSgFETYl7iARWnNpg8eyAt7sg8eKhn9xZThyvxRA,15324
4
4
  hanzo/batch_orchestrator.py,sha256=vn6n5i9gTfZ4DtowFDd5iWgYKjgNTioIomkffKbipSM,35827
@@ -27,13 +27,13 @@ hanzo/commands/router.py,sha256=kB8snUM82cFk3znjFvs3jOJGqv5giKn8DiTkdbXnWYU,5332
27
27
  hanzo/commands/tools.py,sha256=fG27wRweVmaFJowBpmwp5PgkRUtIF8bIlu_hGWr69Ss,10393
28
28
  hanzo/interactive/__init__.py,sha256=ENHkGOqu-JYI05lqoOKDczJGl96oq6nM476EPhflAbI,74
29
29
  hanzo/interactive/dashboard.py,sha256=XB5H_PMlReriCip-wW9iuUiJQOAtSATFG8EyhhFhItU,3842
30
- hanzo/interactive/enhanced_repl.py,sha256=G_r1MEg3F0Hq9PQiDuJfiOYA2KT5A6_f-xerJWvTSo0,34235
30
+ hanzo/interactive/enhanced_repl.py,sha256=pbTRuoU9XlavaAaiYq6IbISFOzNh-oXmvY1BPWixYKk,35325
31
31
  hanzo/interactive/model_selector.py,sha256=4HcXvr8AI8Y5IttMH7Dhb8M0vqzP5y3S5kQrQmopYuw,5519
32
32
  hanzo/interactive/repl.py,sha256=PXpRw1Cfqdqy1pQsKLqz9AwKJBFZ_Y758MpDlJIb9ao,6938
33
33
  hanzo/interactive/todo_manager.py,sha256=tKsmfN4snILLkgwnjQcStP4CxYfNCXS5_pvQfmxkIjw,14640
34
34
  hanzo/router/__init__.py,sha256=_cRG9nHC_wwq17iVYZSUNBYiJDdByfLDVEuIQn5-ePM,978
35
35
  hanzo/tools/__init__.py,sha256=SsgmDvw5rO--NF4vKL9tV3O4WCNEl9aAIuqyTGSZ4RQ,122
36
- hanzo/tools/detector.py,sha256=qwVc1fIDt2lDuqFqjhTVCnToRka91n125mpOpsPCfTU,14054
36
+ hanzo/tools/detector.py,sha256=rvtC-E3UX9USO9MH8X7qecP6-LwzSfO0_5OYT0ZYF3U,15676
37
37
  hanzo/ui/__init__.py,sha256=Ea22ereOm5Y0DDfyonA6qsO9Qkzofzd1CUE-VGW2lqw,241
38
38
  hanzo/ui/inline_startup.py,sha256=7Y5dwqzt-L1J0F9peyqJ8XZgjHSua2nkItDTrLlBnhU,4265
39
39
  hanzo/ui/startup.py,sha256=s7gP1QleQEIoCS1K0XBY7d6aufnwhicRLZDL7ej8ZZY,12235
@@ -41,7 +41,7 @@ hanzo/utils/__init__.py,sha256=5RRwKI852vp8smr4xCRgeKfn7dLEnHbdXGfVYTZ5jDQ,69
41
41
  hanzo/utils/config.py,sha256=FD_LoBpcoF5dgJ7WL4o6LDp2pdOy8kS-dJ6iRO2GcGM,4728
42
42
  hanzo/utils/net_check.py,sha256=YFbJ65SzfDYHkHLZe3n51VhId1VI3zhyx8p6BM-l6jE,3017
43
43
  hanzo/utils/output.py,sha256=W0j3psF07vJiX4s02gbN4zYWfbKNsb8TSIoagBSf5vA,2704
44
- hanzo-0.3.28.dist-info/METADATA,sha256=19BVN0yCDTn0FUruIXi1Mnh3VyqvlINVgySZ_HfYJ4o,6061
45
- hanzo-0.3.28.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
46
- hanzo-0.3.28.dist-info/entry_points.txt,sha256=pQLPMdqOXU_2BfTcMDhkqTCDNk_H6ApvYuSaWcuQOOw,171
47
- hanzo-0.3.28.dist-info/RECORD,,
44
+ hanzo-0.3.30.dist-info/METADATA,sha256=PkUNuCgbi1zCj61EjwhR2SJtORhKQJmb6qRHQHoYfsU,6061
45
+ hanzo-0.3.30.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
46
+ hanzo-0.3.30.dist-info/entry_points.txt,sha256=pQLPMdqOXU_2BfTcMDhkqTCDNk_H6ApvYuSaWcuQOOw,171
47
+ hanzo-0.3.30.dist-info/RECORD,,
File without changes