feat(assistant): can use cloudflare for assistant - #1421
Conversation
|
@Barbapapazes is attempting to deploy a commit to the NuxtLabs Team on Vercel. A member of the Team first needs to authorize it. |
commit: |
Co-authored-by: Estéban <esteban.soubiran@insa-cvl.fr>
|
Hey @Barbapapazes, thanks for this PR. I'd rather not add Cloudflare as a first-class provider in core though: it doesn't scale to the next provider request. I went with generic primitives instead (#1414): Cloudflare can then lives in user-land: // server/api/assistant.ts
import { createAiGateway } from 'ai-gateway-provider'
import { createUnified } from 'ai-gateway-provider/providers/unified'
const gateway = createAiGateway({ accountId, gateway: gatewayId, apiKey })
export default defineEventHandler(event => assistantSearchHandler(event, {
model: gateway(createUnified()('workers-ai/@cf/zai-org/glm-4.7-flash'))
}))Can you ensure it fits your needs? 🙏 Closing in favor of #1427 |
|
Hey @larbish, Yes, that makes sense and I prefer the idea of having a generic way to allow anyone to set up the provider that fits their needs. I'll try it in a couple of days but from what I can read, it fits my needs 🙇♂️ Thanks 💯 |
Hello 👋,
This PR add support for the Cloudflare AI Gateway in the Docus Assistant module. It update the default model to
workers-ai/@cf/zai-org/glm-4.7-flashwhen using the Cloudflare provider, and adds the necessary configuration options for the Cloudflare AI Gateway. Everything is configured via environment variables, and the module will automatically use the correct model based on the selected provider.The backward compatibility is maintained, and the Vercel provider remains the default for users who do not specify a provider.