e2b-dev / fragments

Open-source Next.js template for building apps that are fully generated by AI. By E2B.
https://fragments.e2b.dev
Apache License 2.0
3.48k stars 455 forks source link

Custom baseURL results to data stream hanging #10

Closed NeverOccurs closed 3 months ago

NeverOccurs commented 3 months ago

I add following lines to route.ts: import { createAnthropic } from '@ai-sdk/anthropic' const anthropic = createAnthropic({ baseURL: 'https://xxxxxx.xx/v1', //My custom anthropic baseURL });

The application can run and the LLM response can be seen. But it won't give me back the result of running the code and can't preview. The log shows:

userID xxxxxx template code-interpreter-multilang The data stream is hanging. Did you forget to close it with data.close()? create or connect code interpreter sandbox xxxxxxx POST /api/chat 200 in 7291ms

I honestly do not know if using default anthropic api settings will be fine because I don't have a anthropic api account. Or maybe it is something with the sandbox.

NeverOccurs commented 3 months ago

solved. my E2B api key is wrong. The message "The data stream is hanging. Did you forget to close it with data.close()?" is still there but seems can be ignored.

mishushakov commented 2 months ago

Custom baseURL is supported now too