vspagent 2.2.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.
vspagent-2.2.0/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 Vishnu Suresh Perumbavoor
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.
22
+
@@ -0,0 +1,206 @@
1
+ Metadata-Version: 2.4
2
+ Name: vspagent
3
+ Version: 2.2.0
4
+ Summary: AI-powered chat agent about Vishnu Suresh Perumbavoor. Powered by Qwen2.5-0.5B.
5
+ Home-page: https://github.com/vishnusureshperumbavoor/vsp_bot
6
+ Author: Vishnu Suresh Perumbavoor
7
+ Author-email: vishnusureshperumbavoor@gmail.com
8
+ Project-URL: Bug Tracker, https://github.com/vishnusureshperumbavoor/vsp_bot/issues
9
+ Project-URL: LinkedIn, https://www.linkedin.com/in/vishnu-suresh-perumbavoor/
10
+ Project-URL: GitHub, https://github.com/vishnusureshperumbavoor
11
+ Keywords: ai agent chatbot qwen llm vsp transformers
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.8
18
+ Classifier: Programming Language :: Python :: 3.9
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Requires-Python: >=3.8
22
+ Description-Content-Type: text/markdown
23
+ License-File: LICENSE
24
+ Requires-Dist: transformers>=4.30.0
25
+ Requires-Dist: torch>=2.0.0
26
+ Dynamic: author
27
+ Dynamic: author-email
28
+ Dynamic: classifier
29
+ Dynamic: description
30
+ Dynamic: description-content-type
31
+ Dynamic: home-page
32
+ Dynamic: keywords
33
+ Dynamic: license-file
34
+ Dynamic: project-url
35
+ Dynamic: requires-dist
36
+ Dynamic: requires-python
37
+ Dynamic: summary
38
+
39
+ # πŸ€– VSP Agent
40
+
41
+ [![PyPI version](https://badge.fury.io/py/vspagent.svg)](https://pypi.org/project/vspagent/)
42
+ [![Python Versions](https://img.shields.io/pypi/pyversions/vspagent.svg)](https://pypi.org/project/vspagent/)
43
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
44
+
45
+ **AI-powered chat agent about Vishnu Suresh Perumbavoor. Powered by Qwen2.5-0.5B.**
46
+
47
+ ## πŸš€ Features
48
+
49
+ - 🧠 **AI Chat**: Interactive conversations powered by Qwen2.5-0.5B language model
50
+ - πŸ’¬ **Natural Language**: Ask anything about VSP in plain English
51
+ - 🧠 **Conversation Memory**: Maintains context throughout the chat session
52
+ - ⚑ **GPU Acceleration**: Automatic GPU support for 30-50x faster responses
53
+ - 🎯 **CLI Interface**: Easy-to-use command-line interface
54
+ - 🐍 **Python API**: Programmatic access for developers
55
+
56
+ ## πŸ“¦ Installation
57
+
58
+ ```bash
59
+ pip install vspagent
60
+ ```
61
+
62
+ ## 🎯 Quick Start
63
+
64
+ ### CLI Mode
65
+
66
+ Simply run:
67
+
68
+ ```bash
69
+ vspagent-py
70
+ ```
71
+
72
+ This launches an **interactive chat session** with the VSP Agent!
73
+
74
+ **Example Chat Session:**
75
+ ```
76
+ πŸ’¬ You: Who is VSP?
77
+ πŸ€– VSP Agent: VSP stands for Vishnu Suresh Perumbavoor. He is the founder
78
+ of VSP Enterprises and VSP Intelligence. He's a Software Engineer, Singer,
79
+ and YouTuber...
80
+
81
+ πŸ’¬ You: What technologies does he use?
82
+ πŸ€– VSP Agent: He works with React, Node.js, FastAPI, Docker, MongoDB...
83
+
84
+ πŸ’¬ You: What has he accomplished?
85
+ πŸ€– VSP Agent: He won 3rd prize in Vaiga Agrihack 2023...
86
+
87
+ πŸ’¬ You: exit
88
+ πŸ‘‹ Thanks for chatting!
89
+ ```
90
+
91
+ **Features:**
92
+ - πŸ€– AI-powered conversations with Qwen2.5-0.5B
93
+ - πŸ’¬ Natural language understanding
94
+ - 🧠 Conversation memory (maintains context)
95
+ - ⚑ GPU acceleration (30-50x faster if available)
96
+ - 🎯 Simple and focused on chatting about VSP
97
+
98
+ **Note:** Command is `vspagent-py` (not `vspagent`) to avoid conflicts with the JavaScript version.
99
+
100
+ ### Python API
101
+
102
+ ```python
103
+ from vspagent import VSPAgent, biodata
104
+
105
+ # Create agent instance
106
+ agent = VSPAgent()
107
+
108
+ # Initialize AI model (loads Qwen2.5-0.5B)
109
+ agent.init_ai()
110
+
111
+ # Chat with the agent
112
+ response = agent.chat("Who is VSP?")
113
+ print(response)
114
+
115
+ # Continue conversation with context
116
+ conversation_history = []
117
+ conversation_history.append({"role": "user", "content": "Who is VSP?"})
118
+ conversation_history.append({"role": "assistant", "content": response})
119
+
120
+ response2 = agent.chat("What technologies does he use?", conversation_history)
121
+ print(response2)
122
+
123
+ # Access biodata directly
124
+ print(biodata['creator'])
125
+ print(biodata['technologies'])
126
+ ```
127
+
128
+ ## πŸ“š API Reference
129
+
130
+ ### `VSPAgent` Class
131
+
132
+ #### Methods
133
+
134
+ - **`init_ai()`**: Initialize the Qwen2.5-0.5B AI model (required before chatting)
135
+ - **`chat(message, conversation_history=None)`**: Chat with the AI agent
136
+ - `message` (str): Your question or message
137
+ - `conversation_history` (list, optional): Previous conversation for context
138
+ - Returns: AI-generated response as string
139
+
140
+ ### `biodata` Dictionary
141
+
142
+ Contains comprehensive information about Vishnu Suresh Perumbavoor:
143
+ - Personal information
144
+ - Founder companies
145
+ - Technologies and skills
146
+ - Accomplishments
147
+ - Social media links
148
+
149
+ ## πŸ› οΈ Requirements
150
+
151
+ - Python 3.8+
152
+ - transformers >= 4.30.0
153
+ - torch >= 2.0.0
154
+
155
+ ## 🎨 Using the CLI
156
+
157
+ When running `vspagent-py`:
158
+ - Simply type your questions or messages
159
+ - The AI will respond with information about VSP
160
+ - Type `exit` or `quit` to end the conversation
161
+ - Conversation context is maintained throughout the session
162
+
163
+ ## πŸ‘¨β€πŸ’» About VSP
164
+
165
+ **Vishnu Suresh Perumbavoor** is the founder of VSP Enterprises and VSP Intelligence. He's a:
166
+ - Software Engineer
167
+ - Singer
168
+ - YouTuber
169
+ - Technology enthusiast
170
+
171
+ ### πŸ† Accomplishments
172
+ - Won 3rd prize in Vaiga Agrihack 2023
173
+ - Participated in Rajasthan IT Hackathon 2023
174
+ - Won 1st prize in startup idea presentation at Palakkad
175
+
176
+ ### πŸ”§ Technologies
177
+ React, Node.js, FastAPI, Express, MongoDB, Docker, OHIF, Cornerstone3D, VTKjs, DICOM
178
+
179
+ ## πŸ”— Connect
180
+
181
+ - πŸ’Ό [LinkedIn](https://www.linkedin.com/in/vishnu-suresh-perumbavoor/)
182
+ - πŸ™ [GitHub](https://github.com/vishnusureshperumbavoor)
183
+ - 🐦 [Twitter](https://twitter.com/vspeeeeee)
184
+ - πŸ“Ί [YouTube](https://www.youtube.com/@vishnusureshperumbavoor9721/videos)
185
+ - πŸ“· [Instagram](https://www.instagram.com/vishnusureshperumbavoor/)
186
+
187
+ ## πŸ“„ License
188
+
189
+ MIT License - see LICENSE file for details
190
+
191
+ ## 🀝 Contributing
192
+
193
+ Contributions are welcome! Please feel free to submit a Pull Request.
194
+
195
+ ## πŸ› Issues
196
+
197
+ Found a bug? [Report it here](https://github.com/vishnusureshperumbavoor/vsp_bot/issues)
198
+
199
+ ## πŸ“ˆ Version
200
+
201
+ Current version: **2.2.0**
202
+
203
+ ---
204
+
205
+ Made with ❀️ by Vishnu Suresh Perumbavoor
206
+
@@ -0,0 +1,168 @@
1
+ # πŸ€– VSP Agent
2
+
3
+ [![PyPI version](https://badge.fury.io/py/vspagent.svg)](https://pypi.org/project/vspagent/)
4
+ [![Python Versions](https://img.shields.io/pypi/pyversions/vspagent.svg)](https://pypi.org/project/vspagent/)
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
6
+
7
+ **AI-powered chat agent about Vishnu Suresh Perumbavoor. Powered by Qwen2.5-0.5B.**
8
+
9
+ ## πŸš€ Features
10
+
11
+ - 🧠 **AI Chat**: Interactive conversations powered by Qwen2.5-0.5B language model
12
+ - πŸ’¬ **Natural Language**: Ask anything about VSP in plain English
13
+ - 🧠 **Conversation Memory**: Maintains context throughout the chat session
14
+ - ⚑ **GPU Acceleration**: Automatic GPU support for 30-50x faster responses
15
+ - 🎯 **CLI Interface**: Easy-to-use command-line interface
16
+ - 🐍 **Python API**: Programmatic access for developers
17
+
18
+ ## πŸ“¦ Installation
19
+
20
+ ```bash
21
+ pip install vspagent
22
+ ```
23
+
24
+ ## 🎯 Quick Start
25
+
26
+ ### CLI Mode
27
+
28
+ Simply run:
29
+
30
+ ```bash
31
+ vspagent-py
32
+ ```
33
+
34
+ This launches an **interactive chat session** with the VSP Agent!
35
+
36
+ **Example Chat Session:**
37
+ ```
38
+ πŸ’¬ You: Who is VSP?
39
+ πŸ€– VSP Agent: VSP stands for Vishnu Suresh Perumbavoor. He is the founder
40
+ of VSP Enterprises and VSP Intelligence. He's a Software Engineer, Singer,
41
+ and YouTuber...
42
+
43
+ πŸ’¬ You: What technologies does he use?
44
+ πŸ€– VSP Agent: He works with React, Node.js, FastAPI, Docker, MongoDB...
45
+
46
+ πŸ’¬ You: What has he accomplished?
47
+ πŸ€– VSP Agent: He won 3rd prize in Vaiga Agrihack 2023...
48
+
49
+ πŸ’¬ You: exit
50
+ πŸ‘‹ Thanks for chatting!
51
+ ```
52
+
53
+ **Features:**
54
+ - πŸ€– AI-powered conversations with Qwen2.5-0.5B
55
+ - πŸ’¬ Natural language understanding
56
+ - 🧠 Conversation memory (maintains context)
57
+ - ⚑ GPU acceleration (30-50x faster if available)
58
+ - 🎯 Simple and focused on chatting about VSP
59
+
60
+ **Note:** Command is `vspagent-py` (not `vspagent`) to avoid conflicts with the JavaScript version.
61
+
62
+ ### Python API
63
+
64
+ ```python
65
+ from vspagent import VSPAgent, biodata
66
+
67
+ # Create agent instance
68
+ agent = VSPAgent()
69
+
70
+ # Initialize AI model (loads Qwen2.5-0.5B)
71
+ agent.init_ai()
72
+
73
+ # Chat with the agent
74
+ response = agent.chat("Who is VSP?")
75
+ print(response)
76
+
77
+ # Continue conversation with context
78
+ conversation_history = []
79
+ conversation_history.append({"role": "user", "content": "Who is VSP?"})
80
+ conversation_history.append({"role": "assistant", "content": response})
81
+
82
+ response2 = agent.chat("What technologies does he use?", conversation_history)
83
+ print(response2)
84
+
85
+ # Access biodata directly
86
+ print(biodata['creator'])
87
+ print(biodata['technologies'])
88
+ ```
89
+
90
+ ## πŸ“š API Reference
91
+
92
+ ### `VSPAgent` Class
93
+
94
+ #### Methods
95
+
96
+ - **`init_ai()`**: Initialize the Qwen2.5-0.5B AI model (required before chatting)
97
+ - **`chat(message, conversation_history=None)`**: Chat with the AI agent
98
+ - `message` (str): Your question or message
99
+ - `conversation_history` (list, optional): Previous conversation for context
100
+ - Returns: AI-generated response as string
101
+
102
+ ### `biodata` Dictionary
103
+
104
+ Contains comprehensive information about Vishnu Suresh Perumbavoor:
105
+ - Personal information
106
+ - Founder companies
107
+ - Technologies and skills
108
+ - Accomplishments
109
+ - Social media links
110
+
111
+ ## πŸ› οΈ Requirements
112
+
113
+ - Python 3.8+
114
+ - transformers >= 4.30.0
115
+ - torch >= 2.0.0
116
+
117
+ ## 🎨 Using the CLI
118
+
119
+ When running `vspagent-py`:
120
+ - Simply type your questions or messages
121
+ - The AI will respond with information about VSP
122
+ - Type `exit` or `quit` to end the conversation
123
+ - Conversation context is maintained throughout the session
124
+
125
+ ## πŸ‘¨β€πŸ’» About VSP
126
+
127
+ **Vishnu Suresh Perumbavoor** is the founder of VSP Enterprises and VSP Intelligence. He's a:
128
+ - Software Engineer
129
+ - Singer
130
+ - YouTuber
131
+ - Technology enthusiast
132
+
133
+ ### πŸ† Accomplishments
134
+ - Won 3rd prize in Vaiga Agrihack 2023
135
+ - Participated in Rajasthan IT Hackathon 2023
136
+ - Won 1st prize in startup idea presentation at Palakkad
137
+
138
+ ### πŸ”§ Technologies
139
+ React, Node.js, FastAPI, Express, MongoDB, Docker, OHIF, Cornerstone3D, VTKjs, DICOM
140
+
141
+ ## πŸ”— Connect
142
+
143
+ - πŸ’Ό [LinkedIn](https://www.linkedin.com/in/vishnu-suresh-perumbavoor/)
144
+ - πŸ™ [GitHub](https://github.com/vishnusureshperumbavoor)
145
+ - 🐦 [Twitter](https://twitter.com/vspeeeeee)
146
+ - πŸ“Ί [YouTube](https://www.youtube.com/@vishnusureshperumbavoor9721/videos)
147
+ - πŸ“· [Instagram](https://www.instagram.com/vishnusureshperumbavoor/)
148
+
149
+ ## πŸ“„ License
150
+
151
+ MIT License - see LICENSE file for details
152
+
153
+ ## 🀝 Contributing
154
+
155
+ Contributions are welcome! Please feel free to submit a Pull Request.
156
+
157
+ ## πŸ› Issues
158
+
159
+ Found a bug? [Report it here](https://github.com/vishnusureshperumbavoor/vsp_bot/issues)
160
+
161
+ ## πŸ“ˆ Version
162
+
163
+ Current version: **2.2.0**
164
+
165
+ ---
166
+
167
+ Made with ❀️ by Vishnu Suresh Perumbavoor
168
+
@@ -0,0 +1,10 @@
1
+ # VSP Agent - Core Dependencies
2
+ transformers>=4.30.0
3
+ torch>=2.0.0
4
+
5
+ # Development Dependencies
6
+ build>=0.10.0
7
+ twine>=4.0.0
8
+ setuptools>=65.0.0
9
+ wheel>=0.38.0
10
+
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,45 @@
1
+ from setuptools import setup, find_packages
2
+
3
+ with open("README.md", "r", encoding="utf-8") as fh:
4
+ long_description = fh.read()
5
+
6
+ setup(
7
+ name="vspagent",
8
+ version="2.2.0",
9
+ author="Vishnu Suresh Perumbavoor",
10
+ author_email="vishnusureshperumbavoor@gmail.com",
11
+ description="AI-powered chat agent about Vishnu Suresh Perumbavoor. Powered by Qwen2.5-0.5B.",
12
+ long_description=long_description,
13
+ long_description_content_type="text/markdown",
14
+ url="https://github.com/vishnusureshperumbavoor/vsp_bot",
15
+ project_urls={
16
+ "Bug Tracker": "https://github.com/vishnusureshperumbavoor/vsp_bot/issues",
17
+ "LinkedIn": "https://www.linkedin.com/in/vishnu-suresh-perumbavoor/",
18
+ "GitHub": "https://github.com/vishnusureshperumbavoor",
19
+ },
20
+ classifiers=[
21
+ "Development Status :: 4 - Beta",
22
+ "Intended Audience :: Developers",
23
+ "Topic :: Scientific/Engineering :: Artificial Intelligence",
24
+ "License :: OSI Approved :: MIT License",
25
+ "Programming Language :: Python :: 3",
26
+ "Programming Language :: Python :: 3.8",
27
+ "Programming Language :: Python :: 3.9",
28
+ "Programming Language :: Python :: 3.10",
29
+ "Programming Language :: Python :: 3.11",
30
+ ],
31
+ packages=find_packages(),
32
+ python_requires=">=3.8",
33
+ install_requires=[
34
+ "transformers>=4.30.0",
35
+ "torch>=2.0.0",
36
+ ],
37
+ entry_points={
38
+ "console_scripts": [
39
+ "vspagent-py=vspagent.cli:main",
40
+ # Alternative: "pyvspagent=vspagent.cli:main",
41
+ ],
42
+ },
43
+ keywords="ai agent chatbot qwen llm vsp transformers",
44
+ )
45
+
@@ -0,0 +1,9 @@
1
+ """VSP Agent - AI-powered agent for Vishnu Suresh Perumbavoor"""
2
+
3
+ __version__ = "2.2.0"
4
+ __author__ = "Vishnu Suresh Perumbavoor"
5
+
6
+ from .agent import VSPAgent, biodata
7
+
8
+ __all__ = ["VSPAgent", "biodata"]
9
+
@@ -0,0 +1,134 @@
1
+ """VSP Agent - Core functionality"""
2
+
3
+ from typing import List, Optional
4
+
5
+ # Biodata
6
+ biodata = {
7
+ "name": "VSP Agent",
8
+ "creator": "Vishnu Suresh Perumbavoor",
9
+ "founder_of": ["VSP Enterprises", "VSP Intelligence"],
10
+ "created_on": "28 April 2023",
11
+ "marital_status": "Single (Not married)",
12
+ "political_affiliation": "None",
13
+ "education": "Not a graduate (No degree)",
14
+ "roles": ["SWE", "Singer", "YouTuber"],
15
+ "interests": ["startups", "engineering", "geopolitics", "history"],
16
+ "corporate": ["Trenser"],
17
+ "technologies": [
18
+ "React", "Node.js", "FastAPI", "Express", "MongoDB",
19
+ "Docker", "OHIF", "Cornerstone3D", "VTKjs", "DICOM"
20
+ ],
21
+ "accomplishments": [
22
+ "Won 3rd prize in Vaiga Agrihack 2023",
23
+ "Participated in Rajasthan IT Hackathon 2023",
24
+ "Won 1st prize in startup idea presentation at Palakkad"
25
+ ],
26
+ "socials": {
27
+ "linkedin": "https://www.linkedin.com/in/vishnu-suresh-perumbavoor/",
28
+ "twitter": "https://twitter.com/vspeeeeee",
29
+ "github": "https://github.com/vishnusureshperumbavoor",
30
+ "youtube": "https://www.youtube.com/@vishnusureshperumbavoor9721/videos",
31
+ "instagram": "https://www.instagram.com/vishnusureshperumbavoor/",
32
+ }
33
+ }
34
+
35
+
36
+ class VSPAgent:
37
+ """AI-powered agent for VSP information"""
38
+
39
+ def __init__(self):
40
+ self.biodata = biodata
41
+ self.model = None
42
+ self.tokenizer = None
43
+
44
+ def init_ai(self):
45
+ """Initialize AI model (Qwen2.5-0.5B)"""
46
+ try:
47
+ from transformers import AutoTokenizer, AutoModelForCausalLM
48
+ import torch
49
+
50
+ print("πŸš€ Initializing VSP Agent...")
51
+ print(" 🧠 Loading AI brain with Qwen2.5-0.5B...")
52
+
53
+ model_name = "Qwen/Qwen2.5-0.5B-Instruct"
54
+
55
+ self.tokenizer = AutoTokenizer.from_pretrained(model_name)
56
+
57
+ # Load model with GPU optimization
58
+ if torch.cuda.is_available():
59
+ # GPU: Use FP16 for 2x faster inference
60
+ self.model = AutoModelForCausalLM.from_pretrained(
61
+ model_name,
62
+ torch_dtype=torch.float16
63
+ ).cuda()
64
+ device_info = f"GPU (CUDA) - FP16 Optimized"
65
+ else:
66
+ # CPU: Use default precision
67
+ self.model = AutoModelForCausalLM.from_pretrained(
68
+ model_name,
69
+ torch_dtype=torch.float32
70
+ )
71
+ device_info = "CPU"
72
+
73
+ print("βœ… VSP Agent is ready!")
74
+ print(f" πŸ€– Device: {device_info}")
75
+
76
+ except Exception as e:
77
+ print(f"❌ Error initializing AI: {e}")
78
+ print("πŸ’‘ Install required packages: pip install transformers torch")
79
+
80
+ def chat(self, message: str, conversation_history: Optional[List] = None) -> str:
81
+ """Chat with the AI agent"""
82
+ if self.model is None:
83
+ return "Please initialize AI first using init_ai()"
84
+
85
+ system_context = f"""You are an AI assistant answering questions about Vishnu Suresh Perumbavoor (VSP).
86
+
87
+ Key Facts:
88
+ - Name: {self.biodata['creator']}
89
+ - Marital Status: {self.biodata['marital_status']}
90
+ - Education: {self.biodata['education']}
91
+ - Founder: {', '.join(self.biodata['founder_of'])} (founded {self.biodata['created_on']})
92
+ - Works at: {', '.join(self.biodata['corporate'])}
93
+ - Roles: {', '.join(self.biodata['roles'])}
94
+ - Tech Stack: {', '.join(self.biodata['technologies'][:6])}
95
+ - Interests: {', '.join(self.biodata['interests'])}
96
+ - Achievements: 3rd prize Vaiga Agrihack 2023, 1st prize startup presentation Palakkad
97
+ - Social: LinkedIn, GitHub, YouTube, Twitter, Instagram
98
+
99
+ Answer concisely and naturally using "he/his" (third person). Only use facts above."""
100
+
101
+ messages = [{"role": "system", "content": system_context}]
102
+
103
+ if conversation_history:
104
+ messages.extend(conversation_history)
105
+
106
+ messages.append({"role": "user", "content": message})
107
+
108
+ try:
109
+ # Generate response
110
+ inputs = self.tokenizer.apply_chat_template(
111
+ messages,
112
+ return_tensors="pt",
113
+ add_generation_prompt=True
114
+ ).to(self.model.device)
115
+
116
+ outputs = self.model.generate(
117
+ inputs,
118
+ max_new_tokens=256,
119
+ do_sample=True,
120
+ temperature=0.7,
121
+ top_p=0.9,
122
+ pad_token_id=self.tokenizer.eos_token_id
123
+ )
124
+
125
+ # Decode only the new tokens (not the input)
126
+ generated_ids = outputs[0][inputs.shape[1]:]
127
+ response = self.tokenizer.decode(generated_ids, skip_special_tokens=True).strip()
128
+
129
+ return response
130
+
131
+ except Exception as e:
132
+ return f"Error generating response: {e}"
133
+
134
+
@@ -0,0 +1,106 @@
1
+ """VSP Agent - CLI Interface"""
2
+
3
+ import sys
4
+ import io
5
+ import time
6
+ import threading
7
+ from .agent import VSPAgent
8
+
9
+ # Fix Windows console encoding
10
+ if sys.platform == 'win32':
11
+ try:
12
+ sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8', errors='replace')
13
+ sys.stderr = io.TextIOWrapper(sys.stderr.buffer, encoding='utf-8', errors='replace')
14
+ except:
15
+ pass
16
+
17
+
18
+ class Spinner:
19
+ """Animated spinner for thinking indicator"""
20
+ def __init__(self):
21
+ self.spinning = False
22
+ self.thread = None
23
+ self.frames = ['β ‹', 'β ™', 'β Ή', 'β Έ', 'β Ό', 'β ΄', 'β ¦', 'β §', 'β ‡', '⠏']
24
+
25
+ def start(self):
26
+ self.spinning = True
27
+ self.thread = threading.Thread(target=self._animate)
28
+ self.thread.start()
29
+
30
+ def _animate(self):
31
+ idx = 0
32
+ while self.spinning:
33
+ print(f'\r{self.frames[idx]} Thinking...', end='', flush=True)
34
+ idx = (idx + 1) % len(self.frames)
35
+ time.sleep(0.1)
36
+
37
+ def stop(self):
38
+ self.spinning = False
39
+ if self.thread:
40
+ self.thread.join()
41
+ print('\r' + ' ' * 20 + '\r', end='', flush=True)
42
+
43
+
44
+ def main():
45
+ """Main CLI entry point"""
46
+ print("=" * 62)
47
+ print(" πŸ€– VSP Agent - Interactive Chat Mode")
48
+ print(" Powered by Qwen2.5-0.5B AI")
49
+ print("=" * 62)
50
+ print()
51
+
52
+ agent = VSPAgent()
53
+
54
+ try:
55
+ agent.init_ai()
56
+ except Exception as e:
57
+ print(f"❌ Error: {e}")
58
+ print("\nπŸ’‘ Try: pip install transformers torch")
59
+ return
60
+
61
+ print("\nβœ… VSP Agent is ready to chat!\n")
62
+ print("Type 'exit' or 'quit' to end the conversation.\n")
63
+
64
+ conversation_history = []
65
+
66
+ while True:
67
+ try:
68
+ user_input = input("πŸ’¬ You: ").strip()
69
+
70
+ if not user_input:
71
+ continue
72
+
73
+ if user_input.lower() in ['exit', 'quit']:
74
+ print("\nπŸ‘‹ Thanks for chatting with VSP Agent! Goodbye! πŸš€\n")
75
+ break
76
+
77
+ # Start spinner and timer
78
+ spinner = Spinner()
79
+ spinner.start()
80
+ start_time = time.time()
81
+
82
+ # Get AI response
83
+ response = agent.chat(user_input, conversation_history)
84
+
85
+ # Stop spinner and calculate time
86
+ elapsed_time = time.time() - start_time
87
+ spinner.stop()
88
+
89
+ # Show response with timing
90
+ print(f"πŸ€– VSP Agent: {response}")
91
+ print(f" ⏱️ Response time: {elapsed_time:.2f}s\n")
92
+
93
+ # Update history
94
+ conversation_history.append({"role": "user", "content": user_input})
95
+ conversation_history.append({"role": "assistant", "content": response})
96
+
97
+ except KeyboardInterrupt:
98
+ print("\n\nπŸ‘‹ Goodbye!\n")
99
+ break
100
+ except Exception as e:
101
+ print(f"\n❌ Error: {e}\n")
102
+
103
+
104
+ if __name__ == "__main__":
105
+ main()
106
+
@@ -0,0 +1,206 @@
1
+ Metadata-Version: 2.4
2
+ Name: vspagent
3
+ Version: 2.2.0
4
+ Summary: AI-powered chat agent about Vishnu Suresh Perumbavoor. Powered by Qwen2.5-0.5B.
5
+ Home-page: https://github.com/vishnusureshperumbavoor/vsp_bot
6
+ Author: Vishnu Suresh Perumbavoor
7
+ Author-email: vishnusureshperumbavoor@gmail.com
8
+ Project-URL: Bug Tracker, https://github.com/vishnusureshperumbavoor/vsp_bot/issues
9
+ Project-URL: LinkedIn, https://www.linkedin.com/in/vishnu-suresh-perumbavoor/
10
+ Project-URL: GitHub, https://github.com/vishnusureshperumbavoor
11
+ Keywords: ai agent chatbot qwen llm vsp transformers
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.8
18
+ Classifier: Programming Language :: Python :: 3.9
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Requires-Python: >=3.8
22
+ Description-Content-Type: text/markdown
23
+ License-File: LICENSE
24
+ Requires-Dist: transformers>=4.30.0
25
+ Requires-Dist: torch>=2.0.0
26
+ Dynamic: author
27
+ Dynamic: author-email
28
+ Dynamic: classifier
29
+ Dynamic: description
30
+ Dynamic: description-content-type
31
+ Dynamic: home-page
32
+ Dynamic: keywords
33
+ Dynamic: license-file
34
+ Dynamic: project-url
35
+ Dynamic: requires-dist
36
+ Dynamic: requires-python
37
+ Dynamic: summary
38
+
39
+ # πŸ€– VSP Agent
40
+
41
+ [![PyPI version](https://badge.fury.io/py/vspagent.svg)](https://pypi.org/project/vspagent/)
42
+ [![Python Versions](https://img.shields.io/pypi/pyversions/vspagent.svg)](https://pypi.org/project/vspagent/)
43
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
44
+
45
+ **AI-powered chat agent about Vishnu Suresh Perumbavoor. Powered by Qwen2.5-0.5B.**
46
+
47
+ ## πŸš€ Features
48
+
49
+ - 🧠 **AI Chat**: Interactive conversations powered by Qwen2.5-0.5B language model
50
+ - πŸ’¬ **Natural Language**: Ask anything about VSP in plain English
51
+ - 🧠 **Conversation Memory**: Maintains context throughout the chat session
52
+ - ⚑ **GPU Acceleration**: Automatic GPU support for 30-50x faster responses
53
+ - 🎯 **CLI Interface**: Easy-to-use command-line interface
54
+ - 🐍 **Python API**: Programmatic access for developers
55
+
56
+ ## πŸ“¦ Installation
57
+
58
+ ```bash
59
+ pip install vspagent
60
+ ```
61
+
62
+ ## 🎯 Quick Start
63
+
64
+ ### CLI Mode
65
+
66
+ Simply run:
67
+
68
+ ```bash
69
+ vspagent-py
70
+ ```
71
+
72
+ This launches an **interactive chat session** with the VSP Agent!
73
+
74
+ **Example Chat Session:**
75
+ ```
76
+ πŸ’¬ You: Who is VSP?
77
+ πŸ€– VSP Agent: VSP stands for Vishnu Suresh Perumbavoor. He is the founder
78
+ of VSP Enterprises and VSP Intelligence. He's a Software Engineer, Singer,
79
+ and YouTuber...
80
+
81
+ πŸ’¬ You: What technologies does he use?
82
+ πŸ€– VSP Agent: He works with React, Node.js, FastAPI, Docker, MongoDB...
83
+
84
+ πŸ’¬ You: What has he accomplished?
85
+ πŸ€– VSP Agent: He won 3rd prize in Vaiga Agrihack 2023...
86
+
87
+ πŸ’¬ You: exit
88
+ πŸ‘‹ Thanks for chatting!
89
+ ```
90
+
91
+ **Features:**
92
+ - πŸ€– AI-powered conversations with Qwen2.5-0.5B
93
+ - πŸ’¬ Natural language understanding
94
+ - 🧠 Conversation memory (maintains context)
95
+ - ⚑ GPU acceleration (30-50x faster if available)
96
+ - 🎯 Simple and focused on chatting about VSP
97
+
98
+ **Note:** Command is `vspagent-py` (not `vspagent`) to avoid conflicts with the JavaScript version.
99
+
100
+ ### Python API
101
+
102
+ ```python
103
+ from vspagent import VSPAgent, biodata
104
+
105
+ # Create agent instance
106
+ agent = VSPAgent()
107
+
108
+ # Initialize AI model (loads Qwen2.5-0.5B)
109
+ agent.init_ai()
110
+
111
+ # Chat with the agent
112
+ response = agent.chat("Who is VSP?")
113
+ print(response)
114
+
115
+ # Continue conversation with context
116
+ conversation_history = []
117
+ conversation_history.append({"role": "user", "content": "Who is VSP?"})
118
+ conversation_history.append({"role": "assistant", "content": response})
119
+
120
+ response2 = agent.chat("What technologies does he use?", conversation_history)
121
+ print(response2)
122
+
123
+ # Access biodata directly
124
+ print(biodata['creator'])
125
+ print(biodata['technologies'])
126
+ ```
127
+
128
+ ## πŸ“š API Reference
129
+
130
+ ### `VSPAgent` Class
131
+
132
+ #### Methods
133
+
134
+ - **`init_ai()`**: Initialize the Qwen2.5-0.5B AI model (required before chatting)
135
+ - **`chat(message, conversation_history=None)`**: Chat with the AI agent
136
+ - `message` (str): Your question or message
137
+ - `conversation_history` (list, optional): Previous conversation for context
138
+ - Returns: AI-generated response as string
139
+
140
+ ### `biodata` Dictionary
141
+
142
+ Contains comprehensive information about Vishnu Suresh Perumbavoor:
143
+ - Personal information
144
+ - Founder companies
145
+ - Technologies and skills
146
+ - Accomplishments
147
+ - Social media links
148
+
149
+ ## πŸ› οΈ Requirements
150
+
151
+ - Python 3.8+
152
+ - transformers >= 4.30.0
153
+ - torch >= 2.0.0
154
+
155
+ ## 🎨 Using the CLI
156
+
157
+ When running `vspagent-py`:
158
+ - Simply type your questions or messages
159
+ - The AI will respond with information about VSP
160
+ - Type `exit` or `quit` to end the conversation
161
+ - Conversation context is maintained throughout the session
162
+
163
+ ## πŸ‘¨β€πŸ’» About VSP
164
+
165
+ **Vishnu Suresh Perumbavoor** is the founder of VSP Enterprises and VSP Intelligence. He's a:
166
+ - Software Engineer
167
+ - Singer
168
+ - YouTuber
169
+ - Technology enthusiast
170
+
171
+ ### πŸ† Accomplishments
172
+ - Won 3rd prize in Vaiga Agrihack 2023
173
+ - Participated in Rajasthan IT Hackathon 2023
174
+ - Won 1st prize in startup idea presentation at Palakkad
175
+
176
+ ### πŸ”§ Technologies
177
+ React, Node.js, FastAPI, Express, MongoDB, Docker, OHIF, Cornerstone3D, VTKjs, DICOM
178
+
179
+ ## πŸ”— Connect
180
+
181
+ - πŸ’Ό [LinkedIn](https://www.linkedin.com/in/vishnu-suresh-perumbavoor/)
182
+ - πŸ™ [GitHub](https://github.com/vishnusureshperumbavoor)
183
+ - 🐦 [Twitter](https://twitter.com/vspeeeeee)
184
+ - πŸ“Ί [YouTube](https://www.youtube.com/@vishnusureshperumbavoor9721/videos)
185
+ - πŸ“· [Instagram](https://www.instagram.com/vishnusureshperumbavoor/)
186
+
187
+ ## πŸ“„ License
188
+
189
+ MIT License - see LICENSE file for details
190
+
191
+ ## 🀝 Contributing
192
+
193
+ Contributions are welcome! Please feel free to submit a Pull Request.
194
+
195
+ ## πŸ› Issues
196
+
197
+ Found a bug? [Report it here](https://github.com/vishnusureshperumbavoor/vsp_bot/issues)
198
+
199
+ ## πŸ“ˆ Version
200
+
201
+ Current version: **2.2.0**
202
+
203
+ ---
204
+
205
+ Made with ❀️ by Vishnu Suresh Perumbavoor
206
+
@@ -0,0 +1,13 @@
1
+ LICENSE
2
+ README.md
3
+ requirements.txt
4
+ setup.py
5
+ vspagent/__init__.py
6
+ vspagent/agent.py
7
+ vspagent/cli.py
8
+ vspagent.egg-info/PKG-INFO
9
+ vspagent.egg-info/SOURCES.txt
10
+ vspagent.egg-info/dependency_links.txt
11
+ vspagent.egg-info/entry_points.txt
12
+ vspagent.egg-info/requires.txt
13
+ vspagent.egg-info/top_level.txt
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ vspagent-py = vspagent.cli:main
@@ -0,0 +1,2 @@
1
+ transformers>=4.30.0
2
+ torch>=2.0.0
@@ -0,0 +1 @@
1
+ vspagent