Skip to content

Commit 512bd42

Browse files
whoiskatrinthreepointone
authored andcommitted
lint fixes and some cleanup
1 parent b8f53c2 commit 512bd42

File tree

15 files changed

+228
-418
lines changed

15 files changed

+228
-418
lines changed

examples/http-reusable-chat/README.md

Lines changed: 0 additions & 157 deletions
This file was deleted.

examples/http-reusable-chat/package.json

Lines changed: 0 additions & 25 deletions
This file was deleted.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Resumable Streams Chat Example
2+
3+
## Setup
4+
5+
1. Copy `.dev.vars.example` to `.dev.vars` and add your OpenAI API key:
6+
7+
```bash
8+
cp .dev.vars.example .dev.vars
9+
# Edit .dev.vars and add your OPENAI_API_KEY
10+
```
11+
12+
2. Install dependencies:
13+
14+
```bash
15+
npm install
16+
```
17+
18+
3. Start the development server:
19+
20+
```bash
21+
npm run start
22+
```
File renamed without changes.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"author": "",
3+
"description": "Resumable Stream Chat Example",
4+
"keywords": [],
5+
"license": "ISC",
6+
"private": true,
7+
"scripts": {
8+
"deploy": "vite build && wrangler deploy",
9+
"start": "vite dev"
10+
},
11+
"type": "module",
12+
"version": "0.0.0"
13+
}

examples/http-reusable-chat/src/app.tsx renamed to examples/resumable-stream-chat/src/app.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ export default function Chat() {
8888
{part.text}
8989
</div>
9090
);
91+
default:
92+
return null;
9193
}
9294
})}
9395
<br />

examples/http-reusable-chat/src/server.ts renamed to examples/resumable-stream-chat/src/server.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ type Env = {
1616

1717
export class ResumableChatAgent extends AIHttpChatAgent<Env> {
1818
async onChatMessage(
19-
onFinish: StreamTextOnFinishCallback<ToolSet>,
20-
options?: { streamId?: string }
19+
onFinish: StreamTextOnFinishCallback<ToolSet>
2120
): Promise<Response | undefined> {
2221
const stream = createUIMessageStream({
2322
execute: async ({ writer }) => {

0 commit comments

Comments
 (0)