# Agent Server Responses Samples

These samples mirror the most important Python `azure-ai-agentserver-responses`
patterns in TypeScript.

## Samples

| Sample | Pattern | Purpose |
| --- | --- | --- |
| [sample_01_getting_started.ts](./sample_01_getting_started.ts) | `TextResponse` | Minimal echo server |
| [sample_02_streaming_text.ts](./sample_02_streaming_text.ts) | `TextResponse` + async iterable | Token-style streaming |
| [sample_03_raw_events.ts](./sample_03_raw_events.ts) | Raw `ResponseStreamEvent` | Function-call style event control |
| [sample_04_foundry_storage.ts](./sample_04_foundry_storage.ts) | `FoundryStorageProvider` | Durable Foundry response storage |
| [sample_05_agent_core_bridge.ts](./sample_05_agent_core_bridge.ts) | `agent-foundry-hosting/responses` | Bridge an `agent-core` agent into this protocol host |

## Running Locally

Build the workspace first, then run a sample with a TypeScript runner such as
`tsx` from the workspace root:

```bash
pnpm --filter @cuylabs/agent-foundry-agentserver-responses build
pnpm exec tsx packages/agent-foundry-agentserver-responses/samples/sample_01_getting_started.ts
```

The Foundry storage sample expects Azure credentials and
`FOUNDRY_PROJECT_ENDPOINT`.

The agent-core bridge sample includes a placeholder `myAgent` import. Replace
that import with the local agent you want to host.
