q-bot 2.0.0.dev2__tar.gz → 2.0.0.dev4__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.
Files changed (25) hide show
  1. {q_bot-2.0.0.dev2 → q_bot-2.0.0.dev4}/PKG-INFO +36 -36
  2. {q_bot-2.0.0.dev2 → q_bot-2.0.0.dev4}/README.md +28 -28
  3. {q_bot-2.0.0.dev2 → q_bot-2.0.0.dev4}/pyproject.toml +7 -7
  4. q_bot-2.0.0.dev4/q/__init__.py +1 -0
  5. {q_bot-2.0.0.dev2 → q_bot-2.0.0.dev4}/q/cli/commands.py +8 -1
  6. {q_bot-2.0.0.dev2 → q_bot-2.0.0.dev4}/q/providers/anthropic.py +1 -1
  7. {q_bot-2.0.0.dev2 → q_bot-2.0.0.dev4}/q_bot.egg-info/PKG-INFO +36 -36
  8. q_bot-2.0.0.dev4/q_bot.egg-info/requires.txt +9 -0
  9. q_bot-2.0.0.dev2/q/__init__.py +0 -1
  10. q_bot-2.0.0.dev2/q_bot.egg-info/requires.txt +0 -9
  11. {q_bot-2.0.0.dev2 → q_bot-2.0.0.dev4}/q/agents.py +0 -0
  12. {q_bot-2.0.0.dev2 → q_bot-2.0.0.dev4}/q/cli/main.py +0 -0
  13. {q_bot-2.0.0.dev2 → q_bot-2.0.0.dev4}/q/cli/models.py +0 -0
  14. {q_bot-2.0.0.dev2 → q_bot-2.0.0.dev4}/q/cli/parser.py +0 -0
  15. {q_bot-2.0.0.dev2 → q_bot-2.0.0.dev4}/q/cli/session.py +0 -0
  16. {q_bot-2.0.0.dev2 → q_bot-2.0.0.dev4}/q/cli/terminal.py +0 -0
  17. {q_bot-2.0.0.dev2 → q_bot-2.0.0.dev4}/q/client.py +0 -0
  18. {q_bot-2.0.0.dev2 → q_bot-2.0.0.dev4}/q/message.py +0 -0
  19. {q_bot-2.0.0.dev2 → q_bot-2.0.0.dev4}/q/providers/__init__.py +0 -0
  20. {q_bot-2.0.0.dev2 → q_bot-2.0.0.dev4}/q/providers/openai.py +0 -0
  21. {q_bot-2.0.0.dev2 → q_bot-2.0.0.dev4}/q_bot.egg-info/SOURCES.txt +0 -0
  22. {q_bot-2.0.0.dev2 → q_bot-2.0.0.dev4}/q_bot.egg-info/dependency_links.txt +0 -0
  23. {q_bot-2.0.0.dev2 → q_bot-2.0.0.dev4}/q_bot.egg-info/entry_points.txt +0 -0
  24. {q_bot-2.0.0.dev2 → q_bot-2.0.0.dev4}/q_bot.egg-info/top_level.txt +0 -0
  25. {q_bot-2.0.0.dev2 → q_bot-2.0.0.dev4}/setup.cfg +0 -0
@@ -1,21 +1,21 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: q-bot
3
- Version: 2.0.0.dev2
4
- Summary: An LLM agent from the comfort of your command line
3
+ Version: 2.0.0.dev4
4
+ Summary: A provider-agnostic command-line agent and LLM framework.
5
5
  Author-email: Tushar Khan <dev@tusharkhan.com>
6
6
  License-Expression: MIT
7
7
  Project-URL: Repository, https://github.com/tk755/q
8
8
  Requires-Python: >=3.12
9
9
  Description-Content-Type: text/markdown
10
- Requires-Dist: anthropic==0.75.0
10
+ Requires-Dist: anthropic==0.111.0
11
11
  Requires-Dist: colorama==0.4.6
12
12
  Requires-Dist: distro==1.9.0
