Documentation on how to support a new AI provider.
See CONTRIBUTING.
The aiProvider
property in the config schema (lib/schema.ts) needs to be updated to allow for inputting any necessary information for this AI provider (e.g. model name, api key). Don't forget to rebuild the config!
Implement the Provider
interface (ai-providers/provider.ts) in a file also under ai-providers/ (e.g. ai-providers/open-ai.ts).
Ensure that the askStream
response returns a Node.js-builtin ReadableStream
that outputs the expected format defined in the REST API docs.
See plugins/warp.ts build()
.
See lib/generator.ts.
Add provider to tests/unit/ai-providers.test.ts.
Add provider config to tests/e2e/api.test.ts.
Add the provider config to the schema tests tests/types/schema.test-d.ts.