创建 Pinecone 客户端
在整个课程中,您将编写 Python 代码,通过 Pinecone 的 Python 客户端与 Pinecone 交互。第一步,您需要创建自己的 Pinecone API 密钥。本课程练习中使用的 Pinecone API 密钥不会以任何形式被存储。
要创建密钥,您需要先在 https://www.pinecone.io/ 注册一个免费的 Pinecone 入门账户。然后,前往 API Keys 页面创建您的密钥。

本练习是课程的一部分
使用 Pinecone 构建 AI 应用
练习说明
- 从
pinecone导入用于创建 Pinecone 客户端的类。 - 实例化 Pinecone 类,并传入您的 API 密钥。
交互式实操练习
通过完成这段示例代码来试试这个练习。
# Import the Pinecone library
from ____ import ____
# Initialize the Pinecone client
pc = ____