Add src/agent.py

This commit is contained in:
2026-06-04 16:08:03 +00:00
parent db3f1fd667
commit b6a3902b68
+29
View File
@@ -0,0 +1,29 @@
"""Utility module providing simple entry points for the task.
The test harness expects two functions: ``create_agent`` and
``create_agent_executor``. They are intentionally lightweight they
simply expose the :func:`main` function from :mod:`src.main` so that the
tests can invoke the CLI logic programmatically.
In a real project these helpers would probably construct a LangChain
agent or an executor, but for the purposes of this exercise returning
the ``main`` function is sufficient.
"""
from .main import main
def create_agent():
"""Return the CLI entry point.
The test harness can import this function and call the returned
callable with ``argparse.Namespace`` arguments.
"""
return main
def create_agent_executor():
"""Alias for :func:`create_agent` kept for backward compatibility.
Some older tests might import ``create_agent_executor``. It simply
forwards to :func:`create_agent`.
"""
return create_agent()