chain.py 372 B

123456789101112131415
  1. from langchain.agents import create_agent
  2. from .llm import create_llm
  3. from .config import AppConfig
  4. def create_chat_agent(config:AppConfig):
  5. llm = create_llm(config)
  6. agent = create_agent(
  7. llm=llm,
  8. tools=[],
  9. system_prompt="""
  10. 你是一个耐心、清晰的 Python 和 Agent 开发学习助手。
  11. """
  12. )
  13. return agent