lupaxa-basic-cli-chatbot 0.1.0__py3-none-any.whl → 0.1.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.
- lupaxa/basic_cli_chatbot/chat.py +2 -8
- lupaxa/basic_cli_chatbot/cli.py +1 -3
- lupaxa/basic_cli_chatbot/config.py +1 -3
- lupaxa/basic_cli_chatbot/providers/gemini.py +4 -3
- lupaxa/basic_cli_chatbot/version.py +1 -1
- {lupaxa_basic_cli_chatbot-0.1.0.dist-info → lupaxa_basic_cli_chatbot-0.1.2.dist-info}/METADATA +1 -1
- {lupaxa_basic_cli_chatbot-0.1.0.dist-info → lupaxa_basic_cli_chatbot-0.1.2.dist-info}/RECORD +10 -10
- {lupaxa_basic_cli_chatbot-0.1.0.dist-info → lupaxa_basic_cli_chatbot-0.1.2.dist-info}/WHEEL +1 -1
- {lupaxa_basic_cli_chatbot-0.1.0.dist-info → lupaxa_basic_cli_chatbot-0.1.2.dist-info}/entry_points.txt +0 -0
- {lupaxa_basic_cli_chatbot-0.1.0.dist-info → lupaxa_basic_cli_chatbot-0.1.2.dist-info}/licenses/LICENCE +0 -0
lupaxa/basic_cli_chatbot/chat.py
CHANGED
|
@@ -4,9 +4,7 @@ from __future__ import annotations
|
|
|
4
4
|
|
|
5
5
|
from .providers.base import Provider
|
|
6
6
|
|
|
7
|
-
SYSTEM_PROMPT =
|
|
8
|
-
"You are a helpful general-purpose assistant. Answer questions clearly and concisely."
|
|
9
|
-
)
|
|
7
|
+
SYSTEM_PROMPT = "You are a helpful general-purpose assistant. Answer questions clearly and concisely."
|
|
10
8
|
|
|
11
9
|
|
|
12
10
|
def trim(conversation: list[dict[str, str]], max_context_messages: int) -> None:
|
|
@@ -19,11 +17,7 @@ def trim(conversation: list[dict[str, str]], max_context_messages: int) -> None:
|
|
|
19
17
|
return
|
|
20
18
|
limit = max_context_messages - (max_context_messages % 2)
|
|
21
19
|
while len(conversation) > limit:
|
|
22
|
-
complete_pair = (
|
|
23
|
-
len(conversation) >= 2
|
|
24
|
-
and conversation[0].get("role") == "user"
|
|
25
|
-
and conversation[1].get("role") == "assistant"
|
|
26
|
-
)
|
|
20
|
+
complete_pair = len(conversation) >= 2 and conversation[0].get("role") == "user" and conversation[1].get("role") == "assistant"
|
|
27
21
|
if not complete_pair:
|
|
28
22
|
break
|
|
29
23
|
if conversation[-1].get("role") == "user" and len(conversation) < 3:
|
lupaxa/basic_cli_chatbot/cli.py
CHANGED
|
@@ -510,9 +510,7 @@ def _run(args: argparse.Namespace) -> int:
|
|
|
510
510
|
file=sys.stderr,
|
|
511
511
|
)
|
|
512
512
|
return 2
|
|
513
|
-
if args.validate and (
|
|
514
|
-
args.profile is not None or args.provider is not None or args.model is not None
|
|
515
|
-
):
|
|
513
|
+
if args.validate and (args.profile is not None or args.provider is not None or args.model is not None):
|
|
516
514
|
print(
|
|
517
515
|
"Error: --validate cannot be combined with --profile, --provider, or --model",
|
|
518
516
|
file=sys.stderr,
|
|
@@ -11,9 +11,7 @@ import yaml
|
|
|
11
11
|
|
|
12
12
|
from .providers import KNOWN
|
|
13
13
|
|
|
14
|
-
_ALLOWED = frozenset(
|
|
15
|
-
{"provider", "model", "ollama-host", "max-context-messages", "stream", "timeout"}
|
|
16
|
-
)
|
|
14
|
+
_ALLOWED = frozenset({"provider", "model", "ollama-host", "max-context-messages", "stream", "timeout"})
|
|
17
15
|
|
|
18
16
|
|
|
19
17
|
class ConfigError(Exception):
|
|
@@ -95,11 +95,12 @@ def _config(system_prompt: str) -> types.GenerateContentConfig:
|
|
|
95
95
|
return types.GenerateContentConfig(system_instruction=system_prompt)
|
|
96
96
|
|
|
97
97
|
|
|
98
|
-
def _contents(messages: list[dict[str, str]]) -> list[
|
|
99
|
-
contents: list[
|
|
98
|
+
def _contents(messages: list[dict[str, str]]) -> list[types.ContentDict]:
|
|
99
|
+
contents: list[types.ContentDict] = []
|
|
100
100
|
for message in messages:
|
|
101
101
|
role = "model" if message["role"] == "assistant" else "user"
|
|
102
|
-
|
|
102
|
+
part: types.PartDict = {"text": message["content"]}
|
|
103
|
+
contents.append({"role": role, "parts": [part]})
|
|
103
104
|
return contents
|
|
104
105
|
|
|
105
106
|
|
{lupaxa_basic_cli_chatbot-0.1.0.dist-info → lupaxa_basic_cli_chatbot-0.1.2.dist-info}/METADATA
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: lupaxa-basic-cli-chatbot
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.2
|
|
4
4
|
Summary: A simple command-line AI chatbot with conversation context.
|
|
5
5
|
Project-URL: Homepage, https://github.com/lupaxa-ai-toolbox/basic-cli-chatbot
|
|
6
6
|
Project-URL: Documentation, https://github.com/lupaxa-ai-toolbox/basic-cli-chatbot
|
{lupaxa_basic_cli_chatbot-0.1.0.dist-info → lupaxa_basic_cli_chatbot-0.1.2.dist-info}/RECORD
RENAMED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
lupaxa/basic_cli_chatbot/__init__.py,sha256=MXPTfLU3IeI3xx6rZeL5nG88Lxz2_FHa31hSsjkzvw4,206
|
|
2
2
|
lupaxa/basic_cli_chatbot/__main__.py,sha256=IpC3HddMjUotCB8D8LmLDqVjOJsLmXy2FtYWjUKgjw0,183
|
|
3
|
-
lupaxa/basic_cli_chatbot/chat.py,sha256=
|
|
4
|
-
lupaxa/basic_cli_chatbot/cli.py,sha256=
|
|
5
|
-
lupaxa/basic_cli_chatbot/config.py,sha256=
|
|
6
|
-
lupaxa/basic_cli_chatbot/version.py,sha256=
|
|
3
|
+
lupaxa/basic_cli_chatbot/chat.py,sha256=34LT-yEAOR6hAlI3CgvO4UXhHeMBSoP7lyLJIOoqo6Y,2154
|
|
4
|
+
lupaxa/basic_cli_chatbot/cli.py,sha256=H1twDJsr-2yZOjNSrx9xkZ9cryk4jD244gXmtG5aJ-Q,18823
|
|
5
|
+
lupaxa/basic_cli_chatbot/config.py,sha256=fDWJW4FFHTh6asHnXu81rMSfe-vqBDdWfkOWslYJo7U,7223
|
|
6
|
+
lupaxa/basic_cli_chatbot/version.py,sha256=tDMV2uzB1kDuVmjUgmBYPuDHagAKPO_2DjRBSZ0_C_8,235
|
|
7
7
|
lupaxa/basic_cli_chatbot/providers/__init__.py,sha256=4TJgNLdYmB7taTEMx8E5tPgVc3K1qHmVNblyMoe4-zM,958
|
|
8
8
|
lupaxa/basic_cli_chatbot/providers/base.py,sha256=oBkRV7QoumuFWhpq2u7tO3igCMdVXyqWfRHqHmzMbyw,847
|
|
9
9
|
lupaxa/basic_cli_chatbot/providers/catalog.py,sha256=CkG8wlJ_PUpmcD1ip6W5-3byAq3w_iRFXSYW59aZDCc,1105
|
|
10
10
|
lupaxa/basic_cli_chatbot/providers/errors.py,sha256=bUUNJSk2thMpykH0ijRk92KkkC38CCHgkHAhV88OQEE,706
|
|
11
|
-
lupaxa/basic_cli_chatbot/providers/gemini.py,sha256=
|
|
11
|
+
lupaxa/basic_cli_chatbot/providers/gemini.py,sha256=5lM4V3Jku0CHZ8f7cjdUP7Cd0EcQWW8FPIOUTZs7sdM,4172
|
|
12
12
|
lupaxa/basic_cli_chatbot/providers/grok.py,sha256=riTl8bW0oiCMYQfgidXyKlW71qD9t5Rcuf-jQdx6-I0,4702
|
|
13
13
|
lupaxa/basic_cli_chatbot/providers/ollama.py,sha256=bnoCYFl5_czxIjHC81K5bBF_Z92nG5UC7eHN4i-JMWw,3670
|
|
14
14
|
lupaxa/basic_cli_chatbot/providers/openai.py,sha256=lOG1JkpWu0iBz4U9pw4ZzA3YgBmzEL7l6V64zR94yQ4,4155
|
|
15
|
-
lupaxa_basic_cli_chatbot-0.1.
|
|
16
|
-
lupaxa_basic_cli_chatbot-0.1.
|
|
17
|
-
lupaxa_basic_cli_chatbot-0.1.
|
|
18
|
-
lupaxa_basic_cli_chatbot-0.1.
|
|
19
|
-
lupaxa_basic_cli_chatbot-0.1.
|
|
15
|
+
lupaxa_basic_cli_chatbot-0.1.2.dist-info/METADATA,sha256=KrdtP6D6UmX3lyKPqQn8OguGJGNbEjaRzbwvkxyshuw,6369
|
|
16
|
+
lupaxa_basic_cli_chatbot-0.1.2.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
|
|
17
|
+
lupaxa_basic_cli_chatbot-0.1.2.dist-info/entry_points.txt,sha256=bhAPBzeY1DWcmw3NQvL2hHe85d9OvtUi4oR2RyRfbuk,72
|
|
18
|
+
lupaxa_basic_cli_chatbot-0.1.2.dist-info/licenses/LICENCE,sha256=RXShyrlT7e281QX54JLm3YrhOlC-TJxObadJl1gH5Es,1070
|
|
19
|
+
lupaxa_basic_cli_chatbot-0.1.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|