Skip to content

Commit fbb2b22

Browse files
committed
collapse code blocks
1 parent eddf113 commit fbb2b22

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

src/content/docs/agents/index.mdx

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,11 @@ Agents are deployed to Cloudflare's [Workers](/workers/) platform using [Durable
3434

3535
## Why build agents on Cloudflare?
3636

37-
- *Designed for durable execution:* [Durable Objects](/durable-objects/) and [Workflows](/workflows) are built for a programming model that enables guaranteed execution for async tasks like long-running deep thinking LLM calls, human-in-the-loop, or unreliable API calls.
3837
- *Non I/O bound pricing:* don't pay for long-running processes when your code is not executing. Cloudflare Workers is designed to scale down and [only charge you for CPU time](https://blog.cloudflare.com/workers-pricing-scale-to-zero/), as opposed to wall-clock time.
38+
- *Designed for durable execution:* [Durable Objects](/durable-objects/) and [Workflows](/workflows) are built for a programming model that enables guaranteed execution for async tasks like long-running deep thinking LLM calls, human-in-the-loop, or unreliable API calls.
3939
- *Scalable, and reliable, without compromising on performance:* by running on Cloudflare's network, agents can execute tasks close to the user without introducing latency for real-time experiences.
4040

41+
<!--
4142
## All the products you need in one platform
4243

4344
<RelatedProduct header="AI Gateway" href="/ai-gateway/" product="ai-gateway">
@@ -52,6 +53,8 @@ Build full-stack AI applications with Vectorize, Cloudflare’s vector database.
5253

5354
</RelatedProduct>
5455

56+
-->
57+
5558
## Start Building
5659

5760
<Tabs syncKey="agents-products">
@@ -65,7 +68,7 @@ cd workflows-starter
6568
npm i resend
6669
```
6770

68-
```ts
71+
```ts collapse={30,1000}
6972
import { WorkflowEntrypoint, WorkflowStep, WorkflowEvent } from 'cloudflare:workers';
7073
import { Resend } from 'resend';
7174

@@ -187,7 +190,7 @@ Stream responses over [WebSockets](/durable-objects/best-practices/websockets/),
187190
npm i openai
188191
```
189192

190-
```ts
193+
```ts collapse={30,1000}
191194
import { DurableObject } from "cloudflare:workers";
192195

193196
export interface Env {
@@ -282,7 +285,7 @@ Use the [Browser Rendering API](/browser-rendering/) to allow your agents to sea
282285
npm install @cloudflare/puppeteer --save-dev
283286
```
284287

285-
```ts
288+
```ts collapse={30,1000}
286289
import puppeteer from "@cloudflare/puppeteer";
287290

288291
interface Env {
@@ -329,7 +332,7 @@ export default {
329332

330333
Use [AI Gateway](/ai-gateway/) to cache, log, retry and run [evals](/ai-gateway/evaluations/) (evaluations) for your agents, no matter where they're deployed.
331334

332-
```py
335+
```py collapse={30,1000}
333336
from anthropic import Anthropic
334337

335338
anthropic = Anthropic(
@@ -369,7 +372,7 @@ Give your agents more context and the ability to search across content, reply to
369372
npm i @langchain/cloudflare hono
370373
```
371374

372-
```ts
375+
```ts collapse={30,1000}
373376
import {
374377
CloudflareVectorizeStore,
375378
CloudflareWorkersAIEmbeddings
@@ -448,7 +451,7 @@ Ship faster with the [AI SDK](https://sdk.vercel.ai/docs/introduction): make it
448451
npm i ai workers-ai-provider
449452
```
450453

451-
```ts
454+
```ts collapse={30,1000}
452455
import { createWorkersAI } from 'workers-ai-provider';
453456
import { streamText } from 'ai';
454457

@@ -484,7 +487,7 @@ Use any model provider with OpenAI compatible endpoints, including [ChatGPT](htt
484487
npm i openai
485488
```
486489

487-
```ts
490+
```ts collapse={30,1000}
488491
import OpenAI from "openai";
489492

490493
export interface Env {

0 commit comments

Comments
 (0)