Closed Liyulingyue closed 6 months ago
健大佬的教程提过这问题
你好,在Jupyter notebook中可以使用如下方式配置环境变量:
import os
os.environ["EB_AGENT_ACCESS_TOKEN"] = "<aistudio-access-token>"
os.environ["EB_AGENT_LOGGING_LEVEL"] = "INFO"
请确保上述代码块在import erniebot_agent
之前被执行。
此外,对于日志等级,由于erniebot-agent
使用Python logging标准库,因此可以使用logging标准库的惯用方式配置日志系统,例如:
import logging
logging.getLogger("erniebot_agent").setLevel("INFO")
感谢回复!问题已解决!
在AIStudio中无法通过
导入环境变量,从而增加ernie-bot-agent在aistudio上应用和部署的难度。