返回顶部
a

anthropic

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,536
下载量
0
收藏
概述
安装方式
版本历史

anthropic

# 🔮 Anthropic Anthropic Claude API integration — chat completions, streaming, vision, tool use, and batch processing via the Anthropic Messages API. ## Features - **Messages API** — Claude Opus, Sonnet, Haiku completions - **Streaming** — real-time token streaming responses - **Vision** — image analysis and understanding - **Tool use** — function calling with structured output - **System prompts** — custom system instructions - **Multi-turn conversations** — context management - **Batch API** — bulk message processing - **Token counting** — estimate usage before sending - **Extended thinking** — deep reasoning mode - **Model listing** — available models and capabilities ## Requirements | Variable | Required | Description | |----------|----------|-------------| | `ANTHROPIC_API_KEY` | ✅ | API key/token for Anthropic | ## Quick Start ```bash # Send a message to Claude python3 {baseDir}/scripts/anthropic.py chat "What is the meaning of life?" --model claude-sonnet-4-20250514 ``` ```bash # Chat with system prompt python3 {baseDir}/scripts/anthropic.py chat-system --system "You are a financial analyst" "Analyze AAPL stock" ``` ```bash # Analyze an image python3 {baseDir}/scripts/anthropic.py chat-image --image photo.jpg 'What do you see in this image?' ``` ```bash # Stream a response python3 {baseDir}/scripts/anthropic.py stream "Write a short story about a robot" --model claude-sonnet-4-20250514 ``` ## Commands ### `chat` Send a message to Claude. ```bash python3 {baseDir}/scripts/anthropic.py chat "What is the meaning of life?" --model claude-sonnet-4-20250514 ``` ### `chat-system` Chat with system prompt. ```bash python3 {baseDir}/scripts/anthropic.py chat-system --system "You are a financial analyst" "Analyze AAPL stock" ``` ### `chat-image` Analyze an image. ```bash python3 {baseDir}/scripts/anthropic.py chat-image --image photo.jpg 'What do you see in this image?' ``` ### `stream` Stream a response. ```bash python3 {baseDir}/scripts/anthropic.py stream "Write a short story about a robot" --model claude-sonnet-4-20250514 ``` ### `batch-create` Create a batch request. ```bash python3 {baseDir}/scripts/anthropic.py batch-create requests.jsonl ``` ### `batch-list` List batch jobs. ```bash python3 {baseDir}/scripts/anthropic.py batch-list ``` ### `batch-get` Get batch status. ```bash python3 {baseDir}/scripts/anthropic.py batch-get batch_abc123 ``` ### `batch-results` Get batch results. ```bash python3 {baseDir}/scripts/anthropic.py batch-results batch_abc123 ``` ### `count-tokens` Count tokens in a message. ```bash python3 {baseDir}/scripts/anthropic.py count-tokens "How many tokens is this message?" ``` ### `models` List available models. ```bash python3 {baseDir}/scripts/anthropic.py models ``` ### `tools` Chat with tool use. ```bash python3 {baseDir}/scripts/anthropic.py tools --tools '[{"name":"get_weather","description":"Get weather","input_schema":{"type":"object","properties":{"location":{"type":"string"}}}}]' "What is the weather in NYC?" ``` ### `thinking` Extended thinking mode. ```bash python3 {baseDir}/scripts/anthropic.py thinking "Solve this math problem step by step: what is 123 * 456?" --budget 10000 ``` ## Output Format All commands output JSON by default. Add `--human` for readable formatted output. ```bash # JSON (default, for programmatic use) python3 {baseDir}/scripts/anthropic.py chat --limit 5 # Human-readable python3 {baseDir}/scripts/anthropic.py chat --limit 5 --human ``` ## Script Reference | Script | Description | |--------|-------------| | `{baseDir}/scripts/anthropic.py` | Main CLI — all Anthropic operations | ## Data Policy This skill **never stores data locally**. All requests go directly to the Anthropic API and results are returned to stdout. Your data stays on Anthropic servers. ## Credits --- Built by [M. Abidi](https://www.linkedin.com/in/mohammad-ali-abidi) | [agxntsix.ai](https://www.agxntsix.ai) [YouTube](https://youtube.com/@aiwithabidi) | [GitHub](https://github.com/aiwithabidi) Part of the **AgxntSix Skill Suite** for OpenClaw agents. 📅 **Need help setting up OpenClaw for your business?** [Book a free consultation](https://cal.com/agxntsix/abidi-openclaw)

标签

skill ai

通过对话安装

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

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 anthropic-1776419941 技能

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

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

通过命令行安装

skillhub install anthropic-1776419941

下载 Zip 包

⬇ 下载 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
返回顶部