chattonpy 1.2.0__tar.gz → 1.2.6__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.
- chattonpy-1.2.6/PKG-INFO +70 -0
- chattonpy-1.2.6/README.md +61 -0
- chattonpy-1.2.6/chattonpy/__init__.py +3 -0
- {chattonpy-1.2.0 → chattonpy-1.2.6}/chattonpy/main.py +7 -5
- chattonpy-1.2.6/examples/1.py +5 -0
- {chattonpy-1.2.0 → chattonpy-1.2.6}/pyproject.toml +2 -2
- chattonpy-1.2.0/PKG-INFO +0 -42
- chattonpy-1.2.0/README.md +0 -33
- chattonpy-1.2.0/chattonpy/__init__.py +0 -3
- {chattonpy-1.2.0 → chattonpy-1.2.6}/.gitignore +0 -0
- {chattonpy-1.2.0 → chattonpy-1.2.6}/.python-version +0 -0
- {chattonpy-1.2.0 → chattonpy-1.2.6}/LICENSE +0 -0
chattonpy-1.2.6/PKG-INFO
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: chattonpy
|
|
3
|
+
Version: 1.2.6
|
|
4
|
+
Summary: A simple python CLI chat interface and a python module for Gemini API
|
|
5
|
+
License-File: LICENSE
|
|
6
|
+
Requires-Python: >=3.11
|
|
7
|
+
Requires-Dist: google-genai
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
|
|
10
|
+
# ChattoNPy
|
|
11
|
+
#### *A simple python CLI chat interface and module for Gemini API*
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
### Install as a CLI Tool
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
pipx install ChattoNPy
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
or via UV:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
uv tool install ChattoNPy
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Install as a Module
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
pip install ChattoNPy
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
or via UV:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
uv add ChattoNPy
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Usage
|
|
40
|
+
|
|
41
|
+
### CLI
|
|
42
|
+
Set the API key as an environment variable:
|
|
43
|
+
|
|
44
|
+
```powershell
|
|
45
|
+
$env:GEMINI_API_KEY="YOUR_API_KEY"
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
On linux/macOS:
|
|
49
|
+
```bash
|
|
50
|
+
export GEMINI_API_KEY="YOUR_API_KEY"
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Then run the tool:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
ChattoNPy
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Module
|
|
60
|
+
|
|
61
|
+
```python
|
|
62
|
+
from chattonpy import generate
|
|
63
|
+
import os
|
|
64
|
+
|
|
65
|
+
response = generate("Tell me a joke", os.environ.get("GEMINI_API_KEY"))
|
|
66
|
+
print(response)
|
|
67
|
+
|
|
68
|
+
response = generate("Tell me a joke", os.environ.get("GEMINI_API_KEY"))
|
|
69
|
+
print(response)
|
|
70
|
+
```
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# ChattoNPy
|
|
2
|
+
#### *A simple python CLI chat interface and module for Gemini API*
|
|
3
|
+
|
|
4
|
+
## Installation
|
|
5
|
+
|
|
6
|
+
### Install as a CLI Tool
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
pipx install ChattoNPy
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
or via UV:
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
uv tool install ChattoNPy
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
### Install as a Module
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
pip install ChattoNPy
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
or via UV:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
uv add ChattoNPy
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Usage
|
|
31
|
+
|
|
32
|
+
### CLI
|
|
33
|
+
Set the API key as an environment variable:
|
|
34
|
+
|
|
35
|
+
```powershell
|
|
36
|
+
$env:GEMINI_API_KEY="YOUR_API_KEY"
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
On linux/macOS:
|
|
40
|
+
```bash
|
|
41
|
+
export GEMINI_API_KEY="YOUR_API_KEY"
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Then run the tool:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
ChattoNPy
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Module
|
|
51
|
+
|
|
52
|
+
```python
|
|
53
|
+
from chattonpy import generate
|
|
54
|
+
import os
|
|
55
|
+
|
|
56
|
+
response = generate("Tell me a joke", os.environ.get("GEMINI_API_KEY"))
|
|
57
|
+
print(response)
|
|
58
|
+
|
|
59
|
+
response = generate("Tell me a joke", os.environ.get("GEMINI_API_KEY"))
|
|
60
|
+
print(response)
|
|
61
|
+
```
|
|
@@ -6,11 +6,11 @@ from google import genai
|
|
|
6
6
|
from google.genai import types
|
|
7
7
|
from typing import List
|
|
8
8
|
|
|
9
|
-
history =
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
def generate(text: str, api_key: str, history: list | None = None):
|
|
10
|
+
if history is None:
|
|
11
|
+
history = []
|
|
12
12
|
client = genai.Client(
|
|
13
|
-
api_key=
|
|
13
|
+
api_key=api_key,
|
|
14
14
|
)
|
|
15
15
|
|
|
16
16
|
model = "gemini-3.5-flash-lite"
|
|
@@ -49,6 +49,8 @@ def generate(text: str, history):
|
|
|
49
49
|
|
|
50
50
|
return "".join(full_response)
|
|
51
51
|
|
|
52
|
+
ChattoNPY = generate
|
|
53
|
+
|
|
52
54
|
def cli():
|
|
53
55
|
"""CLI entrypoint for ChattoNPy."""
|
|
54
56
|
while True:
|
|
@@ -57,7 +59,7 @@ def cli():
|
|
|
57
59
|
if user_input.strip() in ("/quit()"):
|
|
58
60
|
break
|
|
59
61
|
print("\nAI> ")
|
|
60
|
-
output = generate(user_input, history)
|
|
62
|
+
output = generate(user_input, os.environ.get("GEMINI_API_KEY"), history)
|
|
61
63
|
history.append(f"\nUser: {user_input}\nAI: {output}")
|
|
62
64
|
print()
|
|
63
65
|
except (KeyboardInterrupt, EOFError):
|
|
@@ -4,8 +4,8 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "chattonpy"
|
|
7
|
-
version = "1.2.
|
|
8
|
-
description = "A simple python CLI chat interface for Gemini API"
|
|
7
|
+
version = "1.2.6"
|
|
8
|
+
description = "A simple python CLI chat interface and a python module for Gemini API"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.11"
|
|
11
11
|
dependencies = [
|
chattonpy-1.2.0/PKG-INFO
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.5
|
|
2
|
-
Name: chattonpy
|
|
3
|
-
Version: 1.2.0
|
|
4
|
-
Summary: A simple python CLI chat interface for Gemini API
|
|
5
|
-
License-File: LICENSE
|
|
6
|
-
Requires-Python: >=3.11
|
|
7
|
-
Requires-Dist: google-genai
|
|
8
|
-
Description-Content-Type: text/markdown
|
|
9
|
-
|
|
10
|
-
# ChattoNPy
|
|
11
|
-
### A simple python CLI chat interface for Gemini API
|
|
12
|
-
|
|
13
|
-
## Installation
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
pip install ChattoNPy
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
or via UV:
|
|
20
|
-
|
|
21
|
-
```bash
|
|
22
|
-
uv tool install ChattoNPy
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
## Usage
|
|
26
|
-
|
|
27
|
-
Set the API key as an environment variable:
|
|
28
|
-
|
|
29
|
-
```powershell
|
|
30
|
-
$env:GEMINI_API_KEY="YOUR_API_KEY"
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
On linux/macOS:
|
|
34
|
-
```bash
|
|
35
|
-
export GEMINI_API_KEY="YOUR_API_KEY"
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
Then run the tool:
|
|
39
|
-
|
|
40
|
-
```bash
|
|
41
|
-
ChattoNPy
|
|
42
|
-
```
|
chattonpy-1.2.0/README.md
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
# ChattoNPy
|
|
2
|
-
### A simple python CLI chat interface for Gemini API
|
|
3
|
-
|
|
4
|
-
## Installation
|
|
5
|
-
|
|
6
|
-
```bash
|
|
7
|
-
pip install ChattoNPy
|
|
8
|
-
```
|
|
9
|
-
|
|
10
|
-
or via UV:
|
|
11
|
-
|
|
12
|
-
```bash
|
|
13
|
-
uv tool install ChattoNPy
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
## Usage
|
|
17
|
-
|
|
18
|
-
Set the API key as an environment variable:
|
|
19
|
-
|
|
20
|
-
```powershell
|
|
21
|
-
$env:GEMINI_API_KEY="YOUR_API_KEY"
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
On linux/macOS:
|
|
25
|
-
```bash
|
|
26
|
-
export GEMINI_API_KEY="YOUR_API_KEY"
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
Then run the tool:
|
|
30
|
-
|
|
31
|
-
```bash
|
|
32
|
-
ChattoNPy
|
|
33
|
-
```
|
|
File without changes
|
|
File without changes
|
|
File without changes
|