开发hook之前的备份
This commit is contained in:
1 parent
31fba5a9e9
commit
1690fead4e
27 files changed
+187
-20
No files matched your search
@@ -5,28 +5,24 @@ LANGSMITH_PROJECT="agent_learning"
|
||||
DATABASE_URI=sqlite:///./langgraph.db
|
||||
REDIS_URI=redis://localhost:6379/0
|
||||
#spark:
|
||||
# LLM_API_KEY='semi-ai.tech'
|
||||
LLM_API_KEY='semi-ai.tech'
|
||||
# LLM_BASE_URL="http://192.168.137.96:8000/v1"
|
||||
# LLM_MODEL = "Qwen/Qwen3.6-35B-A3B-FP8"
|
||||
LLM_BASE_URL="http://semi-ai.tech:50400/v1"
|
||||
LLM_MODEL = "Qwen/Qwen3.6-35B-A3B-FP8"
|
||||
# ASR_TTS_BASE_URL = "http://192.168.137.96:8100"
|
||||
# ASR_BASE_URL = "http://192.168.137.96:8901/v1"
|
||||
# TTS_BASE_URL = "http://192.168.137.96:8902"
|
||||
# RAG_BASE_URL = "http://192.168.137.96:8903"
|
||||
|
||||
|
||||
ASR_BASE_URL = "http://192.168.137.164:8901/v1"
|
||||
TTS_BASE_URL = "http://192.168.137.164:8902"
|
||||
RAG_BASE_URL = "http://192.168.137.164:8903"
|
||||
|
||||
#6000pro:
|
||||
# LLM_API_KEY='semi-ai.tech'
|
||||
# LLM_BASE_URL="http://semi-ai.tech:40056/v1"
|
||||
# LLM_MODEL = "Intel/Qwen3.6-35B-A3B-int4-mixed-AutoRound"
|
||||
|
||||
#A100:
|
||||
LLM_API_KEY = 'sk-kGhWAQTqLk9ECsmIDb758a456bD34e92B9771dF2E36432Fb'
|
||||
LLM_BASE_URL = "https://app.semi-ai.tech:60004/v1"
|
||||
LLM_MODEL = "Qwen3.5-122B-A10B"
|
||||
# LLM_API_KEY = 'sk-kGhWAQTqLk9ECsmIDb758a456bD34e92B9771dF2E36432Fb'
|
||||
# LLM_BASE_URL = "https://app.semi-ai.tech:60004/v1"
|
||||
# LLM_MODEL = "Qwen3.5-122B-A10B"
|
||||
# LLM_TIMEOUT = 300
|
||||
# LLM_REQUESTS_PER_SECOND = 10.0
|
||||
# LLM_MAX_BUCKET_SIZE = 10
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"version": 2,
|
||||
"turns": [
|
||||
{
|
||||
"user": {
|
||||
"content": [
|
||||
{
|
||||
"type": "text",
|
||||
"text": "你好"
|
||||
}
|
||||
]
|
||||
},
|
||||
"assistant": {
|
||||
"text": "抱歉,我遇到了一些问题,请稍后再试。",
|
||||
"output_type": "text",
|
||||
"autoplay": false,
|
||||
"audio_duration_seconds": null,
|
||||
"audio_relpath": null
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"version": 2,
|
||||
"turns": [
|
||||
{
|
||||
"user": {
|
||||
"content": [
|
||||
{
|
||||
"type": "text",
|
||||
"text": "你好"
|
||||
}
|
||||
]
|
||||
},
|
||||
"assistant": {
|
||||
"text": "抱歉,我遇到了一些问题,请稍后再试。",
|
||||
"output_type": "text",
|
||||
"autoplay": false,
|
||||
"audio_duration_seconds": null,
|
||||
"audio_relpath": null
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"version": 2,
|
||||
"turns": [
|
||||
{
|
||||
"user": {
|
||||
"content": [
|
||||
{
|
||||
"type": "text",
|
||||
"text": "你好"
|
||||
}
|
||||
]
|
||||
},
|
||||
"assistant": {
|
||||
"text": "抱歉,我遇到了一些问题,请稍后再试。",
|
||||
"output_type": "text",
|
||||
"autoplay": false,
|
||||
"audio_duration_seconds": null,
|
||||
"audio_relpath": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"user": {
|
||||
"content": [
|
||||
{
|
||||
"type": "text",
|
||||
"text": "你好"
|
||||
}
|
||||
]
|
||||
},
|
||||
"assistant": {
|
||||
"text": "抱歉,我遇到了一些问题,请稍后再试。",
|
||||
"output_type": "text",
|
||||
"autoplay": false,
|
||||
"audio_duration_seconds": null,
|
||||
"audio_relpath": null
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"version": 2,
|
||||
"turns": [
|
||||
{
|
||||
"user": {
|
||||
"content": [
|
||||
{
|
||||
"type": "text",
|
||||
"text": "你好"
|
||||
}
|
||||
]
|
||||
},
|
||||
"assistant": {
|
||||
"text": "抱歉,我遇到了一些问题,请稍后再试。",
|
||||
"output_type": "text",
|
||||
"autoplay": false,
|
||||
"audio_duration_seconds": null,
|
||||
"audio_relpath": null
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"version": 2,
|
||||
"turns": [
|
||||
{
|
||||
"user": {
|
||||
"content": [
|
||||
{
|
||||
"type": "text",
|
||||
"text": "你好"
|
||||
}
|
||||
]
|
||||
},
|
||||
"assistant": {
|
||||
"text": "抱歉,我遇到了一些问题,请稍后再试。",
|
||||
"output_type": "text",
|
||||
"autoplay": false,
|
||||
"audio_duration_seconds": null,
|
||||
"audio_relpath": null
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"version": 2,
|
||||
"turns": [
|
||||
{
|
||||
"user": {
|
||||
"content": [
|
||||
{
|
||||
"type": "text",
|
||||
"text": "你好"
|
||||
}
|
||||
]
|
||||
},
|
||||
"assistant": {
|
||||
"text": "抱歉,我遇到了一些问题,请稍后再试。",
|
||||
"output_type": "text",
|
||||
"autoplay": false,
|
||||
"audio_duration_seconds": null,
|
||||
"audio_relpath": null
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"version": 2,
|
||||
"turns": [
|
||||
{
|
||||
"user": {
|
||||
"content": [
|
||||
{
|
||||
"type": "text",
|
||||
"text": "你好"
|
||||
}
|
||||
]
|
||||
},
|
||||
"assistant": {
|
||||
"text": "抱歉,我遇到了一些问题,请稍后再试。",
|
||||
"output_type": "text",
|
||||
"autoplay": false,
|
||||
"audio_duration_seconds": null,
|
||||
"audio_relpath": null
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
+2
-2
@@ -219,7 +219,7 @@ class ChatQwen(ChatOpenAI):
|
||||
return new_messages
|
||||
|
||||
def _text_to_audio(self, text: str) -> bytes:
|
||||
chunks = split_text(text)
|
||||
chunks = split_text(text, min_effective_chars=20)
|
||||
if len(chunks) == 1:
|
||||
resp = requests.get(f"{TTS_BASE_URL}/tts", params={"text": chunks[0]})
|
||||
resp.raise_for_status()
|
||||
@@ -405,7 +405,7 @@ if __name__ == "__main__":
|
||||
import sys
|
||||
|
||||
# 使用原始字符串避免转义问题
|
||||
TEST_IMAGE_PATH = r"C:\Users\86166\Desktop\image_raw\4.jpg"
|
||||
TEST_IMAGE_PATH = r"C:\Users\86166\Desktop\4.png"
|
||||
|
||||
if not os.path.exists(TEST_IMAGE_PATH):
|
||||
print(f"❌ 图片不存在: {TEST_IMAGE_PATH}")
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
from .tool import *
|
||||
from .tool_rag import RAGTool
|
||||
# from .tool_rag import RAGTool
|
||||
|
||||
# from .tool_database import *
|
||||
# from utils.database_utils import PostgreSQL_Manager
|
||||
@@ -22,11 +22,11 @@ from .tool_rag import RAGTool
|
||||
# return _all_database_tools
|
||||
|
||||
_all_tools = [
|
||||
Websearchclass(),
|
||||
DateQueryClass(),
|
||||
WebSearch(),
|
||||
DateQuery(),
|
||||
ScreenCapture(),
|
||||
BrowserControlClass(),
|
||||
RAGTool(),
|
||||
BrowserControl(),
|
||||
# RAGTool(),
|
||||
DirectoryListing(),
|
||||
]
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -17,7 +17,7 @@ from agent.llm import llm
|
||||
from utils.env_utils import BROWSER_MAP
|
||||
|
||||
|
||||
class Websearchclass(BaseTool):
|
||||
class WebSearch(BaseTool):
|
||||
|
||||
args_schema : type[BaseModel] = create_model("Input_type", query=(str, Field(description="搜索查询内容")))
|
||||
name : str = "web_search_class"
|
||||
@@ -40,7 +40,7 @@ class Websearchclass(BaseTool):
|
||||
except Exception as e:
|
||||
return f"执行网络搜索时出错: {str(e)}"
|
||||
|
||||
class DateQueryClass(BaseTool):
|
||||
class DateQuery(BaseTool):
|
||||
|
||||
# 定义工具的输入参数结构,这里没有输入参数,所以是一个空的模型
|
||||
args_schema : type[BaseModel] = create_model("NoneInput")
|
||||
@@ -109,7 +109,7 @@ class ScreenCapture(BaseTool):
|
||||
async def _arun(self, focus_query: Optional[str] = None) -> Tuple[str, dict]:
|
||||
return await asyncio.to_thread(self._run, focus_query)
|
||||
|
||||
class BrowserControlClass(BaseTool):
|
||||
class BrowserControl(BaseTool):
|
||||
"""统一浏览器控制工具:支持打开/关闭浏览器、刷新/关闭标签页、打开指定 URL"""
|
||||
|
||||
args_schema: type[BaseModel] = create_model(
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in new issue
Block a user