13
- Requires-Dist: openai==2.9.0
14
- Requires-Dist: psutil==7.2.1
15
- Requires-Dist: pydantic==2.12.5
13
+ Requires-Dist: openai==2.43.0
14
+ Requires-Dist: psutil==7.2.2
15
+ Requires-Dist: pydantic==2.13.4
16
16
  Requires-Dist: pyperclip==1.11.0
17
- Requires-Dist: python-dotenv==1.2.1
18
- Requires-Dist: termcolor==3.2.0
17
+ Requires-Dist: python-dotenv==1.2.2
18
+ Requires-Dist: termcolor==3.3.0
19
19
 
20
20
  # Overview
21
21
 
@@ -39,34 +39,34 @@ Requires Python 3.12+.
39
39
 
40
40
  ## Flag Reference
41
41
 
42
- | Flag | Name | Arg | Description | Type |
43
- | ---- | ------------ | ------- | ------------------------------ | ------: |
44
- | `-a` | agent | | *[reserved for future use]* | Command |
45
- | `-b` | batch | | *[reserved for future use]* | |
46
- | `-c` | code | str | generate code | Command |
47
- | `-d` | directory | - / str | add a directory to context | Option |
48
- | `-e` | explain | - / str | explain code or text | Command |
49
- | `-f` | file | str | read input from file | Option |
50
- | `-g` | | | | |
51
- | `-h` | help | - / str | help message / help agent | Command |
52
- | `-i` | image | str | generate/edit an image | Command |
53
- | `-j` | json | - | output as JSON | Option |
54
- | `-k` | api key | str | override API key | Option |
55
- | `-l` | | | | |
56
- | `-m` | model | str | override model/provider | Option |
57
- | `-n` | new session | - | clear the session history | Option |
58
- | `-o` | output | str | output file | Option |
59
- | `-p` | | | | |
60
- | `-q` | | | | |
61
- | `-r` | rag | - / str | *[reserved for future use]* | Command |
62
- | `-s` | shell | - / str | generate a shell command | Command |
63
- | `-t` | text | str | generate text | Command |
64
- | `-u` | user command | str | *[reserved for future use]* | Command |
65
- | `-v` | verbose | - | debug logging | Option |
66
- | `-w` | web search | str | search the web | Command |
67
- | `-x` | execute | - | execute a shell command | Option |
68
- | `-y` | | | | |
69
- | `-z` | undo | - / int | undo exchanges (default 1) | Option |
42
+ | Flag | Name | Arg | Description | Type |
43
+ | ---- | ------------ | ------- | --------------------------------- | ------: |
44
+ | `-a` | agent | | *[reserved for future use]* | Command |
45
+ | `-b` | batch | | *[reserved for future use]* | Command |
46
+ | `-c` | code | str | generate code | Command |
47
+ | `-d` | directory | - / str | add a directory to context | Option |
48
+ | `-e` | explain | - / str | explain code or text | Command |
49
+ | `-f` | file | str | read input from file | Option |
50
+ | `-g` | | | | |
51
+ | `-h` | help | - / str | help message / agent | Command |
52
+ | `-i` | image | str | generate/edit an image | Command |
53
+ | `-j` | json | - | output as JSON | Option |
54
+ | `-k` | api key | str | override API key | Option |
55
+ | `-l` | code lang | str | override code generation language | Option |
56
+ | `-m` | model | str | override model/provider | Option |
57
+ | `-n` | new session | - | clear the session history | Option |
58
+ | `-o` | output | str | output file | Option |
59
+ | `-p` | | | | |
60
+ | `-q` | | | | |
61
+ | `-r` | rag | - / str | *[reserved for future use]* | Command |
62
+ | `-s` | shell | - / str | generate a shell command | Command |
63
+ | `-t` | text | str | generate text | Command |
64
+ | `-u` | user command | str | *[reserved for future use]* | Command |
65
+ | `-v` | verbose | - | debug logging | Option |
66
+ | `-w` | web | str | search the web | Command |
67
+ | `-x` | execute | - | execute a shell command | Option |
68
+ | `-y` | | | | |
69
+ | `-z` | undo | - / int | undo exchanges (default 1) | Option |
70
70
 
