Search

1,526 results found for anthropic

Code
1,513

import { DateTime } from "https://esm.sh/luxon@3.4.4";
import Anthropic from "npm:@anthropic-ai/sdk@0.24.3";
async function analyzeHtmlContent(
anthropic: Anthropic,
htmlContent: string,
try {
const response = await anthropic.messages.create({
model: "claude-3-5-sonnet-latest",
// Get Anthropic API key from environment
const apiKey = Deno.env.get("ANTHROPIC_API_KEY");
if (!apiKey) {
console.error("Anthropic API key is not configured for this val.");
return;
// Initialize Anthropic client
const anthropic = new Anthropic({ apiKey });
const response = await anthropic.messages.create({
model: "claude-3-5-sonnet-latest",
const htmlAnalysis = await analyzeHtmlContent(
anthropic,
e.html || "",
import { sqlite } from "https://esm.town/v/stevekrouse/sqlite";
import Anthropic from "npm:@anthropic-ai/sdk@0.24.3";
// Get API key from environment
const apiKey = Deno.env.get("ANTHROPIC_API_KEY");
if (!apiKey) {
console.error("Anthropic API key is not configured.");
return null;
// Initialize Anthropic client
const anthropic = new Anthropic({ apiKey });
const response = await anthropic.messages.create({
model: "claude-3-5-sonnet-latest",
import { DateTime } from "https://esm.sh/luxon@3.4.4";
import Anthropic from "npm:@anthropic-ai/sdk@0.24.3";
import { backstory } from "../backstory.ts";
async function generateBriefingContent(anthropic, memories, today, isSunday) {
try {
console.log("Sending prompt to Anthropic...", userMessage);
const response = await anthropic.messages.create({
model: "claude-3-7-sonnet-latest",
// Get API keys from environment
const apiKey = Deno.env.get("ANTHROPIC_API_KEY");
const telegramToken = Deno.env.get("TELEGRAM_TOKEN");
if (!apiKey) {
console.error("Anthropic API key is not configured.");
return;
// Initialize Anthropic client
const anthropic = new Anthropic({ apiKey });
const content = await generateBriefingContent(
anthropic,
memories,
import { sqlite } from "https://esm.town/v/stevekrouse/sqlite";
import Anthropic from "npm:@anthropic-ai/sdk@0.24.3";
// Get API key from environment
const apiKey = Deno.env.get("ANTHROPIC_API_KEY");
if (!apiKey) {
console.error("Anthropic API key is not configured.");
return null;
// Initialize Anthropic client
const anthropic = new Anthropic({ apiKey });
const response = await anthropic.messages.create({
model: "claude-3-5-sonnet-latest",
n account, click the **Remix** button and then add your ANTHROPIC_API_KEY. You can leave all the
import { readFile } from "https://esm.town/v/std/utils/index.ts";
import { createAnthropic } from "npm:@ai-sdk/anthropic@1.2.12";
import {
const apiKey = Deno.env.get("ANTHROPIC_API_KEY");
const anthropic = createAnthropic({ apiKey });
let tracedModel = anthropic(model);
// Wrap the Anthropic model with PostHog tracing
tracedModel = withTracing(anthropic(model), phClient, {
posthogDistinctId: user.id,
lastMessage.content.at(-1).providerOptions = {
anthropic: { cacheControl: { type: "ephemeral" } },
};
cache_read_tokens:
result.providerMetadata.anthropic.cacheReadInputTokens,
cache_write_tokens:
result.providerMetadata.anthropic.cacheCreationInputTokens,
});
cache_read_tokens:
result.providerMetadata.anthropic.cacheReadInputTokens,
cache_write_tokens:
result.providerMetadata.anthropic.cacheCreationInputTokens,
});
branchId,
// anthropicApiKey,
// bearerToken,
branchId,
// anthropicApiKey,
// bearerToken,
n account, click the **Remix** button and then add your ANTHROPIC_API_KEY. You can leave all the
import { readFile } from "https://esm.town/v/std/utils/index.ts";
import { createAnthropic } from "npm:@ai-sdk/anthropic@1.2.12";
import {
const apiKey = Deno.env.get("ANTHROPIC_API_KEY");
const anthropic = createAnthropic({ apiKey });
let tracedModel = anthropic(model);
// Wrap the Anthropic model with PostHog tracing
tracedModel = withTracing(anthropic(model), phClient, {
posthogDistinctId: user.id,
lastMessage.content.at(-1).providerOptions = {
anthropic: { cacheControl: { type: "ephemeral" } },
};
cache_read_tokens:
result.providerMetadata.anthropic.cacheReadInputTokens,
cache_write_tokens:
result.providerMetadata.anthropic.cacheCreationInputTokens,
});
cache_read_tokens:
result.providerMetadata.anthropic.cacheReadInputTokens,
cache_write_tokens:
result.providerMetadata.anthropic.cacheCreationInputTokens,
});
import { readFile } from "https://esm.town/v/std/utils/index.ts";
import { createAnthropic } from "npm:@ai-sdk/anthropic@1.2.12";
import {
const apiKey = Deno.env.get("ANTHROPIC_API_KEY");
const anthropic = createAnthropic({ apiKey });
let tracedModel = anthropic(model);
// Wrap the Anthropic model with PostHog tracing
tracedModel = withTracing(anthropic(model), phClient, {
posthogDistinctId: user.id,
lastMessage.content.at(-1).providerOptions = {
anthropic: { cacheControl: { type: "ephemeral" } },
};
cache_read_tokens:
result.providerMetadata.anthropic.cacheReadInputTokens,
cache_write_tokens:
result.providerMetadata.anthropic.cacheCreationInputTokens,
});
cache_read_tokens:
result.providerMetadata.anthropic.cacheReadInputTokens,
cache_write_tokens:
result.providerMetadata.anthropic.cacheCreationInputTokens,
});
branchId,
// anthropicApiKey,
// bearerToken,
// BEFORE (v4):
import { createAnthropic } from "npm:@ai-sdk/anthropic@1.2.12";
import {
// AFTER (v5):
import { createAnthropic } from "npm:@ai-sdk/anthropic@2.0.0";
import {
- `npm:ai@4.3.19`
- `npm:@ai-sdk/anthropic@1.2.12`
- `@ai-sdk/react@1.2.12`
import { readFile } from "https://esm.town/v/std/utils/index.ts";
import { createAnthropic } from "npm:@ai-sdk/anthropic@1.2.12";
import {
const apiKey = Deno.env.get("ANTHROPIC_API_KEY");
const anthropic = createAnthropic({ apiKey });
let tracedModel = anthropic(model);
// Wrap the Anthropic model with PostHog tracing
tracedModel = withTracing(anthropic(model), phClient, {
posthogDistinctId: user.id,
lastMessage.content.at(-1).providerOptions = {
anthropic: { cacheControl: { type: "ephemeral" } },
};
cache_read_tokens:
result.providerMetadata.anthropic.cacheReadInputTokens,
cache_write_tokens:
result.providerMetadata.anthropic.cacheCreationInputTokens,
});
cache_read_tokens:
result.providerMetadata.anthropic.cacheReadInputTokens,
cache_write_tokens:
result.providerMetadata.anthropic.cacheCreationInputTokens,
});
branchId,
// anthropicApiKey,
// bearerToken,

Vals

12
View more
cephalization
anthropicProxy
 
Public
stevekrouse
anthropicStreamDemo
 
Public
ivanjiang27
Futu-Anthropic
 
Public
emailclubhouse
anthropic_proxy
 
Public
diegoivo
anthropicWorkflow
 
Public
diegoivo
sdkAnthropic
 
Public
maddy
anthropicProxy
 
Public
mmrech
anthropicProxy
 
Public
jake
anthropicCaching
 
Public
toowired
anthropicCaching
 
Public
jsomers
watchAnthropicCircuitsBlog
 
Public
stevekrouse
anthropicCaching
 
Public
102
Next