nyperyvo
nyperyvo
CDCloudflare Developers
Created by nyperyvo on 5/4/2024 in #workers-help
Does Workers AI support service worker?
I’m trying to integrate AI into my workers, after I added
[ai]
bindings = 'AI'
[ai]
bindings = 'AI'
into wrangler.toml and started the dev server, I got an error:
✘ [ERROR] workerd/server/workerd-api.c++:772: error: wrapped binding module can't be resolved (internal modules only); moduleName = miniflare-internal:wrapped:__WRANGLER_EXTERNAL_AI_WORKER
✘ [ERROR] workerd/server/workerd-api.c++:772: error: wrapped binding module can't be resolved (internal modules only); moduleName = miniflare-internal:wrapped:__WRANGLER_EXTERNAL_AI_WORKER
I don’t even use it in my code. I also tried to turn off local dev, and I got an 500 internal service error after the script was uploaded and before receiving anything requests. So does Workers AI support service worker? I don’t want to use module worker because that requires me to rewrite my worker. I am aware that I can use API call to use Workers AI, I just want to know if it’s possible to use it directly in service worker and how. Any help would be appreciated, thanks in advance!
3 replies