MCPcopy Create free account
hub / github.com/Open-Source-Legal/OpenContracts / create

Method create

opencontractserver/llms/api.py:545–598  ·  view source on GitHub ↗

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,
    )

Source from the content-addressed store, hash-verified

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
601def _resolve_tools(tools: list[ToolType]) -> list[CoreTool]:

Callers 15

setup_telemetry_taskFunction · 0.45
create_installationFunction · 0.45
import_documentFunction · 0.45
move_documentFunction · 0.45
delete_documentFunction · 0.45
restore_documentFunction · 0.45
update_summaryMethod · 0.45

Calls 2

AgentFrameworkClass · 0.90
create_vector_storeMethod · 0.80

Tested by 15

setUpMethod · 0.36
setUpMethod · 0.36
setUpMethod · 0.36
setUpMethod · 0.36
setUpMethod · 0.36