alipay / agentUniverse

agentUniverse is a LLM multi-agent framework that allows developers to easily build multi-agent applications.
Apache License 2.0
852 stars 108 forks source link

embedding相关问题 #175

Closed darvsum closed 1 week ago

darvsum commented 2 weeks ago

embedding能否使用第三方的例如:bge的,怎样集成?

AniviaTn commented 2 weeks ago

您可以参考https://github.com/alipay/agentUniverse/blob/master/agentuniverse/agent/action/knowledge/embedding/dashscope_embedding.py 当中的内容,继承Embedding类,重写get_embeddings和async_get_embeddings函数,这两个函数接受texts: List[str]一组字符串作为入参,并返回一个List[List[float]],其中每一个List[float]都是对应输入texts一个字符串的embedding后的向量。