Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import bot, {
events,
forward,
PoeBotServerSentEvent,
QueryRequest,
sleep,
} from "https://esm.town/v/jeffreyyoung/poe_bot";
export default bot({
async *handleMessage(query, { req }) {
for await (const event of forward(query, "GPT-4o", "FrwBHBROBdXVDbCpSsNozHUinTVzpxaY")) {
console.log("events", event);
yield event as any;
}
yield "all done";
yield events.done();
},
settings: {
server_bot_dependencies: {
"GPT-4o": 1,
},
allow_attachments: true,
introduction_message: "hello",
},
});
jeffreyyoung-possibleaquamarinelocust.web.val.run
August 18, 2024