71
71
  ## Sessions
72
72
 
@@ -20,34 +20,34 @@ Requires Python 3.12+.
20
20
 
21
21
  ## Flag Reference
22
22
 
23
- | Flag | Name | Arg | Description | Type |
24
- | ---- | ------------ | ------- | ------------------------------ | ------: |
25
- | `-a` | agent | | *[reserved for future use]* | Command |
26
- | `-b` | batch | | *[reserved for future use]* | |
27
- | `-c` | code | str | generate code | Command |
28
- | `-d` | directory | - / str | add a directory to context | Option |
29
- | `-e` | explain | - / str | explain code or text | Command |
30
- | `-f` | file | str | read input from file | Option |
31
- | `-g` | | | | |
32
- | `-h` | help | - / str | help message / help agent | Command |
33
- | `-i` | image | str | generate/edit an image | Command |
34
- | `-j` | json | - | output as JSON | Option |
35
- | `-k` | api key | str | override API key | Option |
36
- | `-l` | | | | |
37
- | `-m` | model | str | override model/provider | Option |
38
- | `-n` | new session | - | clear the session history | Option |
39
- | `-o` | output | str | output file | Option |
40
- | `-p` | | | | |
41
- | `-q` | | | | |
42
- | `-r` | rag | - / str | *[reserved for future use]* | Command |
43
- | `-s` | shell | - / str | generate a shell command | Command |
44
- | `-t` | text | str | generate text | Command |
45
- | `-u` | user command | str | *[reserved for future use]* | Command |
46
- | `-v` | verbose | - | debug logging | Option |
47
- | `-w` | web search | str | search the web | Command |
48
- | `-x` | execute | - | execute a shell command | Option |
49
- | `-y` | | | | |
50
- | `-z` | undo | - / int | undo exchanges (default 1) | Option |
23
+ | Flag | Name | Arg | Description | Type |
24
+ | ---- | ------------ | ------- | --------------------------------- | ------: |
25
+ | `-a` | agent | | *[reserved for future use]* | Command |
26
+ | `-b` | batch | | *[reserved for future use]* | Command |
27
+ | `-c` | code | str | generate code | Command |
28
+ | `-d` | directory | - / str | add a directory to context | Option |
29
+ | `-e` | explain | - / str | explain code or text | Command |
30
+ | `-f` | file | str | read input from file | Option |
31
+ | `-g` | | | | |
32
+ | `-h` | help | - / str | help message / agent | Command |
33
+ | `-i` | image | str | generate/edit an image | Command |
34
+ | `-j` | json | - | output as JSON | Option |
35
+ | `-k` | api key | str | override API key | Option |
36
+ | `-l` | code lang | str | override code generation language | Option |
37
+ | `-m` | model | str | override model/provider | Option |
38
+ | `-n` | new session | - | clear the session history | Option |
39
+ | `-o` | output | str | output file | Option |
40
+ | `-p` | | | | |
41
+ | `-q` | | | | |
42
+ | `-r` | rag | - / str | *[reserved for future use]* | Command |
43
+ | `-s` | shell | - / str | generate a shell command | Command |
44
+ | `-t` | text | str | generate text | Command |
45
+ | `-u` | user command | str | *[reserved for future use]* | Command |
46
+ | `-v` | verbose | - | debug logging | Option |
47
+ | `-w` | web | str | search the web | Command |
48
+ | `-x` | execute | - | execute a shell command | Option |
49
+ | `-y` | | | | |
50
+ | `-z` | undo | - / int | undo exchanges (default 1) | Option |
51
51
 
52
52
  ## Sessions
53
53
 
@@ -5,18 +5,18 @@ build-backend = "setuptools.build_meta"
5
5
  [project]
6
6
  name = "q-bot"
7
7
  dynamic = ["version"]
8
- description = "An LLM agent from the comfort of your command line"
8
+ description = "A provider-agnostic command-line agent and LLM framework."
9
9
  requires-python = ">=3.12"
