mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-15 01:18:26 +08:00
feat: add Perplexity contextualized embeddings API as a new model provider (#13709)
### What problem does this PR solve? Adds Perplexity contextualized embeddings API as a new model provider, as requested in #13610. - `PerplexityEmbed` provider in `rag/llm/embedding_model.py` supporting both standard (`/v1/embeddings`) and contextualized (`/v1/contextualizedembeddings`) endpoints - All 4 Perplexity embedding models registered in `conf/llm_factories.json`: `pplx-embed-v1-0.6b`, `pplx-embed-v1-4b`, `pplx-embed-context-v1-0.6b`, `pplx-embed-context-v1-4b` - Frontend entries (enum, icon mapping, API key URL) in `web/src/constants/llm.ts` - Updated `docs/guides/models/supported_models.mdx` - 22 unit tests in `test/unit_test/rag/llm/test_perplexity_embed.py` Perplexity's API returns `base64_int8` encoded embeddings (not OpenAI-compatible), so this uses a custom `requests`-based implementation. Contextualized vs standard model is auto-detected from the model name. Closes #13610 ### Type of change - [x] New Feature (non-breaking change which adds functionality) - [x] Documentation Update
This commit is contained in:
@@ -65,6 +65,7 @@ export enum LLMFactory {
|
||||
N1n = 'n1n',
|
||||
Avian = 'Avian',
|
||||
RAGcon = 'RAGcon',
|
||||
Perplexity = 'Perplexity',
|
||||
}
|
||||
|
||||
// Please lowercase the file name
|
||||
@@ -135,6 +136,7 @@ export const IconMap = {
|
||||
[LLMFactory.N1n]: 'n1n',
|
||||
[LLMFactory.Avian]: 'avian',
|
||||
[LLMFactory.RAGcon]: 'ragcon',
|
||||
[LLMFactory.Perplexity]: 'perplexity',
|
||||
};
|
||||
|
||||
export const APIMapUrl = {
|
||||
@@ -188,4 +190,6 @@ export const APIMapUrl = {
|
||||
[LLMFactory.PaddleOCR]: 'https://www.paddleocr.ai/latest/',
|
||||
[LLMFactory.N1n]: 'https://docs.n1n.ai',
|
||||
[LLMFactory.Avian]: 'https://avian.io',
|
||||
[LLMFactory.Perplexity]:
|
||||
'https://docs.perplexity.ai/docs/embeddings/quickstart',
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user