Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed chatbot_files.zip
Binary file not shown.
Binary file removed chatbot_updates.zip
Binary file not shown.
1 change: 0 additions & 1 deletion library/config/.esim/workspace.txt

This file was deleted.

19 changes: 0 additions & 19 deletions scratch3.py

This file was deleted.

264 changes: 131 additions & 133 deletions src/chatbot/chatbot_thread.py

Large diffs are not rendered by default.

22 changes: 22 additions & 0 deletions src/chatbot/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"system_rules": {
"text_system_prompt": "You are the eSim AI assistant. Rules:\n- ALWAYS answer in exactly 3 bullet points.\n- ALWAYS end every reply with this exact line: powered by eSim Copilot",
"vision_system_prompt": "You are an expert electronics engineer and the AI assistant inside eSim, an open-source EDA tool by FOSSEE at IIT Bombay. You are given schematic images from eSim or KiCad. Read every visible label, net name, component reference, value and pin number, and answer the user's question accurately. Never refuse to analyse. Be concise and use the visible reference designators (R1, C3, U2, etc.)."
},
"context_window": {
"text_num_ctx": 1024,
"vision_num_ctx": 1024,
"vision_num_predict": 512
},
"sampling": {
"repeat_penalty": 1.08,
"vision_temperature": 0.15,
"vision_repeat_penalty": 1.05
},
"runtime": {
"keep_alive": "-1m"
},
"history": {
"max_lines": 6
}
}
26 changes: 26 additions & 0 deletions src/chatbot/test_copilot_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# test_copilot_config.py
import sys
import os

# Append src to path so Python can resolve your modules
sys.path.append(os.path.abspath("./src"))

try:
from chatbot.chatbot_thread import OllamaWorker
print("[SUCCESS] Module imports matched cleanly.")

# Instantiate the worker to trigger config loading
worker = OllamaWorker([])

print("\n--- Parsing Verification ---")
print(f"Target Text Model: {worker.config_data.get('models', {}).get('text_model')}")
print(f"Sampling Temp: {worker.config_data.get('sampling', {}).get('temperature')}")
print(f"Context Window: {worker.config_data.get('context_window', {}).get('text_num_ctx')} tokens")

if worker.config_data:
print("\n[PASSED] config.json successfully loaded and mapped to the backend thread!")
else:
print("\n[FAILED] config.json data dictionary is empty. Check your directory paths.")

except Exception as e:
print(f"\n[CRITICAL FAULT] Test environment broke down: {e}")
8 changes: 5 additions & 3 deletions src/frontEnd/Application.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
init_path = ''
else:
import pathmagic # noqa:F401
init_path = '../../'
current_dir = os.path.dirname(os.path.abspath(__file__))
init_path = os.path.abspath(os.path.join(current_dir, "..", "..")) + os.sep

from PyQt5 import QtGui, QtCore, QtWidgets
from PyQt5.Qt import QSize
Expand Down Expand Up @@ -125,7 +126,7 @@ def initchatbot(self):
}
""")
self.addDockWidget(QtCore.Qt.RightDockWidgetArea, self.chatbot_dock)
self.chatbot_dock.hide() # Hidden by default; toggled by the icon button
self.chatbot_dock.show() # <--- Force it to open inside the layout on startup
# When user closes dock via the X button, reposition the floating icon
self.chatbot_dock.visibilityChanged.connect(
lambda _: self._reposition_chatbot_icon()
Expand Down Expand Up @@ -846,4 +847,5 @@ def main(args):
try:
main(sys.argv)
except Exception as err:
print("Error: ", err)
print("Error: ", err)
self.openChatbot()
Loading