added chromium and new bot tokens

This commit is contained in:
Dobromir Popov 2023-12-19 21:37:07 +00:00
parent b27700ae5c
commit 5c5136be7c
4 changed files with 17 additions and 8 deletions

2
.vscode/launch.json vendored
View File

@ -29,11 +29,11 @@
"request": "launch", "request": "launch",
"program": "${workspaceFolder}/agent-py-bot/agent.py", "program": "${workspaceFolder}/agent-py-bot/agent.py",
"console": "integratedTerminal", "console": "integratedTerminal",
"preLaunchTask": "activate-venv", // Custom task to activate venv and run Docker
"python": "/venv/bin/python", // Path to the Python interpreter in your venv "python": "/venv/bin/python", // Path to the Python interpreter in your venv
"env": { "env": {
"PYTHONUNBUFFERED": "1" "PYTHONUNBUFFERED": "1"
} }
} }
] ]
} }

View File

@ -76,11 +76,13 @@ EXPOSE 8080 8081
RUN apk add --no-cache python3 py3-pip RUN apk add --no-cache python3 py3-pip
# If you need Python to be the default version, make a symbolic link to python3 # If you need Python to be the default version, make a symbolic link to python3
RUN if [ ! -e /usr/bin/python ]; then ln -sf python3 /usr/bin/python; fi RUN if [ ! -e /usr/bin/python ]; then ln -sf python3 /usr/bin/python; fi
# Ensure pip is up to date
#RUN python -m ensurepip --upgrade
# Install Chromium and Chromium WebDriver # comment to reduce the deployment image size
RUN apk add --no-cache chromium chromium-chromedriver
# Create a virtual environment and activate it
RUN python3 -m venv /venv RUN python3 -m venv /venv
RUN . /venv/bin/activate && pip install -r agent-py-bot/requirements.txt RUN . /venv/bin/activate && pip install --upgrade pip && pip install -r agent-py-bot/requirements.txt
#RUN chown -R node /app #RUN chown -R node /app
#USER node #USER node

View File

@ -1,5 +1,7 @@
import logging import logging
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters from telegram.ext import Updater, CommandHandler, MessageHandler, filters, CallbackContext
import requests import requests
import json import json
import base64 import base64
@ -13,10 +15,13 @@ logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
# Telegram Bot Token # Telegram Bot Token
TOKEN = 'YOUR_TELEGRAM_BOT_TOKEN_HERE' # t.me/kevin_ai_robot
TOKEN = '6805059978:AAHNJKuOeazMSJHc3-BXRCsFfEVyFHeFnjw'
# t.me/artitherobot 6749075936:AAHUHiPTDEIu6JH7S2fQdibwsu6JVG3FNG0
# LLM API Endpoint # LLM API Endpoint
LLM_ENDPOINT = "http://localhost:11434/api/chat" LLM_ENDPOINT = "http://192.168.0.11:11434/api/chat"
# Selenium WebDriver setup for screenshots # Selenium WebDriver setup for screenshots
chrome_options = Options() chrome_options = Options()
@ -25,7 +30,7 @@ driver = webdriver.Chrome(options=chrome_options)
def start(update, context): def start(update, context):
"""Send a message when the command /start is issued.""" """Send a message when the command /start is issued."""
update.message.reply_text('Hi! Send me a message, and I will interact with LLM.') update.message.reply_text('Hi I am ! Send me a message, and I will interact with LLM.')
def echo(update, context): def echo(update, context):
"""Echo the user message.""" """Echo the user message."""

View File

@ -6,6 +6,8 @@
pip install python-telegram-bot requests selenium Pillow pip install python-telegram-bot requests selenium Pillow
pip freeze > requirements.txt
pip install .... pip install ....