我们已完成 1.25 亿美元的 B 轮融资,用于构建代理工程平台。阅读更多。
Python
langchain-localai
pip install -U langchain-localai
from langchain_localai import LocalAIEmbeddings
embeddings = LocalAIEmbeddings( openai_api_base="https://:8080", model="embedding-model-name" )
text = "This is a test document."
query_result = embeddings.embed_query(text)
doc_result = embeddings.embed_documents([text])
from langchain_community.embeddings import LocalAIEmbeddings
import os # if you are behind an explicit proxy, you can use the OPENAI_PROXY environment variable to pass through os.environ["OPENAI_PROXY"] = "http://proxy.yourcompany.com:8080"
此页面有帮助吗?