janito 1.1.0__py3-none-any.whl → 1.2.0__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.
- janito/__init__.py +1 -1
- janito/agent/config.py +1 -1
- janito/agent/config_defaults.py +1 -1
- janito/agent/conversation.py +6 -0
- janito/cli/arg_parser.py +1 -0
- janito/cli/runner.py +7 -1
- {janito-1.1.0.dist-info → janito-1.2.0.dist-info}/METADATA +3 -2
- {janito-1.1.0.dist-info → janito-1.2.0.dist-info}/RECORD +12 -12
- {janito-1.1.0.dist-info → janito-1.2.0.dist-info}/WHEEL +0 -0
- {janito-1.1.0.dist-info → janito-1.2.0.dist-info}/entry_points.txt +0 -0
- {janito-1.1.0.dist-info → janito-1.2.0.dist-info}/licenses/LICENSE +0 -0
- {janito-1.1.0.dist-info → janito-1.2.0.dist-info}/top_level.txt +0 -0
janito/__init__.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__version__ = "1.
|
1
|
+
__version__ = "1.2.0"
|
janito/agent/config.py
CHANGED
@@ -59,7 +59,7 @@ class FileConfig(BaseConfig):
|
|
59
59
|
|
60
60
|
CONFIG_OPTIONS = {
|
61
61
|
"api_key": "API key for OpenAI-compatible service (required)",
|
62
|
-
"model": "Model name to use (e.g., '
|
62
|
+
"model": "Model name to use (e.g., 'openai/gpt-4.1')",
|
63
63
|
"base_url": "API base URL (OpenAI-compatible endpoint)",
|
64
64
|
"role": "Role description for the system prompt (e.g., 'software engineer')",
|
65
65
|
"system_prompt": "Override the entire system prompt text",
|
janito/agent/config_defaults.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# Centralized config defaults for Janito
|
2
2
|
CONFIG_DEFAULTS = {
|
3
3
|
"api_key": None, # Must be set by user
|
4
|
-
"model": "
|
4
|
+
"model": "openai/gpt-4.1", # Default model
|
5
5
|
"base_url": "https://openrouter.ai/api/v1",
|
6
6
|
"role": "software engineer",
|
7
7
|
"system_prompt": None, # None means auto-generate from role
|
janito/agent/conversation.py
CHANGED
@@ -31,6 +31,12 @@ class ConversationHandler:
|
|
31
31
|
if resolved_max_tokens is None:
|
32
32
|
resolved_max_tokens = unified_config.get('max_tokens', 200000)
|
33
33
|
|
34
|
+
# Ensure max_tokens is always an int (handles config/CLI string values)
|
35
|
+
try:
|
36
|
+
resolved_max_tokens = int(resolved_max_tokens)
|
37
|
+
except (TypeError, ValueError):
|
38
|
+
raise ValueError(f"max_tokens must be an integer, got: {resolved_max_tokens!r}")
|
39
|
+
|
34
40
|
for _ in range(max_rounds):
|
35
41
|
if spinner:
|
36
42
|
# Calculate word count for all messages
|
janito/cli/arg_parser.py
CHANGED
@@ -5,6 +5,7 @@ def create_parser():
|
|
5
5
|
parser = argparse.ArgumentParser(description="OpenRouter API call using OpenAI Python SDK")
|
6
6
|
parser.add_argument("prompt", type=str, nargs="?", help="Prompt to send to the model")
|
7
7
|
parser.add_argument("--max-tokens", type=int, default=None, help="Maximum tokens for model response (overrides config, default: 200000)")
|
8
|
+
parser.add_argument("--model", type=str, default=None, help="Model name to use for this session (overrides config, does not persist)")
|
8
9
|
|
9
10
|
# Mutually exclusive group for system prompt options
|
10
11
|
group = parser.add_mutually_exclusive_group()
|
janito/cli/runner.py
CHANGED
@@ -35,6 +35,10 @@ def run_cli(args):
|
|
35
35
|
if args.role:
|
36
36
|
runtime_config.set('role', args.role)
|
37
37
|
|
38
|
+
# Set runtime_config['model'] if --model is provided (highest priority, session only)
|
39
|
+
if getattr(args, 'model', None):
|
40
|
+
runtime_config.set('model', args.model)
|
41
|
+
|
38
42
|
# New logic for --system-file
|
39
43
|
system_prompt = None
|
40
44
|
if getattr(args, 'system_file', None):
|
@@ -54,6 +58,7 @@ def run_cli(args):
|
|
54
58
|
|
55
59
|
if args.show_system:
|
56
60
|
api_key = get_api_key()
|
61
|
+
# Always get model from unified_config (which checks runtime_config first)
|
57
62
|
model = unified_config.get('model')
|
58
63
|
agent = Agent(api_key=api_key, model=model)
|
59
64
|
print("Model:", agent.model)
|
@@ -64,6 +69,7 @@ def run_cli(args):
|
|
64
69
|
|
65
70
|
api_key = get_api_key()
|
66
71
|
|
72
|
+
# Always get model from unified_config (which checks runtime_config first)
|
67
73
|
model = unified_config.get('model')
|
68
74
|
base_url = unified_config.get('base_url', 'https://openrouter.ai/api/v1')
|
69
75
|
# Handle --enable-tools flag
|
@@ -112,4 +118,4 @@ def run_cli(args):
|
|
112
118
|
except EmptyResponseError as e:
|
113
119
|
print(f"[red]Error:[/red] {e}")
|
114
120
|
except KeyboardInterrupt:
|
115
|
-
print("[yellow]Interrupted by user.[/yellow]")
|
121
|
+
console.print("[yellow]Interrupted by user.[/yellow]")
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: janito
|
3
|
-
Version: 1.
|
3
|
+
Version: 1.2.0
|
4
4
|
Summary: An agent framework with built-in tools.
|
5
5
|
Author-email: João Pinto <joao.pinto@gmail.com>
|
6
6
|
License: MIT
|
@@ -17,6 +17,7 @@ Requires-Dist: rich
|
|
17
17
|
Requires-Dist: openai
|
18
18
|
Requires-Dist: flask
|
19
19
|
Requires-Dist: pathspec
|
20
|
+
Requires-Dist: beautifulsoup4
|
20
21
|
Dynamic: license-file
|
21
22
|
|
22
23
|
# 🚀 Janito: Natural Language Code Editing Agent
|
@@ -66,7 +67,7 @@ Janito is a command-line and web-based AI agent designed to **edit code and mana
|
|
66
67
|
| Key | Description | How to set | Default |
|
67
68
|
|---------------------|---------------------------------------------------------------------------------------------|-----------------------------------------------------------------|--------------------------------------------|
|
68
69
|
| `api_key` | API key for OpenAI-compatible service | `--set-api-key`, config file | _None_ (required) |
|
69
|
-
| `model` | Model name to use | `--set-local-config model
|
70
|
+
| `model` | Model name to use | `--model` (session only), `--set-local-config model=...`, or `--set-global-config` | `openai/gpt-4.1` |
|
70
71
|
| `base_url` | API base URL (OpenAI-compatible endpoint) | `--set-local-config base_url=...` or `--set-global-config` | `https://openrouter.ai/api/v1` |
|
71
72
|
| `role` | Role description for system prompt | CLI `--role` or config | "software engineer" |
|
72
73
|
| `system_prompt` | Override the entire system prompt as a raw string. | CLI `--system-prompt` or config | _Template-generated prompt_ |
|
@@ -1,11 +1,11 @@
|
|
1
|
-
janito/__init__.py,sha256=
|
1
|
+
janito/__init__.py,sha256=El1sbpINO-cJ2mX6y_07W6DCl7IpRhkDNz3fpZpHII0,23
|
2
2
|
janito/__main__.py,sha256=CBScR30Tm-vuhIJM8o5HXKr0q-smICiwSVyuU68BP8U,78
|
3
3
|
janito/render_prompt.py,sha256=HrMUELV4tI3PWqv6RM6teiVvnUejdehBcnHUFzit3Bo,445
|
4
4
|
janito/agent/__init__.py,sha256=CByAH5Yk-yH64zo0RU7Z3nsn_7Vmandphqk0JNlpyj8,21
|
5
5
|
janito/agent/agent.py,sha256=qGjkGajNjroz1kU-iV--0DD_2FwmwjAM1Y9Z5foxwoE,3590
|
6
|
-
janito/agent/config.py,sha256
|
7
|
-
janito/agent/config_defaults.py,sha256=
|
8
|
-
janito/agent/conversation.py,sha256=
|
6
|
+
janito/agent/config.py,sha256=-zespUJrFb61fyJzjemont6lirnPM_FF88NUiTVI91I,3555
|
7
|
+
janito/agent/config_defaults.py,sha256=Ow-LKq88MmMTQ6LDH_u26NqJ8-db35KpcfR8FYuWGBw,363
|
8
|
+
janito/agent/conversation.py,sha256=Q3sXqzKgQalr9SD8D4dJnCbe_EmklAobx_29mwYhJhE,4956
|
9
9
|
janito/agent/queued_tool_handler.py,sha256=THPymKXnpoXfN49EhW5b4hrwpWZZup73JKFDJ_U03tI,540
|
10
10
|
janito/agent/runtime_config.py,sha256=gigcKUwaXs_qSdXdC5InUTPmdXUbOA-tRUx2ZJ5zzI0,906
|
11
11
|
janito/agent/tool_handler.py,sha256=MiwGx6Wlasan6KO3-Q0UDEJjmtDavd7ITc0gVjfa47s,4536
|
@@ -27,11 +27,11 @@ janito/agent/tools/view_file.py,sha256=i4IBpn_Waw_4sgHUOaPIYPcMNmmvzM9ECoR5O5fld
|
|
27
27
|
janito/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
28
28
|
janito/cli/_print_config.py,sha256=s6A-khfChmIQYRpYteokbXHlZ9VfIphdsnmABIYk_b4,3135
|
29
29
|
janito/cli/_utils.py,sha256=Q_OCFZmbr78qW4hSSUUhjondVc0ao7-iUHE7Ig8IP1g,289
|
30
|
-
janito/cli/arg_parser.py,sha256=
|
30
|
+
janito/cli/arg_parser.py,sha256=kMQAstvPldkwYrXjuWwp6lYfuQCl1NLrridFtyI75_g,3089
|
31
31
|
janito/cli/config_commands.py,sha256=WQKHt3iIdjRiAKmi-dnOSLFybF-HSc93zYoWd2aZcTU,5694
|
32
32
|
janito/cli/logging_setup.py,sha256=dWQ0wFf4YuF5lxZlhpN6lis7G56LeFYUwQdh9nA5NmA,1141
|
33
33
|
janito/cli/main.py,sha256=ONmn_lIPu8_Rd57j3YfWEx46fWj8gAkONPLdctABwy0,1333
|
34
|
-
janito/cli/runner.py,sha256=
|
34
|
+
janito/cli/runner.py,sha256=fzHdH3Vb4CoyOGDH6h74xKIOPKrUJJ3yRDlScsWJhqE,4481
|
35
35
|
janito/cli_chat_shell/__init__.py,sha256=PDGl7xK_vgkROoXvUxGZqVQFfuL9U4TjdexpP8E2JKg,41
|
36
36
|
janito/cli_chat_shell/chat_loop.py,sha256=yPqQLEUwuzmtymmBLOwYSLd52ixRKL_C-ZK7vGYaNug,5384
|
37
37
|
janito/cli_chat_shell/commands.py,sha256=Tvhw8azybchGS1qi2yJEn3FKho-FDYOK1ZT865GYwhM,7615
|
@@ -43,9 +43,9 @@ janito/templates/system_instructions.j2,sha256=JnR_nSbQrT5kfLeOwLgnvOV-x9N2msndj
|
|
43
43
|
janito/web/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
44
44
|
janito/web/__main__.py,sha256=oPXNF332aCeI7aUWr7_8M57oOKugw422VrEubxFp0P4,354
|
45
45
|
janito/web/app.py,sha256=bZse9S_F9hFSYRTJxoel5RjrtoAmvJ_lYkPfKRmBI1o,4125
|
46
|
-
janito-1.
|
47
|
-
janito-1.
|
48
|
-
janito-1.
|
49
|
-
janito-1.
|
50
|
-
janito-1.
|
51
|
-
janito-1.
|
46
|
+
janito-1.2.0.dist-info/licenses/LICENSE,sha256=sHBqv0bvtrb29H7WRR-Z603YHm9pLtJIo3nHU_9cmgE,1091
|
47
|
+
janito-1.2.0.dist-info/METADATA,sha256=Wyag2PcH7RCSx4YbQNFbrRrwmwOJOHg5js_se0niiNs,4664
|
48
|
+
janito-1.2.0.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
49
|
+
janito-1.2.0.dist-info/entry_points.txt,sha256=wIo5zZxbmu4fC-ZMrsKD0T0vq7IqkOOLYhrqRGypkx4,48
|
50
|
+
janito-1.2.0.dist-info/top_level.txt,sha256=m0NaVCq0-ivxbazE2-ND0EA9Hmuijj_OGkmCbnBcCig,7
|
51
|
+
janito-1.2.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|