hey-cli-python 1.0.1__py3-none-any.whl → 1.0.2__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.
hey_cli/llm.py CHANGED
@@ -1,7 +1,8 @@
1
1
  import json
2
2
  import os
3
3
  import platform
4
- import ollama
4
+ import urllib.request
5
+ import urllib.error
5
6
  from .models import CommandResponse, TroubleshootResponse
6
7
 
7
8
  DEFAULT_MODEL = "gpt-oss:20b-cloud"
@@ -58,12 +59,20 @@ def generate_command(prompt: str, context: str = "", model_name: str = DEFAULT_M
58
59
 
59
60
  for attempt in range(max_retries):
60
61
  try:
61
- response = ollama.chat(
62
- model=model_name,
63
- messages=msgs,
64
- format="json",
65
- options={"temperature": 0.0}
62
+ payload = {
63
+ "model": model_name,
64
+ "messages": msgs,
65
+ "format": "json",
66
+ "stream": False,
67
+ "options": {"temperature": 0.0}
68
+ }
69
+ req = urllib.request.Request(
70
+ "http://localhost:11434/api/chat",
71
+ data=json.dumps(payload).encode('utf-8'),
72
+ headers={"Content-Type": "application/json"}
66
73
  )
74
+ with urllib.request.urlopen(req, timeout=30) as resp:
75
+ response = json.loads(resp.read().decode('utf-8'))
67
76
 
68
77
  raw_val = response["message"]["content"]
69
78
  content_str = raw_val
@@ -113,12 +122,20 @@ def generate_troubleshoot_step(objective: str, history: list, model_name: str =
113
122
 
114
123
  for attempt in range(max_retries):
115
124
  try:
116
- response = ollama.chat(
117
- model=model_name,
118
- messages=msgs,
119
- format="json",
120
- options={"temperature": 0.0}
125
+ payload = {
126
+ "model": model_name,
127
+ "messages": msgs,
128
+ "format": "json",
129
+ "stream": False,
130
+ "options": {"temperature": 0.0}
131
+ }
132
+ req = urllib.request.Request(
133
+ "http://localhost:11434/api/chat",
134
+ data=json.dumps(payload).encode('utf-8'),
135
+ headers={"Content-Type": "application/json"}
121
136
  )
137
+ with urllib.request.urlopen(req, timeout=30) as resp:
138
+ response = json.loads(resp.read().decode('utf-8'))
122
139
 
123
140
  raw_val = response["message"]["content"].strip()
124
141
  if not raw_val:
@@ -1,8 +1,8 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hey-cli-python
3
- Version: 1.0.1
3
+ Version: 1.0.2
4
4
  Summary: A secure, zero-bloat CLI companion that turns natural language and error logs into executable commands.
5
- Author: Mohit S.
5
+ Author: Mohit Singh Sinsniwal
6
6
  Project-URL: Homepage, https://github.com/sinsniwal/hey-cli
7
7
  Project-URL: Repository, https://github.com/sinsniwal/hey-cli
8
8
  Project-URL: Issues, https://github.com/sinsniwal/hey-cli/issues
@@ -21,7 +21,6 @@ Classifier: Programming Language :: Python :: 3.12
21
21
  Requires-Python: >=3.9
22
22
  Description-Content-Type: text/markdown
23
23
  License-File: LICENSE
24
- Requires-Dist: ollama>=0.1.0
25
24
  Requires-Dist: rich>=13.0.0
26
25
  Dynamic: license-file
27
26
 
@@ -2,13 +2,13 @@ hey_cli/__init__.py,sha256=J-j-u0itpEFT6irdmWmixQqYMadNl1X91TxUmoiLHMI,22
2
2
  hey_cli/cli.py,sha256=3Goa9Z9mTHmDjTyPYXDYIy1BidhRKJ3QwrwnG3UDA60,2758
3
3
  hey_cli/governance.py,sha256=jRgI9kUtldJFUTTNbRAj6kACKnVZMe_ak-7lmCgz5EA,2641
4
4
  hey_cli/history.py,sha256=a7xnUMthQQlzeTwfsORpsTBFPMBgo0wcubU603HBrRE,928
5
- hey_cli/llm.py,sha256=PikvRhjfAz1mBvFMPMbFEwPM3yosQ3ogaaRzVmrHgGM,7045
5
+ hey_cli/llm.py,sha256=mCZ6e4fVa7lOCsT6ZzXx_C5CQavi3sDJNyBcKu6nGe4,7857
6
6
  hey_cli/models.py,sha256=Jye_btuL39R7BA5bG59JbJFtpDUS0ZrSw0veUUTf0kM,302
7
7
  hey_cli/runner.py,sha256=Ep5Z1E_RXXnSeqlDshFjv3Swxeq2LqX7iImaZPH-Edw,8386
8
8
  hey_cli/skills.py,sha256=RX6rSnkQ6FG_hogKUhASI5dazvNAphi2n2c1Rw_NAxw,3569
9
- hey_cli_python-1.0.1.dist-info/licenses/LICENSE,sha256=15ubdFS3laW1SETf6f8fd8-sbqZeGz_FFdJgJATDAVI,1065
10
- hey_cli_python-1.0.1.dist-info/METADATA,sha256=11JNTmjA-xzcGTEtoRKdYM7p5H3hB6hEMq6ill8bLCw,4858
11
- hey_cli_python-1.0.1.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
12
- hey_cli_python-1.0.1.dist-info/entry_points.txt,sha256=N4bcRze9-LYaO624Gpg5Th_4CSQCDN04EXUHFve7uGw,41
13
- hey_cli_python-1.0.1.dist-info/top_level.txt,sha256=UNOjINF-x81p5IeEawLMkXdUnlybKKYKx8UGTzP6IuU,8
14
- hey_cli_python-1.0.1.dist-info/RECORD,,
9
+ hey_cli_python-1.0.2.dist-info/licenses/LICENSE,sha256=15ubdFS3laW1SETf6f8fd8-sbqZeGz_FFdJgJATDAVI,1065
10
+ hey_cli_python-1.0.2.dist-info/METADATA,sha256=Ud5JCPptGoWjIehbL19rncZsXDA-bOR4TEliCFKB_j8,4842
11
+ hey_cli_python-1.0.2.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
12
+ hey_cli_python-1.0.2.dist-info/entry_points.txt,sha256=N4bcRze9-LYaO624Gpg5Th_4CSQCDN04EXUHFve7uGw,41
13
+ hey_cli_python-1.0.2.dist-info/top_level.txt,sha256=UNOjINF-x81p5IeEawLMkXdUnlybKKYKx8UGTzP6IuU,8
14
+ hey_cli_python-1.0.2.dist-info/RECORD,,