From fa43c028f5cfc03fb5412e7f9f7c74d901e87395 Mon Sep 17 00:00:00 2001 From: Dobromir Popov Date: Thu, 18 Apr 2024 01:51:56 +0300 Subject: [PATCH 1/5] launch settings changed --- .vscode/launch.json | 57 ++++++++++++++++++++++++++------------------- .vscode/tasks.json | 44 +++++++++++++++++++--------------- 2 files changed, 58 insertions(+), 43 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index d1eed27..ff9d9dd 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,35 +1,27 @@ { - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ - { - "name": "Docker Node.js Launch", - "type": "docker", - "request": "launch", - "preLaunchTask": "docker-run: debug", - "platform": "node" - }, - { - "name": "Docker Python Launch?", - "type": "python", - "request": "launch", - "program": "${workspaceFolder}/agent-py-bot/agent.py", - "console": "integratedTerminal", - // "python": "${command:python.interpreterPath}", // Assumes Python extension is installed - // "preLaunchTask": "docker-run: python-debug", // You may need to create this task - // "env": { - // "PYTHONUNBUFFERED": "1" - // } - }, + // { + // "name": "Docker Node.js Launch", + // "type": "docker", + // "request": "launch", + // "preLaunchTask": "docker-run: debug", + // "platform": "node" + // }, + // { + // "name": "Docker Python Launch?", + // "type": "python", + // "request": "launch", + // "program": "${workspaceFolder}/agent-py-bot/agent.py", + // "console": "integratedTerminal" + // }, { "name": "Docker Python Launch with venv", "type": "debugpy", "request": "launch", "program": "${workspaceFolder}/agent-py-bot/agent.py", "console": "integratedTerminal", - "python": "/venv/bin/python", // Path to the Python interpreter in your venv + "python": "/venv/bin/python", "env": { "PYTHONUNBUFFERED": "1" } @@ -42,7 +34,24 @@ "skipFiles": [ "/**" ] - + }, + { + "name": "Python Debugger: Python File", + "type": "debugpy", + "request": "launch", + "program": "${file}" + }, + { + "name": "Python Debugger: Python File with Conda", + "type": "debugpy", + "request": "launch", + "program": "${file}", + "console": "integratedTerminal", + "python": "${command:python.interpreterPath}", + "presentation": { + "clear": true + }, + "preLaunchTask": "conda-activate" // Name of your pre-launch task } ] } \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json index cb79000..ad95bfe 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -1,24 +1,24 @@ { "version": "2.0.0", "tasks": [ - { - "type": "docker-build", - "label": "docker-build", - "platform": "node", - "dockerBuild": { - "dockerfile": "${workspaceFolder}/Dockerfile", - "context": "${workspaceFolder}", - "pull": true - } - }, - { - "type": "docker-run", - "label": "docker-run: release", - "dependsOn": [ - "docker-build" - ], - "platform": "node" - }, + // { + // "type": "docker-build", + // "label": "docker-build", + // "platform": "node", + // "dockerBuild": { + // "dockerfile": "${workspaceFolder}/Dockerfile", + // "context": "${workspaceFolder}", + // "pull": true + // } + // }, + // { + // "type": "docker-run", + // "label": "docker-run: release", + // "dependsOn": [ + // "docker-build" + // ], + // "platform": "node" + // }, // { // "type": "docker-run", // "label": "docker-run: debug2", @@ -85,6 +85,12 @@ "reveal": "always", "panel": "new" }, - } + }, + { + "label": "conda-activate", + "type": "shell", + "command": "conda activate py && echo 'Activated Conda Environment (py)!'", + "problemMatcher": [] + } ] } \ No newline at end of file From 1d455aaba20ceb4a6e9aaf1be4620aeda13c0060 Mon Sep 17 00:00:00 2001 From: Dobromir Popov Date: Thu, 18 Apr 2024 02:12:26 +0300 Subject: [PATCH 2/5] remove schedule dependency, as it is failing --- .vscode/tasks.json | 16 +++++++++++----- agent-pyter/dexbot.py | 1 + 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.vscode/tasks.json b/.vscode/tasks.json index ad95bfe..6a0c2a1 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -87,10 +87,16 @@ }, }, { - "label": "conda-activate", - "type": "shell", - "command": "conda activate py && echo 'Activated Conda Environment (py)!'", - "problemMatcher": [] - } + "label": "conda-activate", + "type": "shell", + "command": "source ~/miniconda3/etc/profile.d/conda.sh && conda activate py && echo 'Activated Conda Environment (py)!'", + "problemMatcher": [], + "options": { + "shell": { + "executable": "/bin/bash", + "args": ["-c"] + } + } + } ] } \ No newline at end of file diff --git a/agent-pyter/dexbot.py b/agent-pyter/dexbot.py index fe5561b..e90ef26 100644 --- a/agent-pyter/dexbot.py +++ b/agent-pyter/dexbot.py @@ -4,6 +4,7 @@ import schedule import time def check_new_pairs(): + print("Checking for new pairs...") url = "https://www.dextools.io/" url = "https://www.dextools.io/app/en/bnb/pool-explorer" response = requests.get(url) From e5f91cb4f8c4ef518149efa0b6a112e5b200145d Mon Sep 17 00:00:00 2001 From: Dobromir Popov Date: Sun, 12 May 2024 11:23:11 +0300 Subject: [PATCH 3/5] api urls env, confifs --- .env | 19 +++++++++++++------ .vscode/launch.json | 5 +++-- _doc/aider.md | 11 +++++++++++ _doc/oi-notes.md | 2 +- 4 files changed, 28 insertions(+), 9 deletions(-) create mode 100644 _doc/aider.md diff --git a/.env b/.env index 722f994..3cac670 100644 --- a/.env +++ b/.env @@ -1,6 +1,6 @@ -TTS_BACKEND_URL=http://192.168.0.10:9008/asr +TTS_BACKEND_URL=http://192.168.0.10:9009/asr #TTS_BACKEND_URL=http://localhost:9001/asr #gpu 9002-cpu TTS_BACKEND_URL2=http://localhost:9002/asr TTS_BACKEND_URL3=http://192.168.0.10:9008/asr #gpu @@ -11,10 +11,17 @@ SERVER_PORT_HTTP=3005 # aider AIDER_MODEL= -AIDER_4= -AIDER_35TURBO= +AIDER_4=false +#AIDER_35TURBO= # OPENAI_API_KEY=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 -OPENAI_API_BASE=https://api.deepseek.com/v1 -OPENAI_API_KEY=sk-99df7736351f4536bd72cd64a416318a -AIDER_MODEL=deepseek-coder #deepseek-coder, deepseek-chat \ No newline at end of file +# OPENAI_API_BASE=https://api.deepseek.com/v1 +# OPENAI_API_KEY=sk-99df7736351f4536bd72cd64a416318a +# AIDER_MODEL=deepseek-coder #deepseek-coder, deepseek-chat + + +GROQ_API_KEY=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 +aider --model groq/llama3-70b-8192 + +# List models available from Groq +aider --models groq/ \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json index ff9d9dd..2f20d3e 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -47,11 +47,12 @@ "request": "launch", "program": "${file}", "console": "integratedTerminal", - "python": "${command:python.interpreterPath}", + //"python": "${command:python.interpreterPath}", + "python": "/config/miniconda3/envs/py/bin/python", "presentation": { "clear": true }, - "preLaunchTask": "conda-activate" // Name of your pre-launch task + //"preLaunchTask": "conda-activate" // Name of your pre-launch task } ] } \ No newline at end of file diff --git a/_doc/aider.md b/_doc/aider.md new file mode 100644 index 0000000..625a478 --- /dev/null +++ b/_doc/aider.md @@ -0,0 +1,11 @@ +python -m pip install git+https://github.com/d-popov/aider.git + + +export GROQ_API_KEY=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 +aider --models groq/ +aider --model groq/llama3-70b-8192 --no-auto-commits + + +#@ OLLAMA +export OPENAI_API_BASE=https://ollama.d-popov.com +aider --openai-api-base https://ollama.d-popov.com --openai-api-key ol-ddddd --models openai/ \ No newline at end of file diff --git a/_doc/oi-notes.md b/_doc/oi-notes.md index 6f4d4f7..5522572 100644 --- a/_doc/oi-notes.md +++ b/_doc/oi-notes.md @@ -15,7 +15,7 @@ interpreter --api_base http://192.168.0.11:11434/v1 --api_key "" --model openai/ interpreter --api_base http://192.168.0.137:1234/v1 --api_key "" --model openai/local 192.168.0.137 - +GROQ_API_KEY # ################################ GROQ ########################## working export OPENAI_API_KEY=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 interpreter -y --api_base https://api.groq.com/openai/v1 --model llama2-70b-4096 ## mixtral-8x7b-32768 # gemma-7b-it # llama2-70b-4096 From 7444b638e1c19aaf6a874690d9a64d670b71263a Mon Sep 17 00:00:00 2001 From: Dobromir Popov Date: Sun, 12 May 2024 11:24:31 +0300 Subject: [PATCH 4/5] dexbot --- .gitignore | 1 + agent-pyter/dexbot.py | 49 +++++++++++++++++++++++++++++++++++++---- agent-pyter/prompts.txt | 1 + 3 files changed, 47 insertions(+), 4 deletions(-) create mode 100644 agent-pyter/prompts.txt diff --git a/.gitignore b/.gitignore index 854e719..25b2b34 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ tts/*.m4a agent-mobile/jdk/* agent-mobile/artimobile/supervisord.pid agent-pyter/lag-llama +agent-pyter/google-chrome-stable_current_amd64.deb diff --git a/agent-pyter/dexbot.py b/agent-pyter/dexbot.py index e90ef26..ff4a706 100644 --- a/agent-pyter/dexbot.py +++ b/agent-pyter/dexbot.py @@ -1,15 +1,55 @@ + +# source /path/to/virtualenv/bin/activate # On Unix or MacOS +# source /config/miniconda3/envs/py/bin/activate +# pip install requests beautifulsoup4 schedule selenium + +# wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb +# sudo dpkg -i google-chrome-stable_current_amd64.deb +# apt install libnss3 libxss1 + import requests from bs4 import BeautifulSoup -import schedule +# import schedule +import time +from selenium import webdriver +from selenium.webdriver.chrome.service import Service +from webdriver_manager.chrome import ChromeDriverManager import time + +# Initialize WebDriver +service = Service(ChromeDriverManager().install()) +driver = webdriver.Chrome(service=service) + +def check_pairs_sel(): + + try: + # Open the page + driver.get("https://www.dextools.io/app/en/bnb/pool-explorer") + time.sleep(10) # Wait for JavaScript to execute + + # Extract the page source + html = driver.page_source + soup = BeautifulSoup(html, 'html.parser') + + # Assuming the pairs are listed in
tags with a class that includes the word 'pair' + pairs = soup.find_all('div', class_=lambda x: x and 'pair' in x) + print("Pairs found:", [pair.text for pair in pairs]) + finally: + driver.quit() + def check_new_pairs(): + # log the running time print("Checking for new pairs...") url = "https://www.dextools.io/" url = "https://www.dextools.io/app/en/bnb/pool-explorer" response = requests.get(url) soup = BeautifulSoup(response.text, 'html.parser') + # make html dump to ./dextools-last.html + with open('./dextools-last.html', 'w') as f: + f.write(soup.prettify()) + # Assuming the pairs are listed in
tags with a class that includes the word 'pair' pairs = soup.find_all('div', class_=lambda x: x and 'pair' in x) @@ -27,11 +67,12 @@ def check_new_pairs(): check_new_pairs.last_pairs = current_pairs def main(): - schedule.every(10).seconds.do(check_new_pairs) + #schedule.every(10).seconds.do(check_new_pairs) while True: - schedule.run_pending() - time.sleep(1) + # schedule.run_pending() + check_pairs_sel() + time.sleep(10000) if __name__ == "__main__": main() diff --git a/agent-pyter/prompts.txt b/agent-pyter/prompts.txt new file mode 100644 index 0000000..d066faf --- /dev/null +++ b/agent-pyter/prompts.txt @@ -0,0 +1 @@ +create python app that will monitor for new pairs on https://dextools.io and trigger event immediately when there is new token \ No newline at end of file From 71f075dd63131619e22c68ade24d08f085d082f8 Mon Sep 17 00:00:00 2001 From: Dobromir Popov Date: Sun, 12 May 2024 11:24:45 +0300 Subject: [PATCH 5/5] translation ui --- web/client.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/web/client.html b/web/client.html index 3ba9eb9..67ad2de 100644 --- a/web/client.html +++ b/web/client.html @@ -29,6 +29,10 @@ +