paulwong

2026年1月24日 #

国内安装Claude code

安装命令

#!/bin/bash

set -e

# Parse command line arguments
TARGET="$1"  # Optional target parameter

# Validate target if provided
if [[ -n "$TARGET" ]] && [[ ! "$TARGET" =~ ^(stable|latest|[0-9]+\.[0-9]+\.[0-9]+(-[^[:space:]]+)?)$ ]]; then
    echo "Usage: $0 [stable|latest|VERSION]" >&2
    exit 1
fi

GCS_BUCKET="https://storage.googleapis.com/claude-code-dist-86c565f3-f756-42ad-8dfa-d59b1c096819/claude-code-releases"
DOWNLOAD_DIR="$HOME/.claude/downloads"

# Check for required dependencies
DOWNLOADER=""
if command -v curl >/dev/null 2>&1; then
    DOWNLOADER="curl"
elif command -v wget >/dev/null 2>&1; then
    DOWNLOADER="wget"
else
    echo "Either curl or wget is required but neither is installed" >&2
    exit 1
fi

# Check if jq is available (optional)
HAS_JQ=false
if command -v jq >/dev/null 2>&1; then
    HAS_JQ=true
fi

# Download function that works with both curl and wget
download_file() {
    local url="$1"
    local output="$2"
    
    if [ "$DOWNLOADER" = "curl" ]; then
        if [ -n "$output" ]; then
            curl -fsSL -o "$output" "$url"
        else
            curl -fsSL "$url"
        fi
    elif [ "$DOWNLOADER" = "wget" ]; then
        if [ -n "$output" ]; then
            wget -q -O "$output" "$url"
        else
            wget -q -O - "$url"
        fi
    else
        return 1
    fi
}

# Simple JSON parser for extracting checksum when jq is not available
get_checksum_from_manifest() {
    local json="$1"
    local platform="$2"
    
    # Normalize JSON to single line and extract checksum
    json=$(echo "$json" | tr -d '\n\r\t' | sed 's/ \+/ /g')
    
    # Extract checksum for platform using bash regex
    if [[ $json =~ \"$platform\"[^}]*\"checksum\"[[:space:]]*:[[:space:]]*\"([a-f0-9]{64})\" ]]; then
        echo "${BASH_REMATCH[1]}"
        return 0
    fi
    
    return 1
}

# Detect platform
case "$(uname -s)" in
    Darwin) os="darwin" ;;
    Linux) os="linux" ;;
    *) echo "Windows is not supported" >&2; exit 1 ;;
esac

case "$(uname -m)" in
    x86_64|amd64) arch="x64" ;;
    arm64|aarch64) arch="arm64" ;;
    *) echo "Unsupported architecture: $(uname -m)" >&2; exit 1 ;;
esac

# Check for musl on Linux and adjust platform accordingly
if [ "$os" = "linux" ]; then
    if [ -f /lib/libc.musl-x86_64.so.1 ] || [ -f /lib/libc.musl-aarch64.so.1 ] || ldd /bin/ls 2>&1 | grep -q musl; then
        platform="linux-${arch}-musl"
    else
        platform="linux-${arch}"
    fi
else
    platform="${os}-${arch}"
fi
mkdir -p "$DOWNLOAD_DIR"

# Always download latest version (which has the most up-to-date installer)
version=$(download_file "$GCS_BUCKET/latest")

# Download manifest and extract checksum
manifest_json=$(download_file "$GCS_BUCKET/$version/manifest.json")

# Use jq if available, otherwise fall back to pure bash parsing
if [ "$HAS_JQ" = true ]; then
    checksum=$(echo "$manifest_json" | jq -r ".platforms[\"$platform\"].checksum // empty")
else
    checksum=$(get_checksum_from_manifest "$manifest_json" "$platform")
fi

# Validate checksum format (SHA256 = 64 hex characters)
if [ -z "$checksum" ] || [[ ! "$checksum" =~ ^[a-f0-9]{64}$ ]]; then
    echo "Platform $platform not found in manifest" >&2
    exit 1
fi

# Download and verify
binary_path="$DOWNLOAD_DIR/claude-$version-$platform"
if ! download_file "$GCS_BUCKET/$version/$platform/claude" "$binary_path"; then
    echo "Download failed" >&2
    rm -f "$binary_path"
    exit 1
fi

# Pick the right checksum tool
if [ "$os" = "darwin" ]; then
    actual=$(shasum -a 256 "$binary_path" | cut -d' ' -f1)
else
    actual=$(sha256sum "$binary_path" | cut -d' ' -f1)
