PulseAugur
实时 13:15:26
English(EN) Building a streaming Claude client in the browser — without the SDK

开发者绕过 Anthropic SDK 构建基于浏览器的 Claude 客户端

一位开发者在使用 Anthropic 的官方 SDK 构建基于浏览器的 Claude 客户端时遇到了问题,因为它包含特定于 Node.js 的模块,导致了构建错误。为了克服这个问题,开发者选择通过 HTTP 请求直接与 Claude Messages API 进行交互。这种通过特定标头绕过 CORS 的方法,实现了一个更精简、更轻量级的客户端。 AI

影响 提供了一种将 LLM API 集成到浏览器应用程序中的方法,而无需依赖可能笨重或不兼容的 SDK。

排序理由 开发者描述了一种在特定环境中使用的 API 的技术变通方法。

在 dev.to — Anthropic tag 阅读 →

AI 生成摘要 · Google Gemini · 来自 1 个来源。 我们如何撰写摘要 →

报道来源 [1]

  1. dev.to — Anthropic tag TIER_1 English(EN) · Ferhat Atagün ·

    在浏览器中构建流式 Claude 客户端 — 无需 SDK

    <p>I wanted to call Claude from a browser. The Anthropic SDK said no — sort of.</p> <p>When I tried <code>import Anthropic from "@anthropic-ai/sdk"</code> in a Next.js app, the bundler crashed. The error pointed at <code>node:fs/promises</code>, deep inside the package — an agent…