Is There a Built-in Method to Call the Anthropic Claude 3 API?

This topic was automatically generated from Slack. You can find the original thread here.

do you have a built-in way to call the Anthropic Claude 3 API?

Based on the provided documentation, Pipedream does not have a pre-built component specifically for calling the Anthropic Claude 3 API. However, you can interact with the Anthropic (Claude) API by creating a custom Pipedream component. Here’s an example of how you might structure a component to make a request to the Anthropic API, adjusting parameters as necessary for your specific use case with Claude 3: import { axios } from "@pipedream/platform"; export default defineComponent({ props: { anthropic: { type: "app", app: "anthropic", }, }, async run({ steps, $ }) { const data = { "prompt": "Your specific prompt for Claude 3", "model": "claude-3-model-identifier", // Replace with the actual model identifier for Claude 3 "max_tokens_to_sample": 300, // Adjust as necessary // Include any other parameters required by the Claude 3 API }; return await axios($, { method: "post", url: `https://api.anthropic.com/v1/complete`, // Ensure this endpoint is correct for Claude 3 headers: { "x-api-key": `${this.anthropic.$auth.api_key}`, "Content-Type": `application/json`, "anthropic-version": `2023-06-01`, // Adjust as necessary }, data, }); }, }); Please replace "Your specific prompt for Claude 3", "claude-3-model-identifier", and any other parameters with the appropriate values for your use case. The example above is based on the structure provided in the Pipedream documentation for making a test request to the Anthropic (Claude) API. You’ll need to adjust it according to the specific requirements of the Claude 3 API. For more details on connecting your Anthropic account and making API requests, please refer to the Anthropic (Claude) documentation on Pipedream.

I believe we do, I think Pi missed on this one: Chat - Pipedream

That might be for Claude 2.

Looks like there are a few 3.0 models available: pipedream/components/anthropic/actions/common/constants.mjs at master · PipedreamHQ/pipedream · GitHub

ok, perfect. Let me try these.