Create a vector store using the specified framework. Args: framework: "pydantic_ai" user_id: Filter by user ID corpus_id: Filter by corpus ID document_id: Filter by document ID embedder_path: Path to embedder model to use
(
*,
framework: Optional[FrameworkType] = None,
user_id: Optional[Union[str, int]] = None,
corpus_id: Optional[Union[str, int]] = None,
document_id: Optional[Union[str, int]] = None,
embedder_path: Optional[str] = None,
must_have_text: Optional[str] = None,
embed_dim: int = 384,
**kwargs,
)
| 543 | |
| 544 | @staticmethod |
| 545 | def create( |
| 546 | *, |
| 547 | framework: Optional[FrameworkType] = None, |
| 548 | user_id: Optional[Union[str, int]] = None, |
| 549 | corpus_id: Optional[Union[str, int]] = None, |
| 550 | document_id: Optional[Union[str, int]] = None, |
| 551 | embedder_path: Optional[str] = None, |
| 552 | must_have_text: Optional[str] = None, |
| 553 | embed_dim: int = 384, |
| 554 | **kwargs, |
| 555 | ) -> Any: |
| 556 | """ |
| 557 | Create a vector store using the specified framework. |
| 558 | |
| 559 | Args: |
| 560 | framework: "pydantic_ai" |
| 561 | user_id: Filter by user ID |
| 562 | corpus_id: Filter by corpus ID |
| 563 | document_id: Filter by document ID |
| 564 | embedder_path: Path to embedder model to use |
| 565 | must_have_text: Filter by text content |
| 566 | embed_dim: Embedding dimension to use (384, 768, 1024, 1536, 3072, or 4096) |
| 567 | **kwargs: Additional framework-specific arguments |
| 568 | |
| 569 | Returns: |
| 570 | Framework-specific vector store instance |
| 571 | |
| 572 | Examples: |
| 573 | # Pydantic AI vector store |
| 574 | store = vector_stores.create("pydantic_ai", corpus_id=123) |
| 575 | |
| 576 | # Pydantic AI vector store |
| 577 | store = vector_stores.create("pydantic_ai", document_id=456) |
| 578 | """ |
| 579 | # Resolve default framework if caller did not specify one |
| 580 | if framework is None: |
| 581 | framework = getattr( |
| 582 | settings, "LLMS_DOCUMENT_AGENT_FRAMEWORK", AgentFramework.PYDANTIC_AI |
| 583 | ) |
| 584 | |
| 585 | # Normalize framework |
| 586 | if isinstance(framework, str): |
| 587 | framework = AgentFramework(framework) |
| 588 | |
| 589 | return UnifiedVectorStoreFactory.create_vector_store( |
| 590 | framework=framework, |
| 591 | user_id=user_id, |
| 592 | corpus_id=corpus_id, |
| 593 | document_id=document_id, |
| 594 | embedder_path=embedder_path, |
| 595 | must_have_text=must_have_text, |
| 596 | embed_dim=embed_dim, |
| 597 | **kwargs, |
| 598 | ) |
| 599 | |
| 600 | |
| 601 | def _resolve_tools(tools: list[ToolType]) -> list[CoreTool]: |