gemini-seminar-client 1.0.0__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.
- gemini_seminar_client-1.0.0/LICENSE +21 -0
- gemini_seminar_client-1.0.0/PKG-INFO +29 -0
- gemini_seminar_client-1.0.0/README.md +15 -0
- gemini_seminar_client-1.0.0/pyproject.toml +23 -0
- gemini_seminar_client-1.0.0/setup.cfg +4 -0
- gemini_seminar_client-1.0.0/src/gemini-seminar-client/__init__.py +84 -0
- gemini_seminar_client-1.0.0/src/gemini_seminar_client.egg-info/PKG-INFO +29 -0
- gemini_seminar_client-1.0.0/src/gemini_seminar_client.egg-info/SOURCES.txt +9 -0
- gemini_seminar_client-1.0.0/src/gemini_seminar_client.egg-info/dependency_links.txt +1 -0
- gemini_seminar_client-1.0.0/src/gemini_seminar_client.egg-info/requires.txt +1 -0
- gemini_seminar_client-1.0.0/src/gemini_seminar_client.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Parsa Abdi
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: gemini-seminar-client
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: A secure Gemini AI gateway client for school projects
|
|
5
|
+
Author-email: Parsa <abdiparsa1390@example.com>
|
|
6
|
+
Classifier: Programming Language :: Python :: 3
|
|
7
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
8
|
+
Classifier: Operating System :: OS Independent
|
|
9
|
+
Requires-Python: >=3.7
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Requires-Dist: requests>=2.25.0
|
|
13
|
+
Dynamic: license-file
|
|
14
|
+
|
|
15
|
+
# Gemini Gateway Client
|
|
16
|
+
|
|
17
|
+
A secure, lightweight Python client designed for school projects to interact with the Gemini AI model safely. This package uses a secure Google Apps Script gateway proxy, ensuring that the main API key remains completely hidden from the client side.
|
|
18
|
+
|
|
19
|
+
## Features
|
|
20
|
+
- **100% Secure:** No API key exposure on the users' computers.
|
|
21
|
+
- **OpenAI-Like Structure:** Supports standard chat history arrays with `system`, `user`, and `assistant` roles.
|
|
22
|
+
- **Easy to Use:** Built-in help function for students.
|
|
23
|
+
|
|
24
|
+
## Installation
|
|
25
|
+
|
|
26
|
+
You can install the package via pip:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
pip install my_school_gemini_client
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Gemini Gateway Client
|
|
2
|
+
|
|
3
|
+
A secure, lightweight Python client designed for school projects to interact with the Gemini AI model safely. This package uses a secure Google Apps Script gateway proxy, ensuring that the main API key remains completely hidden from the client side.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
- **100% Secure:** No API key exposure on the users' computers.
|
|
7
|
+
- **OpenAI-Like Structure:** Supports standard chat history arrays with `system`, `user`, and `assistant` roles.
|
|
8
|
+
- **Easy to Use:** Built-in help function for students.
|
|
9
|
+
|
|
10
|
+
## Installation
|
|
11
|
+
|
|
12
|
+
You can install the package via pip:
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
pip install my_school_gemini_client
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0.0", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "gemini-seminar-client"
|
|
7
|
+
version = "1.0.0"
|
|
8
|
+
authors = [
|
|
9
|
+
{ name="Parsa", email="abdiparsa1390@example.com" },
|
|
10
|
+
]
|
|
11
|
+
description = "A secure Gemini AI gateway client for school projects"
|
|
12
|
+
readme = "README.md"
|
|
13
|
+
requires-python = ">=3.7"
|
|
14
|
+
dependencies = [
|
|
15
|
+
"requests>=2.25.0",
|
|
16
|
+
]
|
|
17
|
+
classifiers = [
|
|
18
|
+
"Programming Language :: Python :: 3",
|
|
19
|
+
"License :: OSI Approved :: MIT License",
|
|
20
|
+
"Operating System :: OS Independent",
|
|
21
|
+
]
|
|
22
|
+
|
|
23
|
+
[project.urls]
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Gemini Gateway Client for School Projects.
|
|
3
|
+
This package allows students to safely interact with Gemini via a secure Google Apps Script proxy.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
import requests
|
|
7
|
+
|
|
8
|
+
__version__ = "1.0.0"
|
|
9
|
+
__all__ = ["ask_ai", "help_info"]
|
|
10
|
+
|
|
11
|
+
def help_info() -> None:
|
|
12
|
+
"""
|
|
13
|
+
Prints the documentation, requirements, and usage examples for this package.
|
|
14
|
+
"""
|
|
15
|
+
usage_guide = """
|
|
16
|
+
===================================================================
|
|
17
|
+
GEMINI GATEWAY CLIENT - USAGE GUIDE
|
|
18
|
+
===================================================================
|
|
19
|
+
|
|
20
|
+
[Description]
|
|
21
|
+
This package allows you to interact with the Gemini AI model safely
|
|
22
|
+
without exposing the main API Key. You only need the project password.
|
|
23
|
+
|
|
24
|
+
[Requirements]
|
|
25
|
+
- Python 3.x
|
|
26
|
+
- 'requests' library (installed automatically)
|
|
27
|
+
|
|
28
|
+
[Function Signatures]
|
|
29
|
+
1. ask_ai(messages: list, password: str) -> str
|
|
30
|
+
- messages: A list of dictionaries representing the chat history.
|
|
31
|
+
- password: The access password provided for the school project.
|
|
32
|
+
|
|
33
|
+
[Example Usage]
|
|
34
|
+
|
|
35
|
+
from your_package_name import ask_ai
|
|
36
|
+
|
|
37
|
+
# 1. Define your chat history (Supports system, user, and assistant roles)
|
|
38
|
+
conversation = [
|
|
39
|
+
{
|
|
40
|
+
"role": "system",
|
|
41
|
+
"content": "You are a helpful science teacher."
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"role": "user",
|
|
45
|
+
"content": "Why is the sky blue?"
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
|
|
49
|
+
# 2. Call the function with your project password
|
|
50
|
+
password = "your_school_password_here"
|
|
51
|
+
response = ask_ai(conversation, password)
|
|
52
|
+
|
|
53
|
+
# 3. Print the AI's answer
|
|
54
|
+
print("AI Response:", response)
|
|
55
|
+
|
|
56
|
+
===================================================================
|
|
57
|
+
"""
|
|
58
|
+
print(usage_guide.strip())
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def ask_ai(messages: list, password: str) -> str:
|
|
62
|
+
"""
|
|
63
|
+
Sends a list of messages to the secure Gemini gateway server.
|
|
64
|
+
"""
|
|
65
|
+
web_app_url = "https://script.google.com/macros/s/AKfycbyQw3uGvBaiA-PbsedOEKIIWehAOeVgt7VZAwwaTph9w4mrMFn7Lis5QVIRdL0Jp8mIzg/exec"
|
|
66
|
+
|
|
67
|
+
payload = {
|
|
68
|
+
"password": password,
|
|
69
|
+
"messages": messages
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
try:
|
|
73
|
+
response = requests.post(web_app_url, json=payload)
|
|
74
|
+
|
|
75
|
+
if response.status_code == 200:
|
|
76
|
+
result = response.json()
|
|
77
|
+
if "error" in result:
|
|
78
|
+
return f"Error: {result['error']}"
|
|
79
|
+
return result.get("response")
|
|
80
|
+
else:
|
|
81
|
+
return f"Error: Failed to connect to the gateway server. Status code: {response.status_code}"
|
|
82
|
+
|
|
83
|
+
except Exception as e:
|
|
84
|
+
return f"System Error: {str(e)}"
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: gemini-seminar-client
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: A secure Gemini AI gateway client for school projects
|
|
5
|
+
Author-email: Parsa <abdiparsa1390@example.com>
|
|
6
|
+
Classifier: Programming Language :: Python :: 3
|
|
7
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
8
|
+
Classifier: Operating System :: OS Independent
|
|
9
|
+
Requires-Python: >=3.7
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Requires-Dist: requests>=2.25.0
|
|
13
|
+
Dynamic: license-file
|
|
14
|
+
|
|
15
|
+
# Gemini Gateway Client
|
|
16
|
+
|
|
17
|
+
A secure, lightweight Python client designed for school projects to interact with the Gemini AI model safely. This package uses a secure Google Apps Script gateway proxy, ensuring that the main API key remains completely hidden from the client side.
|
|
18
|
+
|
|
19
|
+
## Features
|
|
20
|
+
- **100% Secure:** No API key exposure on the users' computers.
|
|
21
|
+
- **OpenAI-Like Structure:** Supports standard chat history arrays with `system`, `user`, and `assistant` roles.
|
|
22
|
+
- **Easy to Use:** Built-in help function for students.
|
|
23
|
+
|
|
24
|
+
## Installation
|
|
25
|
+
|
|
26
|
+
You can install the package via pip:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
pip install my_school_gemini_client
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
src/gemini-seminar-client/__init__.py
|
|
5
|
+
src/gemini_seminar_client.egg-info/PKG-INFO
|
|
6
|
+
src/gemini_seminar_client.egg-info/SOURCES.txt
|
|
7
|
+
src/gemini_seminar_client.egg-info/dependency_links.txt
|
|
8
|
+
src/gemini_seminar_client.egg-info/requires.txt
|
|
9
|
+
src/gemini_seminar_client.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
requests>=2.25.0
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
gemini-seminar-client
|