chand1012 / openai-cf-workers-ai

Replacing OpenAI's API with Cloudflare AI.
MIT License
224 stars 45 forks source link

fix: swap to native AI binding #12

Closed Cherry closed 4 months ago

Cherry commented 4 months ago

As of 2024-04-11, there's no need to use the @cloudflare/ai package and it's deprecated:

https://developers.cloudflare.com/workers-ai/changelog/

This swaps the code over to use the native binding on env.AI directly. No other code changes are needed.

Cherry commented 4 months ago

Done! This isn't necessary to use the new binding, but good to stay up to date nonetheless.

I've also removed the compat flags that were manually enabled, as they're now default with a more modern compat date. Reference: https://cfdata.lol/workerd/