Search

16 results found for anthropic (453ms)

Code
16

import { Hono } from "https://esm.sh/hono@3.11.7";
import { anthropic } from "https://esm.sh/@ai-sdk/anthropic@1.2.12";
import { generateText } from "https://esm.sh/ai@4.3.15";
import { createRecipe } from "../database/queries.ts";
try {
const result = await generateText({
model: anthropic("claude-3-5-haiku-latest"),
prompt: `Extract the recipe from this page content and return ONLY valid JSON matching thi
{
## Environment Variable
- **ANTHROPIC_API_KEY** - Available on Val Town and locally
## Files to Create
```typescript
import { Hono } from "https://esm.sh/hono@4.4.2";
import { anthropic } from "https://esm.sh/@ai-sdk/anthropic";
import { generateText } from "https://esm.sh/ai";
import { createRecipe } from "../database/queries.ts";
// 4. Call Claude API for extraction using Vercel AI SDK
const { text } = await generateText({
model: anthropic("claude-3-5-haiku-latest"),
prompt: `Extract the recipe from this page content and return ONLY valid JSON matching this
{
## Vercel AI SDK Usage (Recommended by Val Town)
- Package: `@ai-sdk/anthropic` with `ai` core
- API key auto-read from `ANTHROPIC_API_KEY` env var
- Model: `claude-3-5-haiku-latest` (fast and efficient for extraction)
- Function: `generateText()` for simple text generation
## Technical Notes
- Use `https://esm.sh/@ai-sdk/anthropic` and `https://esm.sh/ai` for imports
- Claude 3.5 Haiku is fast and efficient for extraction tasks
- 15k char limit prevents token overflow
## References
- [Val Town @ai-sdk/anthropic examples](https://www.val.town/examples/packages/@ai-sdk%2Fanthrop
- [AI SDK Anthropic Provider docs](https://ai-sdk.dev/providers/ai-sdk-providers/anthropic)
DEPENDS ON
- Strips HTML to plain text (removes script/style tags, then all HTML tags)
- Limits content to 15k characters
- Calls Claude 3.5 Haiku via the Vercel AI SDK (`@ai-sdk/anthropic` + `ai`)
- Parses the AI response as JSON
- Handles the "No recipe found" error case
* Examples:
* /api/resolve/davila7/claude-code-templates/supabase-toolkit
* /api/resolve/anthropics/claude-code-plugins/agent-sdk-dev
*/
export async function resolvePlugin(c: Context) {
"Bash(find:*)",
"Bash(git add:*)",
ude.com/claude-code)\n\nCo-Authored-By: Claude <noreply@anthropic.com>\nEOF\n)\")"
],
"deny": [],
**Example:**
- `/api/resolve/anthropics/claude-code-plugins/agent-sdk-dev`
**Response:**
{
"name": "agent-sdk-dev",
"namespace": "anthropics/claude-code-plugins",
"gitUrl": "https://github.com/anthropics/claude-code-plugins.git",
"description": "Development tools for building agents",
"version": "1.0.0",
"author": "Anthropic",
"keywords": ["agent", "sdk"],
"category": "development",
**Example:**
- `/api/skills/anthropics/skills/algorithmic-art`
### Install Skill
Returns git URL, metadata, and increments download stats.
Example: `/api/resolve/anthropics/claude-code-plugins/agent-sdk-dev`
2. **Search Plugins:**
Returns skill info (read-only, no install increment).
Example: `/api/skills/anthropics/skills/algorithmic-art`
2. **Install Skill:**

Vals

No vals found

Users

No users found

Docs

No docs found
2
Next