janito 3.12.2__py3-none-any.whl → 3.12.3__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.
@@ -43,7 +43,7 @@ class ReadFilesTool(ToolBase):
43
43
  with open(path, "r", encoding="utf-8", errors="replace") as f:
44
44
  content = f.read()
45
45
  results.append(f"--- File: {disp_path} ---\n{content}\n")
46
- self.report_success(tr("✅ Read {disp_path}", disp_path=disp_path))
46
+ self.report_success(tr("✅ Read {disp_path}", disp_path=""))
47
47
  except Exception as e:
48
48
  self.report_error(
49
49
  tr(
@@ -43,7 +43,7 @@ class ReplaceTextInFileTool(ToolBase):
43
43
  from janito.tools.tool_utils import display_path
44
44
 
45
45
  disp_path = display_path(path)
46
- action = "(all)" if replace_all else ""
46
+ action = "" if replace_all else ""
47
47
  search_lines = len(search_text.splitlines())
48
48
  replace_lines = len(replacement_text.splitlines())
49
49
  info_msg = self._format_info_msg(
@@ -98,7 +98,7 @@ class SearchTextTool(ToolBase):
98
98
  if max_depth > 0:
99
99
  info_str += tr(" [max_depth={max_depth}]", max_depth=max_depth)
100
100
  if count_only:
101
- info_str += " [count]"
101
+ info_str += " 🔢"
102
102
  self.report_action(info_str, ReportAction.READ)
103
103
  if os.path.isfile(search_path):
104
104
  dir_output, dir_limit_reached, per_file_counts = self._handle_file(
@@ -141,7 +141,7 @@ class SearchTextTool(ToolBase):
141
141
  file_word = pluralize("match", count)
142
142
  num_files = len(per_file_counts)
143
143
  file_label = pluralize("file", num_files)
144
- file_word_max = file_word + (" (max)" if dir_limit_reached else "")
144
+ file_word_max = file_word + (" 🛑" if dir_limit_reached else "")
145
145
  self.report_success(
146
146
  tr(
147
147
  " ✅ {count} {file_word}/{num_files} {file_label}",
@@ -21,7 +21,7 @@ class ViewFileTool(ToolBase):
21
21
  Returns:
22
22
  str: File content with a header indicating the file name and line range. Example:
23
23
  - "---\nFile: /path/to/file.py | Lines: 1-10 (of 100)\n---\n<lines...>"
24
- - "---\nFile: /path/to/file.py | All lines (total: 100 (all))\n---\n<all lines...>"
24
+ - "---\nFile: /path/to/file.py | All lines (total: 100 )\n---\n<all lines...>"
25
25
  - "Error reading file: <error message>"
26
26
  - "❗ not found"
27
27
  """
@@ -123,7 +123,7 @@ class ViewFileTool(ToolBase):
123
123
  else:
124
124
  self.report_success(
125
125
  tr(
126
- " ✅ {selected_len} {line_word} (all)",
126
+ " ✅ {selected_len} {line_word} ",
127
127
  selected_len=selected_len,
128
128
  line_word=pluralize("line", selected_len),
129
129
  )
@@ -158,7 +158,7 @@ class ViewFileTool(ToolBase):
158
158
  )
159
159
  else:
160
160
  return tr(
161
- "---\n{disp_path} All lines (total: {total_lines} (all))\n---\n",
161
+ "---\n{disp_path} All lines (total: {total_lines} )\n---\n",
162
162
  disp_path=disp_path,
163
163
  total_lines=total_lines,
164
164
  )
@@ -1,104 +1,104 @@
1
- from janito.llm.provider import LLMProvider
2
- from janito.llm.model import LLMModelInfo
3
- from janito.llm.auth import LLMAuthManager
4
- from janito.llm.driver_config import LLMDriverConfig
5
- from janito.drivers.openai.driver import OpenAIModelDriver
6
- from janito.tools import get_local_tools_adapter
7
- from janito.providers.registry import LLMProviderRegistry
8
- from .model_info import MODEL_SPECS
9
- from queue import Queue
10
-
11
- available = OpenAIModelDriver.available
12
- unavailable_reason = OpenAIModelDriver.unavailable_reason
13
-
14
-
15
- class AlibabaProvider(LLMProvider):
16
- name = "alibaba"
17
- NAME = "alibaba"
18
- MAINTAINER = "João Pinto <janito@ikignosis.org>"
19
- MODEL_SPECS = MODEL_SPECS
20
- DEFAULT_MODEL = "qwen3-max-preview" # 128k context, latest preview model
21
-
22
- def __init__(
23
- self, auth_manager: LLMAuthManager = None, config: LLMDriverConfig = None
24
- ):
25
- # Always set a tools adapter so that even if the driver is unavailable,
26
- # generic code paths that expect provider.execute_tool() continue to work.
27
- self._tools_adapter = get_local_tools_adapter()
28
-
29
- # Always initialize _driver_config to avoid AttributeError
30
- self._driver_config = config or LLMDriverConfig(model=None)
31
-
32
- if not self.available:
33
- self._driver = None
34
- else:
35
- self.auth_manager = auth_manager or LLMAuthManager()
36
- self._api_key = self.auth_manager.get_credentials(type(self).NAME)
37
- if not self._api_key:
38
- from janito.llm.auth_utils import handle_missing_api_key
39
-
40
- handle_missing_api_key(self.name, "ALIBABA_API_KEY")
41
-
42
- if not self._driver_config.model:
43
- self._driver_config.model = self.DEFAULT_MODEL
44
- if not self._driver_config.api_key:
45
- self._driver_config.api_key = self._api_key
46
- # Set Alibaba international endpoint as default base_url if not provided
47
- if not getattr(self._driver_config, "base_url", None):
48
- self._driver_config.base_url = (
49
- "https://dashscope-intl.aliyuncs.com/compatible-mode/v1"
50
- )
51
- self.fill_missing_device_info(self._driver_config)
52
- self._driver = None # to be provided by factory/agent
53
-
54
- @property
55
- def driver(self) -> OpenAIModelDriver:
56
- if not self.available:
57
- raise ImportError(f"AlibabaProvider unavailable: {self.unavailable_reason}")
58
- return self._driver
59
-
60
- @property
61
- def available(self):
62
- return available
63
-
64
- @property
65
- def unavailable_reason(self):
66
- return unavailable_reason
67
-
68
- def create_driver(self):
69
- """
70
- Creates and returns a new OpenAIModelDriver instance with input/output queues.
71
- """
72
- driver = OpenAIModelDriver(
73
- tools_adapter=self._tools_adapter, provider_name=self.name
74
- )
75
- driver.config = self.driver_config
76
- # NOTE: The caller is responsible for calling driver.start() if background processing is needed.
77
- return driver
78
-
79
- def create_agent(self, tools_adapter=None, agent_name: str = None, **kwargs):
80
- from janito.llm.agent import LLMAgent
81
-
82
- # Always create a new driver with the passed-in tools_adapter
83
- if tools_adapter is None:
84
- tools_adapter = get_local_tools_adapter()
85
- # Should use new-style driver construction via queues/factory (handled elsewhere)
86
- raise NotImplementedError(
87
- "create_agent must be constructed via new factory using input/output queues and config."
88
- )
89
-
90
- @property
91
- def model_name(self):
92
- return self._driver_config.model
93
-
94
- @property
95
- def driver_config(self):
96
- """Public, read-only access to the provider's LLMDriverConfig object."""
97
- return self._driver_config
98
-
99
- def execute_tool(self, tool_name: str, event_bus, *args, **kwargs):
100
- self._tools_adapter.event_bus = event_bus
101
- return self._tools_adapter.execute_by_name(tool_name, *args, **kwargs)
102
-
103
-
104
- LLMProviderRegistry.register(AlibabaProvider.NAME, AlibabaProvider)
1
+ from janito.llm.provider import LLMProvider
2
+ from janito.llm.model import LLMModelInfo
3
+ from janito.llm.auth import LLMAuthManager
4
+ from janito.llm.driver_config import LLMDriverConfig
5
+ from janito.drivers.openai.driver import OpenAIModelDriver
6
+ from janito.tools import get_local_tools_adapter
7
+ from janito.providers.registry import LLMProviderRegistry
8
+ from .model_info import MODEL_SPECS
9
+ from queue import Queue
10
+
11
+ available = OpenAIModelDriver.available
12
+ unavailable_reason = OpenAIModelDriver.unavailable_reason
13
+
14
+
15
+ class AlibabaProvider(LLMProvider):
16
+ name = "alibaba"
17
+ NAME = "alibaba"
18
+ MAINTAINER = "João Pinto <janito@ikignosis.org>"
19
+ MODEL_SPECS = MODEL_SPECS
20
+ DEFAULT_MODEL = "qwen3-next-80b-a3b-instruct" # 256k context, latest Qwen3 Next model
21
+
22
+ def __init__(
23
+ self, auth_manager: LLMAuthManager = None, config: LLMDriverConfig = None
24
+ ):
25
+ # Always set a tools adapter so that even if the driver is unavailable,
26
+ # generic code paths that expect provider.execute_tool() continue to work.
27
+ self._tools_adapter = get_local_tools_adapter()
28
+
29
+ # Always initialize _driver_config to avoid AttributeError
30
+ self._driver_config = config or LLMDriverConfig(model=None)
31
+
32
+ if not self.available:
33
+ self._driver = None
34
+ else:
35
+ self.auth_manager = auth_manager or LLMAuthManager()
36
+ self._api_key = self.auth_manager.get_credentials(type(self).NAME)
37
+ if not self._api_key:
38
+ from janito.llm.auth_utils import handle_missing_api_key
39
+
40
+ handle_missing_api_key(self.name, "ALIBABA_API_KEY")
41
+
42
+ if not self._driver_config.model:
43
+ self._driver_config.model = self.DEFAULT_MODEL
44
+ if not self._driver_config.api_key:
45
+ self._driver_config.api_key = self._api_key
46
+ # Set Alibaba international endpoint as default base_url if not provided
47
+ if not getattr(self._driver_config, "base_url", None):
48
+ self._driver_config.base_url = (
49
+ "https://dashscope-intl.aliyuncs.com/compatible-mode/v1"
50
+ )
51
+ self.fill_missing_device_info(self._driver_config)
52
+ self._driver = None # to be provided by factory/agent
53
+
54
+ @property
55
+ def driver(self) -> OpenAIModelDriver:
56
+ if not self.available:
57
+ raise ImportError(f"AlibabaProvider unavailable: {self.unavailable_reason}")
58
+ return self._driver
59
+
60
+ @property
61
+ def available(self):
62
+ return available
63
+
64
+ @property
65
+ def unavailable_reason(self):
66
+ return unavailable_reason
67
+
68
+ def create_driver(self):
69
+ """
70
+ Creates and returns a new OpenAIModelDriver instance with input/output queues.
71
+ """
72
+ driver = OpenAIModelDriver(
73
+ tools_adapter=self._tools_adapter, provider_name=self.name
74
+ )
75
+ driver.config = self.driver_config
76
+ # NOTE: The caller is responsible for calling driver.start() if background processing is needed.
77
+ return driver
78
+
79
+ def create_agent(self, tools_adapter=None, agent_name: str = None, **kwargs):
80
+ from janito.llm.agent import LLMAgent
81
+
82
+ # Always create a new driver with the passed-in tools_adapter
83
+ if tools_adapter is None:
84
+ tools_adapter = get_local_tools_adapter()
85
+ # Should use new-style driver construction via queues/factory (handled elsewhere)
86
+ raise NotImplementedError(
87
+ "create_agent must be constructed via new factory using input/output queues and config."
88
+ )
89
+
90
+ @property
91
+ def model_name(self):
92
+ return self._driver_config.model
93
+
94
+ @property
95
+ def driver_config(self):
96
+ """Public, read-only access to the provider's LLMDriverConfig object."""
97
+ return self._driver_config
98
+
99
+ def execute_tool(self, tool_name: str, event_bus, *args, **kwargs):
100
+ self._tools_adapter.event_bus = event_bus
101
+ return self._tools_adapter.execute_by_name(tool_name, *args, **kwargs)
102
+
103
+
104
+ LLMProviderRegistry.register(AlibabaProvider.NAME, AlibabaProvider)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: janito
3
- Version: 3.12.2
3
+ Version: 3.12.3
4
4
  Summary: A new Python package called janito.
5
5
  Author-email: João Pinto <janito@ikignosis.org>
6
6
  Project-URL: Homepage, https://github.com/ikignosis/janito
@@ -167,15 +167,15 @@ janito/plugins/tools/local/python_code_run.py,sha256=oVU3XCuUD5lJE3SrMnslCr_zBE6
167
167
  janito/plugins/tools/local/python_command_run.py,sha256=UJB5Ac0WXvzPDavYd7PC2S2U0qA_OvIkJnf2J_XPr7I,6934
168
168
  janito/plugins/tools/local/python_file_run.py,sha256=wX-R4lP66LCEjFyc5hkrxI9wJgAmwI1oINP5azxxLlw,6858
169
169
  janito/plugins/tools/local/read_chart.py,sha256=H4-fcgHQweAOJsvktJ7XYs39UIVJdXRZK-xhrZEX69E,10410
170
- janito/plugins/tools/local/read_files.py,sha256=Rcke8QHU1NebNnaLsvaS81m4ZSBH0uhRGbezYN00X0E,2328
170
+ janito/plugins/tools/local/read_files.py,sha256=XKd0vkI63wqGX01_MR02rteMM_X89KPFFdsJ8QRRLM0,2321
171
171
  janito/plugins/tools/local/remove_directory.py,sha256=_P1VgC-bSttN-a2-VlEZ2inphG4me91jXe1OZi7bqR4,1912
172
172
  janito/plugins/tools/local/remove_file.py,sha256=YbTByXAnnvlQ57y-2B2qcblmOgEJpeBrGhi4Te4-QlA,2092
173
- janito/plugins/tools/local/replace_text_in_file.py,sha256=OIiXsqaoVOg_umHoPnDECzY7yDCG5ZrU6zHTM1lZhfc,10964
173
+ janito/plugins/tools/local/replace_text_in_file.py,sha256=5nu2_QjSpz1q9CfiZmo7N22sPdxlnrR17YoKoriUPWI,10962
174
174
  janito/plugins/tools/local/run_bash_command.py,sha256=cKE0VUJc_qefrU-VcTk_3ipViKZDLlbfGS8D0cEAHMg,7954
175
175
  janito/plugins/tools/local/run_powershell_command.py,sha256=nA-8rbf2NNG6eWSUwB5YkNOpCADLa_APC9y-ouk1DMc,9312
176
176
  janito/plugins/tools/local/show_image.py,sha256=KvHUuI54XVGinS3M08ORiQg7EN_xucg5qnWN5Id7YNA,4939
177
177
  janito/plugins/tools/local/show_image_grid.py,sha256=L4zFVnmw4m_sDdK2GhgWzqoQmOrV6loUZM3RIc1vcdI,5294
178
- janito/plugins/tools/local/view_file.py,sha256=5VugCv4xBNeHNqDfUq3nE0y7Ylqg5pZAHe2i0TbNfes,7378
178
+ janito/plugins/tools/local/view_file.py,sha256=sQqyuarSqbvI6-21LQwfu_vOr9Tb3XZF-7IjoteFpU8,7372
179
179
  janito/plugins/tools/local/get_file_outline/__init__.py,sha256=OKV_BHnoD9h-vkcVoW6AHmsuDjjauHPCKNK0nVFl4sU,37
180
180
  janito/plugins/tools/local/get_file_outline/core.py,sha256=E8nV5Qx7DuslRTwhONlBS1LxJJLWsE1TWeOSXMFKtFs,4609
181
181
  janito/plugins/tools/local/get_file_outline/java_outline.py,sha256=_UeUY5JoQEUdlHcK8aqGTqYJl0T2KxIFXPTdwum9gKQ,1825
@@ -183,7 +183,7 @@ janito/plugins/tools/local/get_file_outline/markdown_outline.py,sha256=bXEBg0D93
183
183
  janito/plugins/tools/local/get_file_outline/python_outline.py,sha256=RAcf9Vxec08lA06drYaNre5HCJ2lTzrRAskZ3rlyE-U,10326
184
184
  janito/plugins/tools/local/get_file_outline/search_outline.py,sha256=bski24TpnJVf3L0TNzkx3HfvaXwttQl4EVkwk2POQOw,1348
185
185
  janito/plugins/tools/local/search_text/__init__.py,sha256=FEYpF5tTtf0fiAyRGIGSn-kV-MJDkhdFIbus16mYW8Y,34
186
- janito/plugins/tools/local/search_text/core.py,sha256=Ded2lHocjRMreq6OcXDTdgQGD4KRyI55mjeHJSeecrg,7875
186
+ janito/plugins/tools/local/search_text/core.py,sha256=lSAnOjsxfqaLn0vmh4XDSfqHVZzZ4VF_l4xNSp-jerQ,7871
187
187
  janito/plugins/tools/local/search_text/match_lines.py,sha256=RLR8fZFP-Q57rY0fTENbMItmt3dJZiYX0otmGHVRjfw,2131
188
188
  janito/plugins/tools/local/search_text/pattern_utils.py,sha256=D7vtAr8oT0tGV0C_UUarAXS9XQtP-MTYmmc8Yg8iVTg,2362
189
189
  janito/plugins/tools/local/search_text/traverse_directory.py,sha256=EpL1qywAV0H29pm8-QsHrjKchKP4i4sRUOENVuNptCo,4000
@@ -205,7 +205,7 @@ janito/providers/dashscope.bak.zip,sha256=BwXxRmZreEivvRtmqbr5BR62IFVlNjAf4y6DrF
205
205
  janito/providers/registry.py,sha256=Ygwv9eVrTXOKhv0EKxSWQXO5WMHvajWE2Q_Lc3p7dKo,730
206
206
  janito/providers/alibaba/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
207
207
  janito/providers/alibaba/model_info.py,sha256=A1DL-NCFC6WhEirSfOHTXeFT14pSPvLRbV_DCbaO4jo,4893
208
- janito/providers/alibaba/provider.py,sha256=LBQoovAYKaUMB0O9-t3UC6bakI8lUzqHBRHwVaUZnIg,4179
208
+ janito/providers/alibaba/provider.py,sha256=inEho2FcYvriqGvzviWKn8klls-u22LFv71BS_Voxxk,4088
209
209
  janito/providers/anthropic/model_info.py,sha256=m6pBh0Ia8_xC1KZ7ke_4HeHIFw7nWjnYVItnRpkCSWc,1206
210
210
  janito/providers/anthropic/provider.py,sha256=aGynBxCFc7oTyvGNDUkbutJCKurC_9J4AkReC2LTPYo,3023
211
211
  janito/providers/azure_openai/model_info.py,sha256=TMSqEpQROIIYUGAyulYJ5xGhj7CbLoaKL_JXeLbXaG0,689
@@ -264,9 +264,9 @@ janito/tools/tool_utils.py,sha256=alPm9DvtXSw_zPRKvP5GjbebPRf_nfvmWk2TNlL5Cws,12
264
264
  janito/tools/tools_adapter.py,sha256=Vd7A2tJ1q-EpoenkztK4he-0WhGjLFDP0vEfmXdFiNk,21361
265
265
  janito/tools/tools_schema.py,sha256=rGrKrmpPNR07VXHAJ_haGBRRO-YGLOF51BlYRep9AAQ,4415
266
266
  janito/tools/url_whitelist.py,sha256=0CPLkHTp5HgnwgjxwgXnJmwPeZQ30q4j3YjW59hiUUE,4295
267
- janito-3.12.2.dist-info/licenses/LICENSE,sha256=dXV4fOF2ZErugtN8l_Nrj5tsRTYgtjE3cgiya0UfBio,11356
268
- janito-3.12.2.dist-info/METADATA,sha256=s0TwrmszT1pJkAaPoD08UH_qtU5up8XFnr7EAws_jIU,2330
269
- janito-3.12.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
270
- janito-3.12.2.dist-info/entry_points.txt,sha256=wIo5zZxbmu4fC-ZMrsKD0T0vq7IqkOOLYhrqRGypkx4,48
271
- janito-3.12.2.dist-info/top_level.txt,sha256=m0NaVCq0-ivxbazE2-ND0EA9Hmuijj_OGkmCbnBcCig,7
272
- janito-3.12.2.dist-info/RECORD,,
267
+ janito-3.12.3.dist-info/licenses/LICENSE,sha256=dXV4fOF2ZErugtN8l_Nrj5tsRTYgtjE3cgiya0UfBio,11356
268
+ janito-3.12.3.dist-info/METADATA,sha256=Pt3b7RGJB6BXxZ8INulk9B-zPA1jHTlzS-KS9yAdGj8,2330
269
+ janito-3.12.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
270
+ janito-3.12.3.dist-info/entry_points.txt,sha256=wIo5zZxbmu4fC-ZMrsKD0T0vq7IqkOOLYhrqRGypkx4,48
271
+ janito-3.12.3.dist-info/top_level.txt,sha256=m0NaVCq0-ivxbazE2-ND0EA9Hmuijj_OGkmCbnBcCig,7
272
+ janito-3.12.3.dist-info/RECORD,,