This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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