fi

if [ "$actual" != "$checksum" ]; then
    echo "Checksum verification failed" >&2
    rm -f "$binary_path"
    exit 1
fi

chmod +x "$binary_path"

# Run claude install to set up launcher and shell integration
echo "Setting up Claude Code"
"$binary_path" install ${TARGET:+"$TARGET"}

# Clean up downloaded file
rm -f "$binary_path"

echo ""
echo "�� Installation complete!"
echo ""

申请api key

https://0011.ai/i/NGRRWNT4

配置Claude code

# 当前终端
ANTHROPIC_BASE_URL = "https://aicoding.2233.ai"
ANTHROPIC_API_KEY = "你的 API Key"
ANTHROPIC_AUTH_TOKEN = "你的 API Key"

# 复制 Shell 命令
# 永久设置(~/.zshrc)
export ANTHROPIC_BASE_URL="https://aicoding.2233.ai"
export ANTHROPIC_API_KEY="你的 API Key"
export ANTHROPIC_AUTH_TOKEN="你的 API Key"
source ~/.zshrc

运行

在命令行切换到项目根目录,运行claude

posted @ 2026-01-24 12:22 paulwong 阅读(11) | 评论 (0)编辑 收藏

2026年1月6日 #

生成城市图片的提示词

提示词1:
帮我生成图片:一张针对 [上海] 的城市渲染数字艺术海报。
画面核心主体是一个漂浮在白云上方、形状像所选城市的并且占据画面大部分内容的微型岛屿。岛屿的形状与城市在地图上的形状相似,无缝融合城市独特的标志性地标、自然景观及文化元素。加入城市特有的鸟类、电影般的光影、鲜艳色彩、航拍视角和阳光反射效果,建筑不宜太多太密集。
岛屿展现历史与现代的无缝融合。一部分是该城市最具代表性的古代历史建筑;另一部分平滑过渡为城市的地标建筑和天际线景观。
岛屿漂浮浩瀚云海之上。云海采用该城市所在文化圈的传统艺术风格进行表现。
立体城市拼音或英文名的 3D 文字漂浮在微型岛屿的上方,这组文字像一个生态与文化共生的微缩生态装置。
在画面四周和主体周围,叠加一层极简、高雅、具有博物馆展板质感的信息排版层。主要检索相关的城市信息,主要信息使用经典的衬线字体,辅助数据可使用极细的极简无衬线体。在画面的角落,以类似古典地图集或高级杂志扉页的方式排版。用衬线体标注城市的地理坐标、别称或建城年份,以及当前的天气,作为装饰性的背景信息,整体排版留白极多,排版克制、干净、平衡,如同在欣赏一件珍贵的艺术品。
https://mp.weixin.qq.com/s/GqUcajzlA4dWYGJgaWBkCA


提示词2:
一张针对 [城市名称,例如:成都 Chengdu] 的城市渲染数字艺术海报。 画面核心主体是一个漂浮在白云上方、形状像所选城市的并且占据画面大部分内容的微型岛屿。岛屿的形状与城市在地图上的形状相似,无缝融合城市独特的标志性地标、自然景观及文化元素。加入城市特有的鸟类、电影般的光影、鲜艳色彩、航拍视角和阳光反射效果,建筑不宜太多太密集。 岛屿展现历史与现代的无缝融合。一部分是该城市最具代表性的古代历史建筑;另一部分平滑过渡为城市的地标建筑和天际线景观。岛屿漂浮浩瀚云海之上。云海采用该城市所在文化圈的传统艺术风格进行表现。 立体城市拼音或英文名的 3D 文字漂浮在微型岛屿的上方,这组文字像一个生态与文化共生的微缩生态装置。 在画面四周和主体周围,叠加一层极简、高雅、具有博物馆展板质感的信息排版层。主要检索相关的城市信息,主要信息使用经典的衬线字体,辅助数据可使用极细的极简无衬线体。在画面的角落,以类似古典地图集或高级杂志扉页的方式排版。用衬线体标注城市的地理坐标、别称或建城年份,以及当前的天气,排版克制、干净、平衡。 风格要求: Octane Render, C4D, Isometric City, Micro World, Living Ecosystem, 8k Resolution. DreamWorks style, 3D modeling, delicate, soft light projection. --ar 9:16 --v 6.0
https://mp.weixin.qq.com/s/U9zeuB8cJ7ZuEz91jp9ReQ?from=groupmessage&scene=1&subscene=10000&clicktime=1767657795&enterid=1767657795&sessionid=0&ascene=1&fasttmpl_type=4&fasttmpl_fullversion=8071695-zh_CN-zip&fasttmpl_flag=0&realreporttime=1767657795426

