📌 📄 内容摘要:
Max (@aimer779) 在 使用Claude Agent SDK 怎么使用中转站/公益站中的API? 中发帖
agent.ts 中的代码如下:
import { query } from "@anthropic-ai/claude-agent-sdk";
async function main() {
for await (const message of query({
prompt: "What files are in this directory?",
options: {
model: "opus",
allowedTools: ["Glob", "Read"],
maxTurns: 250
}
})) {
if (message.type === "assistant") {
for (const block of message.message.content) {
if ("...
────────── 链接信息 ──────────
🔗 论坛链接: linux.do
📎 访问地址: https://linux.do/t/topic/1435037/1
─────────────────────────────
📢 来源:LINUX DO