first run report
Opened this issue · 2 comments
jchris commented
I just picked this up for a potential project and hit a couple of rough spots, thought it better to share:
- Getting the dependencies together for the
.env
was more work than expected. Maybe link to the GitHub docs: https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/creating-an-oauth-app - Also good to link folks to get an org key https://platform.openai.com/account/organization
- Once that's figured out, if something goes wrong on the partykit, all I see is:
A promise rejection was handled asynchronously. This warning occurs when attaching a catch handler to a promise after it rejected. (rejection #1)
A promise rejection was handled asynchronously. This warning occurs when attaching a catch handler to a promise after it rejected. (rejection #4)
User chat messages work, so I guess this is an AI integration thing. After another user message I see:
A promise rejection was handled asynchronously. This warning occurs when attaching a catch handler to a promise after it rejected. (rejection #5)
A promise rejection was handled asynchronously. This warning occurs when attaching a catch handler to a promise after it rejected. (rejection #8)
Sorry there's no pull request. The thing I'm building might make more sense to do partykit init
on my existing UI anyway.
jchris commented
I chased the anonymous promise failure down to
const stream = OpenAIStream(openaiResponse, {
onStart: async () => onStartCallback(),
onToken: async (token) => onTokenCallback(token),
});
and neither of those callbacks get called. also this doesn't log:
// @ts-ignore
for await (const _ of stream) {
// no-op, just read the stream, onToken callback above will handle the tokens
console.log("stream", _);
}
threepointone commented
great catch, thank you! I'll have a look later this week.