2025/10/6

docker swarm 搭建二

部署docker swarm #时区 sudo timedatectl set-timezone Asia/Shanghai timedatectl status #启用网络时间同步 sudo timedatectl set-ntp true 初始化 Swarm 模式(因为您使用了 deploy 配置) bash #…

  • 运维
  • 2025/10/6
  • TwoAdmin
  • 102
  • 2025/10/5

    docker swarm 搭建一

    安装docker # 下载官方安装脚本 curl -fsSL https://get.docker.com -o get-docker.sh # 执行安装(自动检测系统) sudo sh get-docker.sh # 启动Docker sudo systemctl start docker sudo systemctl en…

  • 运维
  • 2025/10/5
  • TwoAdmin
  • 110
  • 2025/10/4

    agent意图识别,连续几个子任务,大模型返回很慢

    针对大模型返回慢的问题,这里有几个优化方案: 方案1: 缓存优化(推荐) python import time from functools import lru_cache from typing import Dict, Any class IntentCache: """意图识别缓…

  • AI算法
  • 2025/10/4
  • TwoAdmin
  • 96
  • 2025/10/3

    LangChain-Golang核心模块使用

    1.简介 LangChain是一个开源的框架,它提供了构建基于大模型的AI应用所需的模块和工具。它可以帮助开发者轻松地与大型语言模型(LLM)集成,实现文本生成、问答、翻译、对话等任务。LangChain的出现大大降低了AI…

  • Golang
  • 2025/10/3
  • TwoAdmin
  • 91
  • 2025/10/2

    AI Agent的用户意图识别与任务分解

    1. 背景介绍 1.1 目的和范围 本文旨在为开发者和研究人员提供关于AI Agent系统中用户意图识别与任务分解的全面技术指南。我们将覆盖从基础理论到实践应用的完整知识体系,重点关注以下几个方面: 用户意图的表示与…

  • AI算法
  • 2025/10/2
  • TwoAdmin
  • 250
  • 2025/10/1

    vim 操作快捷键

    以下是 Vim 编辑器 常用的快捷键汇总,适合新手快速上手和日常使用。Vim 有多种模式,掌握模式切换是关键。 🧭 Vim 的三种基本模式 模式 进入方式 作用 普通模式 (Normal) 默认模式 移动光标、复制、粘贴、…

  • 运维
  • 2025/10/1
  • TwoAdmin
  • 91
  • 2025/9/30

    fastapi sqlmodel 配置及增删改查

    FastAPI + SQLModel 的配置和 CRUD 操作。 1. 环境配置和安装 首先安装必要的依赖: pip install fastapi sqlmodel uvicorn database.py from contextlib import contextmanager from sqlmodel import creat…

  • Python
  • 2025/9/30
  • TwoAdmin
  • 89
  • 2025/9/29

    supervisor pyenv 虚拟环境部署并设置huggingface.co镜像

    supervisor pyenv 虚拟环境部署并设置huggingface.co镜像 [program:prod_basic] ; 设置命令(关键:通过 bash -lc 加载 pyenv 环境) command=/root/.pyenv/bin/pyenv exec python app.py ; 工作目录(必须是 …

  • Python
  • 2025/9/29
  • TwoAdmin
  • 93
  • 2025/9/28

    LangGraph 对应参数详解

    LangGraph 对应参数详解 workflow = StateGraph(AgentState) # 添加所有节点(全部使用异步版本) workflow.add_node("classifier", async_classifier_node) workflow.add_node("fetch_position_node", async_…

  • AI算法
  • 2025/9/28
  • TwoAdmin
  • 97
  • 2025/9/27

    langgraph同时使用tool和mcp(三)

    mcp job_info_tools from app.config import comet_config from sdk.langgraph.langgraph import AgentState from service.mcpService import call_sse_tool async def async_job_info_node(state: AgentS…

  • AI算法
  • 2025/9/27
  • TwoAdmin
  • 76
  • 2025/9/26

    langgraph同时使用tool和mcp(二)

    cometLanggraph.py import asyncio import logging import json from typing import AsyncIterable, Dict, Any from langchain_openai import ChatOpenAI from langchain_core.messages import HumanMessage, …

  • AI算法
  • 2025/9/26
  • TwoAdmin
  • 85
  • 2025/9/25

    langgraph同时使用tool和mcp(一)

    langgraph同时使用tool和mcp 定义智能体的状态 (State) from typing import TypedDict, Annotated, List from langgraph.graph import add_messages class AgentState(TypedDict): """ 定义图的状…

  • AI算法
  • 2025/9/25
  • TwoAdmin
  • 85