连接到索引
要在新建的 Pinecone 索引中开始摄取向量并进行向量操作,您首先需要连接到该索引!得到的索引对象在 Python 中提供多种方法,用于摄取、操作并探索索引内容。
Pinecone 类已为您导入,并将在整个课程中可用。
本练习是课程的一部分
使用 Pinecone 构建 AI 应用
练习说明
- 使用您的 API 密钥初始化 Pinecone 连接。
- 连接到
"my-first-index"索引。 - 使用索引方法打印该索引的关键统计信息。
交互式实操练习
通过完成这段示例代码来试试这个练习。
# Set up the client with your API key
pc = Pinecone(api_key="____")
# Connect to your index
index = pc.____("____")
# Print the index statistics
print(index.____)