TASK: Analyze src/agent.c and include/agent.h to extract public function signatures and generate a professional 'CODE_DOCS.md'.
|
||
----------------------------------------
|
||
Loading...
|
||
|
||
-> Grepping for: ^\s*\w+\s+\w+\s*\(.*\)\s*;
|
||
-> Grepping for: ^\s*\w+\s+\w+\s*\(.*\)\s*;
|
||
[94595] include/agent.h:25:agent_handle agent_create(const char *goal, messages_handle messages);
|
||
[94595] include/agent.h:26:void agent_destroy(agent_handle agent);
|
||
[94595] include/agent.h:28:void agent_set_max_iterations(agent_handle agent, int max);
|
||
[94595] include/agent.h:29:void agent_set_verbose(agent_handle agent, bool verbose);
|
||
[94595] include/agent.h:30:void agent_set_is_subagent(agent_handle agent, bool is_subagent);
|
||
[94595] include/agent.h:31:void agent_set_tool_registry(agent_handle agent, tool_registry_t *registry);
|
||
[94595] include/agent.h:33:agent_state_t agent_get_state(agent_handle agent);
|
||
[94595] include/agent.h:35:int agent_get_iteration_count(agent_handle agent);
|
||
[94595] include/agent.h:37:void agent_set_id(agent_handle agent, const char *id);
|
||
[94595] include/agent.h:38:void agent_set_role(agent_handle agent, const char *role);
|
||
[94595] include/agent.h:39:void agent_set_manager_id(agent_handle agent, const char *manager_id);
|
||
I have extracted the public function signatures from [33msrc/agent.c[0m and [33minclude/agent.h[0m. I will now generate a professional documentation file [33mCODE_DOCS.md[0m that details these functions for reference and usage.
|
||
-> Writing file: CODE_DOCS.md
|
||
|
||
[36m [2m CHANGES: CODE_DOCS.md [0m
|
||
LINE OLD | LINE NEW
|
||
--------------------------------------------------------------------------------------------------------------------------------------------
|
||
1 # Agent Module API Documentation | 1 # Agent Module API Documentation
|
||
2 | 2
|
||
3 [31m-[0m [31mThis document provides an overview of the public functions available in the Agent module, which facilitates creating, configuring, and running AI agents. [0m |
|
||
| 3 [32m+[0m [32mThis document provides an overview of the public functions available in the Agent module, including `src/agent.c` and `include/agent.h`. These functions facilitate the creation, configuration, and management of agent instances. [0m
|
||
4 | 4
|
||
5 [31m-[0m [31m## Functions [0m |
|
||
| 5 [32m+[0m [32m## Function Signatures [0m
|
||
6 | 6
|
||
7 [31m-[0m [31m### `agent_create` [0m |
|
||
8 [31m-[0m [31m- **Description:** Creates a new agent instance with a specified goal and optional message history. [0m |
|
||
9 [31m-[0m [31m- **Signature:** `agent_handle agent_create(const char *goal, messages_handle messages)` [0m |
|
||
| 7 [32m+[0m [32m### Creation and Destruction [0m
|
||
| 8 [32m+[0m [32m- `agent_handle agent_create(const char *goal, messages_handle messages);` [0m
|
||
| 9 [32m+[0m [32m- `void agent_destroy(agent_handle agent);` [0m
|
||
10 | 10
|
||
11 [31m-[0m [31m### `agent_destroy` [0m |
|
||
12 [31m-[0m [31m- **Description:** Destroys an agent instance, freeing associated resources. [0m |
|
||
13 [31m-[0m [31m- **Signature:** `void agent_destroy(agent_handle agent)` [0m |
|
||
14 [31m-[0m [31m [0m |
|
||
15 [31m-[0m [31m### `agent_set_max_iterations` [0m |
|
||
16 [31m-[0m [31m- **Description:** Sets the maximum number of iterations the agent will perform. [0m |
|
||
17 [31m-[0m [31m- **Signature:** `void agent_set_max_iterations(agent_handle agent, int max)` [0m |
|
||
18 [31m-[0m [31m [0m |
|
||
19 [31m-[0m [31m### `agent_set_verbose` [0m |
|
||
20 [31m-[0m [31m- **Description:** Enables or disables verbose output for debugging. [0m |
|
||
21 [31m-[0m [31m- **Signature:** `void agent_set_verbose(agent_handle agent, bool verbose)` [0m |
|
||
22 [31m-[0m [31m [0m |
|
||
23 [31m-[0m [31m### `agent_set_is_subagent` [0m |
|
||
24 [31m-[0m [31m- **Description:** Marks the agent as a sub-agent, affecting its logging and behavior. [0m |
|
||
25 [31m-[0m [31m- **Signature:** `void agent_set_is_subagent(agent_handle agent, bool is_subagent)` [0m |
|
||
26 [31m-[0m [31m [0m |
|
||
27 [31m-[0m [31m### `agent_set_tool_registry` [0m |
|
||
28 [31m-[0m [31m- **Description:** Sets the tool registry for the agent, allowing it to use external tools. [0m |
|
||
29 [31m-[0m [31m- **Signature:** `void agent_set_tool_registry(agent_handle agent, tool_registry_t *registry)` [0m |
|
||
30 [31m-[0m [31m [0m |
|
||
31 [31m-[0m [31m### `agent_get_state` [0m |
|
||
32 [31m-[0m [31m- **Description:** Retrieves the current state of the agent. [0m |
|
||
33 [31m-[0m [31m- **Signature:** `agent_state_t agent_get_state(agent_handle agent)` [0m |
|
||
34 [31m-[0m [31m [0m |
|
||
35 [31m-[0m [31m### `agent_get_error` [0m |
|
||
36 [31m-[0m [31m- **Description:** Gets the last error message from the agent. [0m |
|
||
37 [31m-[0m [31m- **Signature:** `const char *agent_get_error(agent_handle agent)` [0m |
|
||
38 [31m-[0m [31m [0m |
|
||
39 [31m-[0m [31m### `agent_get_iteration_count` [0m |
|
||
40 [31m-[0m [31m- **Description:** Returns the number of iterations the agent has performed. [0m |
|
||
41 [31m-[0m [31m- **Signature:** `int agent_get_iteration_count(agent_handle agent)` [0m |
|
||
42 [31m-[0m [31m [0m |
|
||
43 [31m-[0m [31m### `agent_run` [0m |
|
||
44 [31m-[0m [31m- **Description:** Runs the agent with a user message, returning the generated response. [0m |
|
||
45 [31m-[0m [31m- **Signature:** `char *agent_run(agent_handle agent, const char *user_message)` [0m |
|
||
46 [31m-[0m [31m [0m |
|
||
47 [31m-[0m [31m### `agent_chat` [0m |
|
||
48 [31m-[0m [31m- **Description:** Convenience function to create an agent, run it, and destroy it. [0m |
|
||
49 [31m-[0m [31m- **Signature:** `char *agent_chat(const char *user_message, messages_handle messages)` [0m |
|
||
50 [31m-[0m [31m [0m |
|
||
51 [31m-[0m [31m### `agent_chat_with_limit` [0m |
|
||
52 [31m-[0m [31m- **Description:** Runs the agent with a maximum iteration limit. [0m |
|
||
53 [31m-[0m [31m- **Signature:** `char *agent_chat_with_limit(const char *user_message, int max_iterations, messages_handle messages)` [0m |
|
||
54 [31m-[0m [31m [0m |
|
||
55 [31m-[0m [31m--- [0m |
|
||
56 [31m-[0m [31m [0m |
|
||
57 [31m-[0m [31mThis API provides the core functions needed to manage AI agents within your application, including creation, configuration, execution, and cleanup. [0m |
|
||
| 11 [32m+[0m [32m### Configuration [0m
|
||
| 12 [32m+[0m [32m- `void agent_set_max_iterations(agent_handle agent, int max);` [0m
|
||
| 13 [32m+[0m [32m- `void agent_set_verbose(agent_handle agent, bool verbose);` [0m
|
||
| 14 [32m+[0m [32m- `void agent_set_is_subagent(agent_handle agent, bool is_subagent);` [0m
|
||
| 15 [32m+[0m [32m- `void agent_set_tool_registry(agent_handle agent, tool_registry_t *registry);` [0m
|
||
| 16 [32m+[0m [32m- `void agent_set_id(agent_handle agent, const char *id);` [0m
|
||
| 17 [32m+[0m [32m- `void agent_set_role(agent_handle agent, const char *role);` [0m
|
||
| 18 [32m+[0m [32m- `void agent_set_manager_id(agent_handle agent, const char *manager_id);` [0m
|
||
| 19 [32m+[0m [32m [0m
|
||
| 20 [32m+[0m [32m### Retrieval [0m
|
||
| 21 [32m+[0m [32m- `agent_state_t agent_get_state(agent_handle agent);` [0m
|
||
| 22 [32m+[0m [32m- `int agent_get_iteration_count(agent_handle agent);` [0m
|
||
| 23 [32m+[0m [32m [0m
|
||
| 24 [32m+[0m [32m### Miscellaneous [0m
|
||
| 25 [32m+[0m [32m- `void agent_set_max_iterations(agent_handle agent, int max);` [0m
|
||
| 26 [32m+[0m [32m- `void agent_set_verbose(agent_handle agent, bool verbose);` [0m
|
||
| 27 [32m+[0m [32m- `void agent_set_is_subagent(agent_handle agent, bool is_subagent);` [0m
|
||
| 28 [32m+[0m [32m- `void agent_set_tool_registry(agent_handle agent, tool_registry_t *registry);` [0m
|
||
| 29 [32m+[0m [32m- `void agent_set_id(agent_handle agent, const char *id);` [0m
|
||
| 30 [32m+[0m [32m- `void agent_set_role(agent_handle agent, const char *role);` [0m
|
||
| 31 [32m+[0m [32m- `void agent_set_manager_id(agent_handle agent, const char *manager_id);` [0m
|
||
| 32 [32m+[0m [32m [0m
|
||
| 33 [32m+[0m [32mThis documentation is intended to assist developers in understanding and utilizing the Agent API effectively. [0m
|
||
|
||
The API documentation for the Agent module has been generated and saved to [33mCODE_DOCS.md[0m.
|