posted @ 2026-01-06 08:59 paulwong 阅读(32) | 评论 (0)编辑 收藏

2026年1月3日 #

AI应用资源

https://www.zhujunyue.com/hangye/#0



posted @ 2026-01-03 11:21 paulwong 阅读(15) | 评论 (0)编辑 收藏

2025年12月30日 #

N8N资源

@bitovi/n8n-nodes-semantic-text-splitter
https://github.com/bitovi/n8n-nodes-semantic-text-splitter?tab=readme-ov-file


posted @ 2025-12-30 09:30 paulwong 阅读(33) | 评论 (0)编辑 收藏

2025年12月14日 #

安装docker mcp

架构

AI Client → MCP Gateway → MCP Servers (Docker Containers)

安装docker mcp server

https://hub.docker.com/mcp/explore?categories=database
以docker 的方式安装

安装MCP Gateway

下载docker-mcp https://github.com/docker/mcp-gateway/releases/latest

移到:
Linux    ~/.docker/cli-plugins/docker-mcp
macOS    ~/.docker/cli-plugins/docker-mcp
Windows    %USERPROFILE%\.docker\cli-plugins

启动
# Run the MCP gateway (stdio)
docker mcp gateway run

# Run the MCP gateway (streaming)
docker mcp gateway run --port 8080 --transport streaming

在网关中激活某个mcp server
# List enabled servers
docker mcp server ls

# Enable one or more servers
docker mcp server enable <server-name> [server-name]

# Disable servers
docker mcp server disable <server-name> [server-name]

# Get detailed information about a server
docker mcp server inspect <server-name>

# Reset (disable all servers)
docker mcp server reset


MCP客户端

通过n8n等连接

posted @ 2025-12-14 11:28 paulwong 阅读(77) | 评论 (0)编辑 收藏

2025年12月13日 #

解读RAG

向大模型输入问题,让大模型回答。
大模型的做法是,先自己去寻找相关信息,再汇总出答案。这个过程有可能不靠谱,大模型自己寻找出他自己认为是对的信息,可能是错的,所以做出的答案,就是错的。
于是改成,让程序找出相关信息,再给大模型汇总。程序员编程后找出的信息肯定是对的,大模型汇总的结果,以大模型的能力,结果也是对的。

但这种方式有问题,就是会多次调用大模型,大模型通常是部署在远端的,就会产生性能问题。所以在大模型内部,让大模型自己去调用工具。

要大模型自己调用工具,就得靠系统提示词了,当然系统提示词不用自己写,将在n8n中流程导出json,再向deepseek提问,就可以生成提示词了。

调用的工具不止一个,就会产生协同问题,如何将a工具产生的结果作为参数调用b工具,这里的做法就是使用few shot,意思是在提示词中要要提供例子,如调用工具产生结果r1,{"input": r1}以这个参数调用工具b,这样工具b内部通过fromAI("input")就能获取到input参数的值了。

这个过程中大模型实际只做汇总,利用了大模型的长处,避免了大模型的短处。

程序去找信息,如果是从数据库中找出相关文档的方式,就是通常据说的RAG。

但在做RAG的过程中,难免碰到需求,如:用户输入关键词,直播回答某些预先答案。

象这种的实现方式,如果采用将答案弄成文档,再去让程序找到相关文档,再让大模型汇总这种方式也是不可靠。因为找到文档也是靠概率。
因此需使用新的方式,这种方式就是让程序调用工具,得出结果作为相关信息,再让大模型做汇总。这个过程出来的结果就是可靠的了。

为什么大模型会去调用工具呢

如果工具处理的方式不够,需要思考,那就需要加入大模型进去,进行协助,这种工具就是智能体了。整个架构就是所谓的多智能体的方式了。

所以总体的思路,就是让大模型做最擅长的活,汇总,信息提供由外部去做。整个结果就是可控的了。

posted @ 2025-12-13 01:28 paulwong 阅读(46) | 评论 (0)编辑 收藏

2025年12月8日 #

添加Milvus MCP

克隆源码:

git clone https://github.com/zilliztech/mcp-server-milvus.git

添加Dockerfile

FROM python:3.12-slim

WORKDIR /app

