@@ -56,6 +56,12 @@ the user's project, while only ever importing the single keyword.
5656## ` agentstack.conf.PATH `
5757` <pathlib.Path> ` This is the path to the current project directory.
5858
59+ ## ` @agentstack.agent `
60+ ` <callable> ` This is a decorator that marks a method as belonging to an Agent.
61+
62+ ## ` @agentstack.task `
63+ ` <callable> ` This is a decorator that marks a method as belonging to a Task.
64+
5965## ` agentstack.tools[<tool_name>] `
6066` <callable> ` This is a tool that is available to agents in the project. Tools
6167are implementations from useful third party libraries that are provided to Agents
@@ -68,14 +74,36 @@ use including docstrings and type hints for argument and return types.
6874` <str> ` This is the name of the current framework ie. ` "crewai" ` .
6975
7076## ` agentstack.get_inputs() `
71- ` <dict[str, str]> ` This function returns the inputs for a project. These are the
77+ ` <dict[str, str]> ` Returns the inputs for a project. These are the
7278variables that can be used to configure tasks in the project and are stored in the
7379` inputs.yaml ` file inside the project directory.
7480
7581## ` agentstack.get_tags() `
76- ` <List[str]> ` This function returns the tags for a project. These are strings
82+ ` <List[str]> ` Returns the tags for a project. These are strings
7783that help identify the workflow in an ` AgentOps ` observability context.
7884
85+ ## ` agentstack.get_agent(name: str) `
86+ ` <AgentConfig> ` Returns the configuration for an agent in the
87+ project. Content of this object originates from the project's ` agents.yaml ` file.
88+
89+ ## ` agentstack.get_all_agents() `
90+ ` <List[AgentConfig]> ` Returns a list of all the agents in the
91+ project.
92+
93+ ## ` agentstack.get_all_agent_names() `
94+ ` <List[str]> ` Returns a list of all the agent names in the project.
95+
96+ ## ` agentstack.get_task(name: str) `
97+ ` <TaskConfig> ` Returns the configuration for a task in the project. Content of this object originates from the project's ` tasks.yaml ` file.
98+
99+ ## ` agentstack.get_all_tasks() `
100+ ` <List[TaskConfig]> ` Returns a list of all the tasks in the
101+ project.
102+
103+ ## ` agentstack.get_all_task_names() `
104+ ` <List[str]> ` Returns a list of all the task names in the project.
105+
106+
79107# Core
80108These namespaces occupy the root of ` agentstack ` and are shared across all
81109project & frameworks. Methods from these products are generally candidates for
@@ -86,31 +114,89 @@ availability in the public API for use within a project.
86114Agents are the actual personalities that accomplish work. We provide tools for
87115interacting with the ` agents.yaml ` configuration file in this package.
88116
89- ### ` AgentConfig.__init__(name: str) `
90- ` <AgentConfig> ` Initialize an ` AgentConfig ` to read and modify ` agents.yaml ` in
91- the current project.
117+ ### ` AgentConfig `
118+ ` <AgentConfig> ` This class represents an agent in the project. It is used to
119+ read and modify the ` agents.yaml ` file.
120+
121+ ### Properties
122+ - ` name ` ` <str> ` The name of the agent.
123+ - ` role ` ` <str> ` The role prompt for the agent.
124+ - ` goal ` ` <str> ` The goal prompt for the agent.
125+ - ` backstory ` ` <str> ` The backstory prompt for the agent.
126+ - ` prompt ` ` <str> ` The full prompt for the agent (formatted role + goal + backstory).
127+ - ` llm ` ` <str> ` The LLM to use for the agent (ie. ` "openai/gpt-4o" ` ).
128+ - ` provider ` ` <str> ` The provider to use for the agent (ie. ` "openai" ` ).
129+ - ` model ` ` <str> ` The model to use for the agent (ie. ` "gpt-4o" ` ).
130+
131+ ### Read/Write
132+ Instantiate ` AgentConfig ` with the name of the agent to read the relevant part
133+ from the user project's ` agents.yaml ` file.
134+
135+ ``` python
136+ agent_config = AgentConfig(" agent_name" )
137+ agent_config.role
138+ ```
139+
140+ Use the ` AgentConfig ` as a context manager to modify and write the relevant part
141+ of the user project's ` agents.yaml ` file.
142+
143+ ``` python
144+ with AgentConfig(" agent_name" ) as agent_config:
145+ agent_config.role = " You are a friendly assistant."
146+ ```
147+
148+ ### ` agents.get_agent(name: str) `
149+ ` <AgentConfig> ` Shortcut to return an ` AgentConfig ` object for a given agent name.
92150
93151### ` agents.get_all_agent_names() `
94- ` <List[str]> ` This function returns a list of all the agent names in the project.
152+ ` <List[str]> ` Returns a list of all the agent names in the project.
95153
96154### ` agents.get_all_agents() `
97- ` <List[AgentConfig]> ` This function returns a list of all the agents in the project.
155+ ` <List[AgentConfig]> ` Returns a list of all the agents in the project.
98156
99157
100158## ` tasks `
101159Tasks are the individual units of work that an Agent can perform. ` agents ` will
102160use the ` tools ` they have available to accomplish ` tasks ` . We provide tools for
103161interacting with the ` tasks.yaml ` configuration file in this package.
104162
105- ### ` TaskConfig.__init__(name: str) `
163+ ### ` TaskConfig `
164+ ` <TaskConfig> ` This class represents a task in the project. It is used to
165+ read and modify the ` tasks.yaml ` file.
166+
167+ #### Properties
168+ - ` name ` ` <str> ` The name of the task.
169+ - ` description ` ` <str> ` The description prompt for the task.
170+ - ` expected_output ` ` <str> ` The expected output prompt of the task.
171+ - ` prompt ` ` <str> ` The full prompt for the task (formatted description + expected output).
172+ - ` agent ` ` <str> ` The agent name to use for the task.
173+
174+ #### Read/Write
175+ Instantiate ` TaskConfig ` with the name of the task to read the relevant part
176+ from the user project's ` tasks.yaml ` file.
177+
178+ ``` python
179+ task_config = TaskConfig(" task_name" )
180+ task_config.description
181+ ```
182+
183+ Use the ` TaskConfig ` as a context manager to modify and write the relevant part
184+ of the user project's ` tasks.yaml ` file.
185+
186+ ``` python
187+ with TaskConfig(" task_name" ) as task_config:
188+ task_config.description = " How many R's are in strawberry."
189+ ```
190+
191+ ### ` tasks.get_task(name: str) `
106192` <TaskConfig> ` Initialize a ` TaskConfig ` to read and modify ` tasks.yaml ` in the
107193current project.
108194
109195### ` tasks.get_all_task_names() `
110- ` <List[str]> ` This function returns a list of all the task names in the project.
196+ ` <List[str]> ` Returns a list of all the task names in the project.
111197
112198### ` tasks.get_all_tasks() `
113- ` <List[TaskConfig]> ` This function returns a list of all the tasks in the project.
199+ ` <List[TaskConfig]> ` Returns a list of all the tasks in the project.
114200
115201
116202## ` inputs `
@@ -152,25 +238,26 @@ it's content to the current version.
152238 with the templates used by ` generation ` . Move existing templates to be part of
153239the generation package.
154240
241+ ### ` TemplateConfig.from_user_input(identifier: str) `
242+ ` <TemplateConfig> ` Returns a ` TemplateConfig ` object for either a URL, file path,
243+ or builtin template name.
244+
155245### ` TemplateConfig.from_template_name(name: str) `
156- ` <TemplateConfig> ` This function returns a ` TemplateConfig ` object for a given
157- template name.
246+ ` <TemplateConfig> ` Returns a ` TemplateConfig ` object for a given template name.
158247
159248### ` TemplateConfig.from_file(path: Path) `
160- ` <TemplateConfig> ` This function returns a ` TemplateConfig ` object for a given
161- template file path.
249+ ` <TemplateConfig> ` Returns a ` TemplateConfig ` object for a given template file path.
162250
163251### ` TemplateConfig.from_url(url: str) `
164- ` <TemplateConfig> ` This function returns a ` TemplateConfig ` object after loading
165- data from a URL.
252+ ` <TemplateConfig> ` Returns a ` TemplateConfig ` object after loading data from a URL.
166253
167254### ` TemplateConfig.from_json(data: dict) `
168- ` <TemplateConfig> ` This function returns a ` TemplateConfig ` object from a parsed
169- JSON object.
255+ ` <TemplateConfig> ` Returns a ` TemplateConfig ` object from a parsed JSON object.
170256
171257### ` TemplateConfig.write_to_file(filename: Path) `
172258` <None> ` Instance method to serialize and write the ` TemplateConfig ` data to a file.
173259
260+
174261### ` templates.get_all_template_paths() `
175262` <List[Path]> ` This function returns a list of all the template paths in the project.
176263
@@ -182,20 +269,70 @@ JSON object.
182269project as ` TemplateConfig ` objects.
183270
184271
272+ ## ` graph `
273+ We implement basic abstractions for graphing the relationships between ` agents ` and ` tasks ` in a project.
274+
275+
185276## ` conf `
186277Configuration data for the AgentStack application. This includes the path to the
187278current project directory and the name of the current framework.
188279
189- ### ` agentstack.json `
280+ ### ` DEBUG `
281+ ` <bool> ` This is a flag that indicates whether the application is in debug mode.
282+
283+ ### ` set_debug(debug: bool) `
284+ ` <None> ` This function sets the debug mode for the application.
285+
286+ ### ` PATH `
287+ ` <pathlib.Path> ` This is the path to the current project directory. It may change
288+ during program execution, so always use ` conf.PATH ` to reference the global value.
289+
290+ ### ` set_path(path: Path) `
291+ ` <None> ` This function sets the path to the current project directory.
292+
293+ ### ` ConfigFile `
190294This is the configuration file for a user's project. It contains the project's
191- configuration and metadata. It can be read and modified directly by accessing
192- ` conf.ConfigFile ` .
295+ configuration and metadata and is read from ` agentstack.json ` in the user's
296+ project directory.
297+
298+ #### Read/Write
299+ Instantiate ` ConfigFile ` to read the relevant part from the user project's
300+ ` agentstack.json ` file.
301+
302+ ``` python
303+ config = ConfigFile()
304+ config.framework
305+ ```
306+
307+ Use the ` ConfigFile ` as a context manager to modify and write the relevant part
308+ of the user project's ` agentstack.json ` file.
309+
310+ ``` python
311+ with ConfigFile() as config:
312+ config.framework = " crewai"
313+ ```
193314
194315## ` log `
195- AgentStack provides a robust logging interface for tracking and debugging
196- agentic workflows. Runs are separated into separate named files for easy tracking
197- and have standard conventions for outputs from different parts of the system
198- for parsing.
316+ AgentStack logs to ` stdout/stderr ` if available, and to ` agentstack.log ` in the
317+ current project directory, if it exists.
318+
319+ ### Log Handlers
320+ ` debug ` , ` tool_use ` , ` thinking ` , ` info ` , ` notify ` , ` success ` , ` response ` ,
321+ ` warning ` and ` error ` are available as functions to log messages at the
322+ appropriate level.
323+
324+ ``` python
325+ log.debug(" This is a debug message." )
326+ ```
327+
328+ ### ` set_stdout(stream: IO) `
329+ ` <None> ` This function sets the ` stdout ` stream for the application. To disable
330+ logging to ` stdout ` , set the stream to a new ` io.StringIO() ` object.
331+
332+ ### ` set_stderr(stream: IO) `
333+ ` <None> ` This function sets the ` stderr ` stream for the application. To disable
334+ logging to ` stderr ` , set the stream to a new ` io.StringIO() ` object.
335+
199336
200337## ` serve `
201338Completed agents can be deployed to the AgentStack cloud service with a single
@@ -208,8 +345,8 @@ agentic workflows.
208345The command line interface for ` agentstack ` is provided in this package. Outside
209346of ` main.py ` all logic relating to the command line interface resides here.
210347
211- > TODO: Code from other parts of the application should always throw exceptions
212- and leave the CLI to handle error messaging and control flow .
348+ Typically, functionality inside the ` cli ` package handles user input and
349+ output, error messaging and status updates .
213350
214351## ` packaging `
215352We manage the virtual environment and dependencies for tools that are added to
@@ -249,11 +386,13 @@ are imported into the project and available for use by `agents`.
249386## ` generation.files `
250387This is code that creates and modifies the ` files ` in a user's project.
251388
252- ### ` .env `
389+ ### ` EnvFile `
253390This is the environment file for a user's project. It contains the project's
254391environment variables. We dynamically modify this file to include relevant
255392variables to support ` tools ` that are used in the project.
256393
394+ ### ` ProjectFile `
395+
257396## ` generation.asttools `
258397Since we're interacting with generated code, we provide a shared toolkit for
259398common AST operations.
@@ -270,15 +409,21 @@ This is the base protocol for all framework implementations– all implementatio
270409must implement this protocol.
271410
272411## ` frameworks.crewai `
273- This is the implementation for the CrewAI framework. CrewAI is a framework for
274- creating and managing AI agents. All code related specifically to CrewAI is
275- contained in this package.
412+ This is the implementation for the CrewAI framework. All code related specifically
413+ to CrewAI is contained in this package.
276414
277415## ` frameworks.langgraph `
278- > TODO Add [ LangGraph] ( https://langchain-ai.github.io/langgraph/ ) as a framework.
416+ This is the implementation for the LangGraph framework. All code related specifically
417+ to LangGraph is contained in this package.
279418
280419## ` frameworks.openai_swarms `
281- > TODO: Add OpenAI Swarms as a framework.
420+ This is the implementation for the OpenAI Swarms framework. All code related specifically
421+ to OpenAI Swarms is contained in this package.
422+
423+ ## ` frameworks.llamaindex `
424+ . TODO : Add [ LlamaIndex] ( https://docs.llamaindex.ai/en/stable/examples/agent/custom_agent/ )
425+ as a framework.
282426
283427## ` frameworks.agency_swarm `
284- > TODO: Add [ VRSEN Agency Swarm] ( https://github.com/VRSEN/agency-swarm?tab=readme-ov-file ) as a framework.
428+ > TODO: Add [ VRSEN Agency Swarm] ( https://github.com/VRSEN/agency-swarm?tab=readme-ov-file )
429+ as a framework.
0 commit comments