Skip to content

Instantly share code, notes, and snippets.

View KaushikShresth07's full-sized avatar

Kaushik Shresth KaushikShresth07

View GitHub Profile
def print_title():
"""Print the J.A.R.V.I.S ASCII art title."""
title = """
╔══════════════════════════════════════════════════════════╗
║ ║
║ ██╗ █████╗ ██████╗ ██╗ ██╗██╗███████╗ ║
║ ██║██╔══██╗██╔══██╗██║ ██║██║██╔════╝ ║
║ ██║███████║██████╔╝██║ ██║██║███████╗ ║
║ ██ ██║██╔══██║██╔══██╗╚██╗ ██╔╝██║╚════██║ ║
"""
JARVIS TEST SCRIPT - General and Realtime Chat Selector
========================================================
PURPOSE:
This is a command-line test interface for interacting with J.A.R.V.I.S.
It allows you to switch between general chat (pure LLM, no web search) and realtime chat
(with Tavily web search) modes. Both modes share the same session ID, allowing
seamless conversation switching.
"""
CONFIGURATION MODULE
====================
PURPOSE:
Central place for all J.A.R.V.I.S settings: API keys, paths, model names,
and the Jarvis system prompt. Designed for single-user use: each person runs
their own copy of this backend with their own .env and database/ folder.
WHAT THIS FILE DOES:
#!/usr/bin/env python3
"""
Enhanced HuskyLens Interactive Example
Comprehensive interactive menu for testing all HuskyLens features
"""
import random
import time
import json
import sys
# HuskyLens Python Library - Advanced Enhanced Version
# Author: Robert Prast (robert@dfrobot.com)
# Enhanced with: Advanced error handling, retry mechanisms, input validation, health checks
# 08/03/2020 (Original) | Advanced Enhanced 2024
# Dependencies:
# pyserial
# smbus or smbus2
# pypng
#
# How to use:
responses = [
"The rest of the result has been printed to the chat screen, kindly check it out sir.",
"The rest of the text is now on the chat screen, sir, please check it.",
"You can see the rest of the text on the chat screen, sir.",
"The remaining part of the text is now on the chat screen, sir.",
"Sir, you'll find more text on the chat screen for you to see.",
"The rest of the answer is now on the chat screen, sir.",
"Sir, please look at the chat screen, the rest of the answer is there.",
"You'll find the complete answer on the chat screen, sir.",
"The next part of the text is on the chat screen, sir.",
HtmlCode = '''<!DOCTYPE html>
<html lang="en">
<head>
<title>Speech Recognition</title>
</head>
<body>
<button id="start" onclick="startRecognition()">Start Recognition</button>
<button id="end" onclick="stopRecognition()">Stop Recognition</button>
<p id="output"></p>
<script>
System = f"""Hello, I am {Username}, You are a very accurate and advanced AI chatbot named {Assistantname} which has real-time up-to-date information from the internet.
*** Provide Answers In a Professional Way, make sure to add full stops, commas, question marks, and use proper grammar.***
*** Just answer the question from the provided data in a professional way. ***"""
System = f"""Hello, I am {Username}, You are a very accurate and advanced AI chatbot named {Assistantname} which also has real-time up-to-date information from the internet.
*** Do not tell time until I ask, do not talk too much, just answer the question.***
*** Reply in only English, even if the question is in Hindi, reply in English.***
*** Do not provide notes in the output, just answer the question and never mention your training data. ***
"""
preamble = """
You are a very accurate Decision-Making Model, which decides what kind of a query is given to you.
You will decide whether a query is a 'general' query, a 'realtime' query, or is asking to perform any task or automation like 'open facebook, instagram', 'can you write a application and open it in notepad'
*** Do not answer any query, just decide what kind of query is given to you. ***
-> Respond with 'general ( query )' if a query can be answered by a llm model (conversational ai chatbot) and doesn't require any up to date information like if the query is 'who was akbar?' respond with 'general who was akbar?', if the query is 'how can i study more effectively?' respond with 'general how can i study more effectively?', if the query is 'can you help me with this math problem?' respond with 'general can you help me with this math problem?', if the query is 'Thanks, i really liked it.' respond with 'general thanks, i really liked it.' , if the query is 'what is python programming language?' respond