使用LangSmith
import os
os.environ['LANGCHAIN_TRACING_V2'] = "true"
os.environ['LANGCHAIN_API_KEY'] = "你的密钥"
通过langSmith可以记录你的提示词和token使用数量。