Open
Description
CocoIndex 🥥 currently supports OpenAI and Ollama ✨ , to add LLM as part of the data pipeline. https://cocoindex.io/docs/ai/llm
Here is an example of how Cocoindex uses Ollama to extract structured information from PDF.
https://cocoindex.io/blogs/cocoindex-ollama-structured-extraction-from-pdf/
We would like to add support for Anthropic API - https://docs.anthropic.com/en/api/getting-started
Related code to support OpenAI
Steps:
- Update Rust code:
- Add Enum to LlmApiType in Rust:
Lines 9 to 12 in 801ae8f
- Create Anthropic client similar to OpenAI client: https://github.com/cocoindex-io/cocoindex/blob/main/src/llm/openai.rs
- Update the router to connect to the Anthropic client:
Lines 53 to 60 in 801ae8f
- Add Enum to LlmApiType in Rust:
- Add Enum to LlmApiType in Python]:
Lines 52 to 62 in 801ae8f
- Test with the existing
manuals_llm_extraction
example. You can add a few lines similar to OpenAI:cocoindex/examples/manuals_llm_extraction/main.py
Lines 93 to 95 in 555d328
- Update documentation: https://cocoindex.io/docs/ai/llm
Metadata
Metadata
Assignees
Labels
No labels