mirror of
https://github.com/yuruotong1/autoMate.git
synced 2026-03-22 13:07:17 +08:00
🐛 修复(server.ts):将端口变量从小写port改为大写PORT
✨ 功能(server.ts):添加对process.env.PORT环境变量的支持
This commit is contained in:
19
actions/word_actions/table_action.py
Normal file
19
actions/word_actions/table_action.py
Normal file
@@ -0,0 +1,19 @@
|
||||
import subprocess
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
from actions.action_base import ActionBase
|
||||
|
||||
|
||||
class OpenApplicationInput(BaseModel):
|
||||
path: str = Field(description="要查询的关键词", title="应用路径", default="")
|
||||
|
||||
|
||||
class TableAction(ActionBase):
|
||||
name: str = "打开应用"
|
||||
description: str = "打开指定目录的应用"
|
||||
args: OpenApplicationInput
|
||||
|
||||
def run(self, path):
|
||||
print("运行了这里", path)
|
||||
subprocess.Popen(path)
|
||||
@@ -9,6 +9,7 @@ from pages.config_page import ConfigPage
|
||||
from pages.plugin_page import PluginPage
|
||||
from utils.global_keyboard_listen import GlobalKeyboardListen
|
||||
from utils.qt_util import QtUtil
|
||||
from utils.window_util import WindowUtil
|
||||
|
||||
class ActionItems(QListWidgetItem):
|
||||
def __init__(self, action, chat_page):
|
||||
@@ -220,6 +221,7 @@ class ChatPage(QMainWindow, interface_ui):
|
||||
self.global_keyboard_listen.start()
|
||||
|
||||
def show_window(self):
|
||||
print(WindowUtil.get_window_title())
|
||||
self.showNormal()
|
||||
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ pygments = "^2.17.2"
|
||||
python-docx = "^1.1.2"
|
||||
global-hotkeys = "^0.1.7"
|
||||
pynput = "^1.7.7"
|
||||
open-interpreter = "^0.2.5"
|
||||
|
||||
|
||||
[build-system]
|
||||
|
||||
@@ -1,16 +1,12 @@
|
||||
from selenium.webdriver.common.by import By
|
||||
from interpreter import interpreter
|
||||
|
||||
from utils.selenium_util import SeleniumUtil
|
||||
|
||||
|
||||
class TestBaiduApi:
|
||||
class OpenInterpreter:
|
||||
def test_api(self):
|
||||
selenium = SeleniumUtil()
|
||||
selenium.get_url("https://www.baidu.com/s?wd=搜索引擎 api 汇总")
|
||||
result_elements = selenium.get_xpath_elements("//*[@class='result c-container xpath-log new-pmd']")
|
||||
for result_element in result_elements:
|
||||
title = result_element.find_element(By.XPATH, ".//h3").text
|
||||
url = result_element.find_element(By.XPATH, ".//h3/a").get_attribute("href")
|
||||
short_description = result_element.find_element(By.XPATH, ".//*/span[@class='content-right_8Zs40']").text
|
||||
print(result_element)
|
||||
interpreter.chat("最新的新闻")
|
||||
|
||||
if __name__ == "__main__":
|
||||
interpreter.llm.api_key = "sk-i6ClcJAogigoWxI9271b80E978374e8dAbC1167d3b6d8eA3" # LiteLLM, which we use to talk to LM Studio, requires this
|
||||
interpreter.llm.api_base = "https://api.fast-tunnel.one/v1" # Point this at any OpenAI compatible server
|
||||
OpenInterpreter().test_api()
|
||||
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
from pynput import mouse
|
||||
from PyQt6.QtCore import pyqtSignal, QThread
|
||||
|
||||
from utils.window_util import WindowUtil
|
||||
|
||||
class GlobalKeyboardListen(QThread):
|
||||
mouse_middle_signal = pyqtSignal()
|
||||
def __init__(self):
|
||||
|
||||
Reference in New Issue
Block a user