返回顶部
a

anthropicAnthropic集成

Anthropic Claude API integration — chat completions, streaming, vision, tool use, and batch processing via the Anthropic Messages API. Generate text with Claude Opus, Sonnet, and Haiku models, process images, use tool calling, and manage conversations. Built for AI agents — Python stdlib only, zero dependencies. Use for AI text generation, multimodal analysis, tool-augmented AI, batch processing, and Claude model interaction.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
1,611
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

anthropic

🔮 Anthropic

Anthropic Claude API 集成——通过 Anthropic Messages API 实现聊天补全、流式传输、视觉识别、工具使用和批量处理。

功能特性

  • - Messages API — Claude Opus、Sonnet、Haiku 补全
  • 流式传输 — 实时令牌流式响应
  • 视觉识别 — 图像分析与理解
  • 工具使用 — 带结构化输出的函数调用
  • 系统提示 — 自定义系统指令
  • 多轮对话 — 上下文管理
  • 批量 API — 批量消息处理
  • 令牌计数 — 发送前预估使用量
  • 扩展思考 — 深度推理模式
  • 模型列表 — 可用模型及能力

环境要求

变量必需描述
ANTHROPICAPIKEYAnthropic 的 API 密钥/令牌

快速开始

bash

向 Claude 发送消息


python3 {baseDir}/scripts/anthropic.py chat 生命的意义是什么? --model claude-sonnet-4-20250514

bash

使用系统提示进行对话


python3 {baseDir}/scripts/anthropic.py chat-system --system 你是一名金融分析师 分析 AAPL 股票

bash

分析图像


python3 {baseDir}/scripts/anthropic.py chat-image --image photo.jpg 你在这张图片中看到了什么?

bash

流式传输响应


python3 {baseDir}/scripts/anthropic.py stream 写一个关于机器人的短篇故事 --model claude-sonnet-4-20250514

命令

chat

向 Claude 发送消息。 bash python3 {baseDir}/scripts/anthropic.py chat 生命的意义是什么? --model claude-sonnet-4-20250514

chat-system

使用系统提示进行对话。 bash python3 {baseDir}/scripts/anthropic.py chat-system --system 你是一名金融分析师 分析 AAPL 股票

chat-image

分析图像。 bash python3 {baseDir}/scripts/anthropic.py chat-image --image photo.jpg 你在这张图片中看到了什么?

stream

流式传输响应。 bash python3 {baseDir}/scripts/anthropic.py stream 写一个关于机器人的短篇故事 --model claude-sonnet-4-20250514

batch-create

创建批量请求。 bash python3 {baseDir}/scripts/anthropic.py batch-create requests.jsonl

batch-list

列出批量任务。 bash python3 {baseDir}/scripts/anthropic.py batch-list

batch-get

获取批量状态。 bash python3 {baseDir}/scripts/anthropic.py batch-get batch_abc123

batch-results

获取批量结果。 bash python3 {baseDir}/scripts/anthropic.py batch-results batch_abc123

count-tokens

统计消息中的令牌数。 bash python3 {baseDir}/scripts/anthropic.py count-tokens 这条消息有多少个令牌?

models

列出可用模型。 bash python3 {baseDir}/scripts/anthropic.py models

tools

使用工具进行对话。 bash python3 {baseDir}/scripts/anthropic.py tools --tools [{name:getweather,description:获取天气,inputschema:{type:object,properties:{location:{type:string}}}}] 纽约的天气如何?

thinking

扩展思考模式。 bash python3 {baseDir}/scripts/anthropic.py thinking 逐步解答这道数学题:123 * 456 等于多少? --budget 10000

输出格式

所有命令默认输出 JSON 格式。添加 --human 参数可获取可读性强的格式化输出。

bash

JSON(默认,适用于程序化使用)


python3 {baseDir}/scripts/anthropic.py chat --limit 5

人类可读格式

python3 {baseDir}/scripts/anthropic.py chat --limit 5 --human

脚本参考

脚本描述
{baseDir}/scripts/anthropic.py主 CLI — 所有 Anthropic 操作

数据政策

本技能绝不本地存储数据。所有请求直接发送至 Anthropic API,结果返回至标准输出。您的数据保留在 Anthropic 服务器上。

致谢


M. Abidi 构建 | agxntsix.ai YouTube | GitHub 属于 OpenClaw 代理的 AgxntSix 技能套件 的一部分。

📅 需要为您的企业设置 OpenClaw 吗? 预约免费咨询

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 anthropic-1776419941 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 anthropic-1776419941 技能

通过命令行安装

skillhub install anthropic-1776419941

下载

⬇ 下载 anthropic v1.0.0(免费)

文件大小: 4.4 KB | 发布时间: 2026-4-17 19:48

v1.0.0 最新 2026-4-17 19:48
Initial release: Anthropic Claude API integration for Python agents.

- Supports Claude Opus, Sonnet, and Haiku models via the Anthropic Messages API.
- Features chat completions, token streaming, image analysis (vision), tool/function calling, and batch/bulk processing.
- Includes system prompts, conversation context management, token counting, and model listing.
- Command-line interface with multiple subcommands for chat, streaming, image analysis, tool use, and batch jobs.
- Built on Python 3.10+ with zero dependencies (stdlib only).
- Outputs JSON by default, with a human-readable mode.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部