# 安装系统依赖
RUN apt-get update && apt-get install -y \
    curl \
    git \
    build-essential \
    && rm -rf /var/lib/apt/lists/*

# 使用 pip 安装 uv(替代 curl 方式)
#RUN pip install --no-cache-dir uv -i https://pypi.tuna.tsinghua.edu.cn/simple 
RUN curl -LsSf https://astral.sh/uv/install.sh | sh

# 或者使用更可靠的方式
# RUN pip install --no-cache-dir uv==0.3.0

# 复制依赖文件
COPY pyproject.toml uv.lock README.md ./

# 为 uv 设置镜像源环境变量
ENV UV_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple

# 使用 uv 安装依赖
# 3. (关键)在构建时安装Python依赖到系统,而非虚拟环境
RUN pip install uv && \
    uv pip install --system -r pyproject.toml
# RUN uv pip install --system -r pyproject.toml -i https://pypi.tuna.tsinghua.edu.cn/simple 

# 复制源代码
COPY src/ ./src/

# 暴露端口
EXPOSE 8000

CMD ["uv", "run", "src/mcp_server_milvus/server.py", "--sse", "--milvus-uri", "http://milvus:19530", "--port", "8000"]

docker-compose.yaml

services:

  mcp-milvus-server:
    build: .
    container_name: mcp-milvus-server
    extra_hosts:
      - "host.docker.internal:host-gateway"
    environment:
      - MILVUS_URI=http://host.docker.internal:19530
      # - MILVUS_TOKEN=http://localhost:19530
      # - MILVUS_DB=http://localhost:19530
    ports:
      - "8012:8000"
    volumes:
      - ./src:/app/src
    # depends_on:
    #   milvus:
    #     condition: service_healthy
    command: uv run src/mcp_server_milvus/server.py --sse --milvus-uri http://milvus:19530 --port 8000
    networks:
      - n8n_network

volumes:
  milvus_data:
  milvus_conf:
  etcd_data:
  minio_data:

networks:
  n8n_network:
    external: true

login-mcp-milvus-server.sh

BIN_PATH=$(cd `dirname $0`; pwd)
cd $BIN_PATH/mcp-server-milvus

docker compose exec -it mcp-milvus-server /bin/bash


logs-mcp-milvus-server.sh

BIN_PATH=$(cd `dirname $0`; pwd)
cd $BIN_PATH/mcp-server-milvus

docker compose logs -f 

start-mcp-milvus-server.sh

BIN_PATH=$(cd `dirname $0`; pwd)
cd $BIN_PATH/mcp-server-milvus

docker compose up -d
docker compose logs -f

shutdown-mcp-milvus-server.sh

BIN_PATH=$(cd `dirname $0`; pwd)
cd $BIN_PATH/mcp-server-milvus

docker compose down

restart-mcp-milvus-server.sh

BIN_PATH=$(cd `dirname $0`; pwd)
cd $BIN_PATH

pwd
./shutdown-mcp-milvus-server.sh
./start-mcp-milvus-server.sh


posted @ 2025-12-08 01:49 paulwong 阅读(38) | 评论 (0)编辑 收藏

2025年12月7日 #

MCP资源

什么是mcp?
https://code.visualstudio.com/docs/copilot/customization/mcp-servers#_add-an-mcp-server-to-your-user-settings

mcp server大全
https://github.com/modelcontextprotocol/servers?tab=readme-ov-file

常用mcp server:
https://github.com/modelcontextprotocol/servers-archived/tree/main/src/postgres

mcp 官网:
https://modelcontextprotocol.io/docs/develop/build-server


posted @ 2025-12-07 21:29 paulwong 阅读(38) | 评论 (0)编辑 收藏

2025年11月23日 #

AI 模型广场

如果想在某些垂直领域找比较好的模型, 可到下面这个网址查看:

https://ai.gitee.com/serverless-api

posted @ 2025-11-23 09:53 paulwong 阅读(18) | 评论 (0)编辑 收藏

2025年11月8日 #

Open WebUI + N8N 流式输出

Integrating n8n with Open WebUI: Building advanced AI chatbots and workflows
https://www.pondhouse-data.com/blog/integrating-n8n-with-open-webui

n8nchatui
https://n8nchatui.com/docs
https://www.youtube.com/watch?v=_dmrr7kWRI0

open-webui function:
https://openwebui.com/f/webfox/n8n_streaming

Complete Guide to n8n Chat Streaming Setup
https://sudhanshu-sharma.notion.site/Complete-Guide-to-n8n-Chat-Streaming-Setup-24ed62104585806a8909d1b662209af3

posted @ 2025-11-08 09:03 paulwong 阅读(33) | 评论 (0)编辑 收藏

仅列出标题  下一页