PaddlePaddle / ERNIE-SDK

ERNIE Bot Agent is a Large Language Model (LLM) Agent Framework, powered by the advanced capabilities of ERNIE Bot and the platform resources of Baidu AI Studio.
http://ernie-bot-agent.readthedocs.io/
Apache License 2.0
343 stars 52 forks source link

ernie-bot-agent 不支持在aistudio的notebook环境中运行 #321

Closed Liyulingyue closed 6 months ago

Liyulingyue commented 7 months ago

在AIStudio中无法通过

! export EB_AGENT_ACCESS_TOKEN=<aistudio-access-token>
! export EB_AGENT_LOGGING_LEVEL=info

导入环境变量,从而增加ernie-bot-agent在aistudio上应用和部署的难度。

itagan commented 7 months ago

健大佬的教程提过这问题

Bobholamovic commented 7 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")
Liyulingyue commented 6 months ago

感谢回复!问题已解决!