Full API reference for Cord's Anthropic chatbot SDK, npm package @cord-sdk/chatbot-anthropic
This page is a detailed reference of the Anthropic chatbot SDK. For a beginner's overview of how this all fits together, see our Getting Started document, which includes chatbot example code.
The Anthropic chatbot SDK sits on top of the base SDK. The goal of this SDK is to provide utility functions and helpers to connect Anthropic to the base SDK. In particular, the main helpers here provide a getResponse function to use when defining a Chatbot with the base SDK.
The functions exported from the package are:
getResponse function which connects to Anthropic's messages API and streams the response back to Cord.getResponse for a Chatbot definition in the base SDK.getResponse) and returns data suitable for sending to Anthropic. This "suitable" data can be any of the following:MessageParam). In this case, a default model will be used (currently, claude-3-haiku-20240307, though this may change in the future).MessageCreateParams, which can specify any model (or any other parameters) that you wish. The stream parameter will be forced to true since this Cord SDK supports streaming.anthropicCompletion which just injects the system prompt at the top of the list of messages. It uses a default model (currently, claude-3-haiku-20240307, though this may change in the future).getResponse for a Chatbot definition in the base SDK.MessageParam format.Not finding the answer you need? Ask our Developer Community