Search

3,155 results found for anthropic (8055ms)

Code
3,144

project: any;
branchId: string | undefined;
anthropicApiKey: string;
bearerToken: string;
selectedFiles: string[];
project,
branchId,
anthropicApiKey,
bearerToken,
selectedFiles,
project,
branchId,
anthropicApiKey,
selectedFiles,
images: images
- [x] Add a "view source" / "send me a PR" link
- [x] Show the HTTP preview in second column if there is one (and let the user pick which one to
- [x] Figure out a convention to teach in the anthropic prompt mod where the LLM always checks t
- [x] Ability to create new projects from the interface
- [x] Figure out why OpenTownie can't create HTTP vals. Maybe give it a seperate tool for it?
- [x] Start a timer for messages
- [x] Add more indicators that it's "still working"
- [x] Require users supply their own Anthropic token?
- [x] Add cost indications on messages
- [x] Add a bell noise when the message is done to let us know
## How It Works
1. **Login**: Authenticate with your Val Town API token and Anthropic API key
2. **Select a Project**: Choose which Val Town project you want to work on
3. **Select Files**: Browse your project files and select which ones to include in the context w
- A Val Town account with API access
- An Anthropic API key (Claude 3.7 Sonnet)
### Setup
1. Visit the OpenTownie app
2. Enter your Val Town API token (with `projects:write` and `users:read` permissions)
3. Enter your Anthropic API key
4. Click "Login" to access your projects
- AI SDK for Claude integration
The application proxies requests to the Anthropic API and Val Town API, allowing Claude to view
## Privacy & Security
- Your Val Town API token and Anthropic API key are stored locally in your browser
- No data is stored on our servers
- All communication with the APIs is done directly from your browser
<ol>
<li>Login with your Val Town API token</li>
<li>Add your Anthropic API key</li>
<li>Select a project to work on</li>
<li>Chat with Claude about your code</li>
</ul>
<p >
The application proxies requests to the Anthropic API and Val Town API, allowing Claud
</p>
<div >
const TOKEN_KEY = "bearer";
const ANTHROPIC_KEY = "anthropic_api_key";
export function useAuth () {
const [token, setToken, removeToken] = useLocalStorage(TOKEN_KEY, "");
const [anthropicApiKey, setAnthropicApiKey, removeAnthropicApiKey] = useLocalStorage(ANTHROPIC
const [error, setError] = useState(null);
const isAuthenticated = !!token && !!anthropicApiKey;
const authenticate = async (valTownAPIKey: string, anthropicKey: string) => {
// replace all this with oauth when it's ready
try {
setError(data.error);
removeToken();
removeAnthropicApiKey();
return;
}
setError(null);
setToken(valTownAPIKey);
setAnthropicApiKey(anthropicKey);
} catch (e) {
console.error(e);
setError(e.error);
removeToken();
removeAnthropicApiKey();
}
}
const logOut = () => {
removeToken();
removeAnthropicApiKey();
}
logOut,
token,
anthropicApiKey,
};
}
</div>
<div>
<label htmlFor="anthropic-api-key" className="label">Anthropic API Key</label>
<input
type="password"
id="anthropic-api-key"
name="anthropic-key"
value={apiKey}
onChange={e => {
refetch: () => void;
}) {
const { token, anthropicApiKey } = useAuth();
const [images, setImages] = useState<(string|null)[]>([]);
const [selectedFiles, setSelectedFiles] = useState<string[]>([]);
project,
branchId,
anthropicApiKey,
bearerToken: token,
selectedFiles,
import { getWeather, WeatherResponse } from "https://esm.town/v/geoffreylitt/getWeather";
import { sqlite } from "https://esm.town/v/stevekrouse/sqlite";
import Anthropic from "npm:@anthropic-ai/sdk@0.24.3";
const TABLE_NAME = `memories`;
try {
// 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",
max_tokens: 150,
import { Bot } from "https://deno.land/x/grammy@v1.35.0/mod.ts";
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";
import {
} from "../memoryUtils.ts";
async function generateBriefingContent(anthropic, memories, today, isSunday) {
try {
const weekdaysHelp = generateWeekDays(today);
};
console.log("Sending prompt to Anthropic...", userMessage);
const response = await anthropic.messages.create({
model: "claude-3-7-sonnet-latest",
max_tokens: 30000,
export async function sendDailyBriefing(chatId?: string, today?: DateTime) {
// 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 });
// Initialize Telegram bot
// Generate briefing content
const content = await generateBriefingContent(
anthropic,
memories,
today,
You'll need to set up some environment variables to make it run.
- `ANTHROPIC_API_KEY` for LLM calls
- You'll need to follow [these instructions](https://docs.val.town/integrations/telegram/) to ma
- For the Google Calendar integration you'll need `GOOGLE_CALENDAR_ACCOUNT_ID` and `GOOGLE_CALEN

Vals

10
View more
diegoivo
anthropicWorkflow
 
Public
diegoivo
sdkAnthropic
 
Public
maddy
anthropicProxy
 
Public
stevekrouse
anthropicStreamDemo
 
Public
toowired
anthropicCaching
 
Public

Users

No users found
No docs found