"""Embedding 模型工厂。"""

from langchain_community.embeddings import DashScopeEmbeddings

from agent.config import load_config


def get_embedding_model() -> DashScopeEmbeddings:
    """创建与 Milvus 1024 维集合配套的 DashScope Embedding 模型。"""
    config = load_config()
    return DashScopeEmbeddings(
        model="text-embedding-v4",
        dashscope_api_key=config.api_key,
    )