10
10
  dependencies = [
11
- "anthropic==0.75.0",
11
+ "anthropic==0.111.0",
12
12
  "colorama==0.4.6",
13
13
  "distro==1.9.0",
14
- "openai==2.9.0",
15
- "psutil==7.2.1",
16
- "pydantic==2.12.5",
14
+ "openai==2.43.0",
15
+ "psutil==7.2.2",
16
+ "pydantic==2.13.4",
17
17
  "pyperclip==1.11.0",
18
- "python-dotenv==1.2.1",
19
- "termcolor==3.2.0",
18
+ "python-dotenv==1.2.2",
19
+ "termcolor==3.3.0",
20
20
  ]
21
21
  authors = [
22
22
  {name = "Tushar Khan", email = "dev@tusharkhan.com"}
@@ -0,0 +1 @@
1
+ __version__ = "2.0.0.dev4"
@@ -188,7 +188,8 @@ class CodeCommand(AgentCommand):
188
188
 
189
189
  @property
190
190
  def system(self) -> str:
191
- return f"You are a coding assistant. Given a natural language description, generate a code snippet that accomplishes the requested task. The code should be correct, efficient, concise, and idiomatic. Respond with only the code snippet, without explanations, additional text, or formatting. Assume the programming language is {StateManager.load_code_lang()} unless otherwise specified."
191
+ code_lang = self.args.get("l") or StateManager.load_code_lang()
192
+ return f"You are a coding assistant. Given a natural language description, generate a code snippet that accomplishes the requested task. The code should be correct, efficient, concise, and idiomatic. Respond with only the code snippet, without explanations, additional text, or formatting. Use the {code_lang} programming language."
192
193
 
193
194
 
194
195
  class ShellCommand(AgentCommand):
@@ -360,6 +361,12 @@ class KeyOption(Flag):
360
361
  required = True
361
362
 
362
363
 
364
+ class CodeLangOption(Flag):
365
+ char = "l"
366
+ desc = "code lang"
367
+ value_type = ValueType.STR
368
+
369
+
363
370
  class ModelOption(Flag):
364
371
  char = "m"
365
372
  desc = "model"
@@ -63,4 +63,4 @@ class TextClient(AnthropicClient[str]):
63
63
  kwargs["system"] = system_prompt
64
64
 
65
65
  response = await self._async_client.messages.create(**kwargs)
66
- return response.content[0].text
66
+ return "".join(block.text for block in response.content if block.type == "text")
@@ -1,21 +1,21 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: q-bot
3
- Version: 2.0.0.dev2
4
- Summary: An LLM agent from the comfort of your command line
3
+ Version: 2.0.0.dev4
4
+ Summary: A provider-agnostic command-line agent and LLM framework.
5
5
  Author-email: Tushar Khan <dev@tusharkhan.com>
6
6
  License-Expression: MIT
7
7
  Project-URL: Repository, https://github.com/tk755/q
8
8
  Requires-Python: >=3.12
9
9
  Description-Content-Type: text/markdown
10
- Requires-Dist: anthropic==0.75.0
10
+ Requires-Dist: anthropic==0.111.0
11
11
  Requires-Dist: colorama==0.4.6
12
12
  Requires-Dist: distro==1.9.0
13
- Requires-Dist: openai==2.9.0
14
- Requires-Dist: psutil==7.2.1
15
- Requires-Dist: pydantic==2.12.5
13
+ Requires-Dist: openai==2.43.0
14
+ Requires-Dist: psutil==7.2.2
15
+ Requires-Dist: pydantic==2.13.4
16
16
  Requires-Dist: pyperclip==1.11.0
17
- Requires-Dist: python-dotenv==1.2.1
18
- Requires-Dist: termcolor==3.2.0
17
+ Requires-Dist: python-dotenv==1.2.2
18
+ Requires-Dist: termcolor==3.3.0
19
19
 
20
20
  # Overview
21
21
 
@@ -39,34 +39,34 @@ Requires Python 3.12+.
39
39
 
40
40
  ## Flag Reference
41
41
 
42
- | Flag | Name | Arg | Description | Type |
43
- | ---- | ------------ | ------- | ------------------------------ | ------: |
44
- | `-a` | agent | | *[reserved for future use]* | Command |
45
- | `-b` | batch | | *[reserved for future use]* | |
46
- | `-c` | code | str | generate code | Command |
47
- | `-d` | directory | - / str | add a directory to context | Option |
48
- | `-e` | explain | - / str | explain code or text | Command |
49
- | `-f` | file | str | read input from file | Option |
50
- | `-g` | | | | |
51
- | `-h` | help | - / str | help message / help agent | Command |
52
- | `-i` | image | str | generate/edit an image | Command |
53
- | `-j` | json | - | output as JSON | Option |
54
- | `-k` | api key | str | override API key | Option |
55
- | `-l` | | | | |
56
- | `-m` | model | str | override model/provider | Option |
57
- | `-n` | new session | - | clear the session history | Option |
58
- | `-o` | output | str | output file | Option |
59
- | `-p` | | | | |
60
- | `-q` | | | | |
61
- | `-r` | rag | - / str | *[reserved for future use]* | Command |
62
- | `-s` | shell | - / str | generate a shell command | Command |
63
- | `-t` | text | str | generate text | Command |
64
- | `-u` | user command | str | *[reserved for future use]* | Command |
65
- | `-v` | verbose | - | debug logging | Option |
66
- | `-w` | web search | str | search the web | Command |
67
- | `-x` | execute | - | execute a shell command | Option |
68
- | `-y` | | | | |
69
- | `-z` | undo | - / int | undo exchanges (default 1) | Option |
42
+ | Flag | Name | Arg | Description | Type |
43
+ | ---- | ------------ | ------- | --------------------------------- | ------: |
44
+ | `-a` | agent | | *[reserved for future use]* | Command |
45
+ | `-b` | batch | | *[reserved for future use]* | Command |
46
+ | `-c` | code | str | generate code | Command |
47
+ | `-d` | directory | - / str | add a directory to context | Option |
48
+ | `-e` | explain | - / str | explain code or text | Command |
49
+ | `-f` | file | str | read input from file | Option |
50
+ | `-g` | | | | |
51
+ | `-h` | help | - / str | help message / agent | Command |
52
+ | `-i` | image | str | generate/edit an image | Command |
53
+ | `-j` | json | - | output as JSON | Option |
54
+ | `-k` | api key | str | override API key | Option |
55
+ | `-l` | code lang | str | override code generation language | Option |
56
+ | `-m` | model | str | override model/provider | Option |
57
+ | `-n` | new session | - | clear the session history | Option |
58
+ | `-o` | output | str | output file | Option |
59
+ | `-p` | | | | |
60
+ | `-q` | | | | |
61
+ | `-r` | rag | - / str | *[reserved for future use]* | Command |
62
+ | `-s` | shell | - / str | generate a shell command | Command |
63
+ | `-t` | text | str | generate text | Command |
64
+ | `-u` | user command | str | *[reserved for future use]* | Command |
65
+ | `-v` | verbose | - | debug logging | Option |
66
+ | `-w` | web | str | search the web | Command |
67
+ | `-x` | execute | - | execute a shell command | Option |
68
+ | `-y` | | | | |
69
+ | `-z` | undo | - / int | undo exchanges (default 1) | Option |
70
70
 
71
71
  ## Sessions
72
72
 
@@ -0,0 +1,9 @@
1
+ anthropic==0.111.0
2
+ colorama==0.4.6
3
+ distro==1.9.0
4
+ openai==2.43.0
5
+ psutil==7.2.2
6
+ pydantic==2.13.4
7
+ pyperclip==1.11.0
8
+ python-dotenv==1.2.2
9
+ termcolor==3.3.0
@@ -1 +0,0 @@
1
- __version__ = "2.0.0.dev2"
@@ -1,9 +0,0 @@
1
- anthropic==0.75.0
2
- colorama==0.4.6
3
- distro==1.9.0
4
- openai==2.9.0
5
- psutil==7.2.1
6
- pydantic==2.12.5
7
- pyperclip==1.11.0
8
- python-dotenv==1.2.1
9
- termcolor==3.2.0
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