Description
Currently CAIMS only supports Anthropic Claude as LLM provider. We need to add an OpenAI GPT adapter to enable multi-provider support.
What to do
- Create a new file
apps/web/lib/adapters/openai.ts following the pattern in apps/web/lib/adapters/anthropic.ts
-
- Implement the same
chat() interface returning { content, inputTokens, outputTokens }
-
- Use the
openai npm package
-
- Add
OPENAI_API_KEY to .env.example
-
- Add a provider selection mechanism in the chat route
Skills needed
- TypeScript
-
- Basic understanding of LLM APIs
References
- Existing adapter:
apps/web/lib/adapters/anthropic.ts
-
Description
Currently CAIMS only supports Anthropic Claude as LLM provider. We need to add an OpenAI GPT adapter to enable multi-provider support.
What to do
apps/web/lib/adapters/openai.tsfollowing the pattern inapps/web/lib/adapters/anthropic.tschat()interface returning{ content, inputTokens, outputTokens }openainpm packageOPENAI_API_KEYto.env.exampleSkills needed
References
apps/web/lib/adapters/anthropic.ts