|
| 1 | +# ManageEngineAgent Module Documentation |
| 2 | + |
| 3 | +## Overview |
| 4 | + |
| 5 | +The `ManageEngineAgent` module is part of a larger application and is likely utilized for interacting with the ManageEngine ServiceDesk via their API. This module includes components for defining input and output schemas, importing necessary libraries, and implementing the logic for handling ManageEngine-related tasks. |
| 6 | + |
| 7 | +### Files |
| 8 | +The module consists of three primary files: |
| 9 | + |
| 10 | +1. **typed.py**: This file defines the structured type annotations for the inputs and outputs of the `ManageEngineAgent`. |
| 11 | +2. **__init__.py**: This file initializes the package, but does not contain any code in this context. |
| 12 | +3. **ManageEngineAgent.py**: This file contains the primary class implementation for the `ManageEngineAgent`. |
| 13 | + |
| 14 | +## File: `typed.py` |
| 15 | + |
| 16 | +### Inputs |
| 17 | + |
| 18 | +The `ManageEngineAgentInputs` is a class structured to define the necessary input parameters: |
| 19 | + |
| 20 | +- **Required Inputs**: |
| 21 | + - `zoho_access_token` (str): OAuth token for accessing Zoho services. |
| 22 | + - `user_prompt` (str): The prompt provided by the user for initiating actions. |
| 23 | + - `prompt_value` (Dict[str, Any]): A dictionary to store values associated with the prompt. |
| 24 | + |
| 25 | +- **Optional Inputs**: |
| 26 | + - `max_agent_calls` (int): Maximum permissible agent/API calls. |
| 27 | + - `openai_api_key` (str): API key for OpenAI services (mutually inclusive with other providers). |
| 28 | + - `anthropic_api_key` (str): API key for Anthropic services. |
| 29 | + - `google_api_key` (str): API key for Google services. |
| 30 | + - `system_prompt` (Optional[str]): A custom system prompt for configuring the agentic strategy. |
| 31 | + - `example_json` (Optional[Dict]): Examples to assist the AI in generating the correct outputs. |
| 32 | + |
| 33 | +### Outputs |
| 34 | + |
| 35 | +The `ManageEngineAgentOutputs` defines the expected structure of the output: |
| 36 | + |
| 37 | +- `conversation_history` (List[Dict]): A history of the conversations held. |
| 38 | +- `tool_records` (List[Dict]): Records of tools used during interaction. |
| 39 | +- `request_tokens` (int): The count of tokens used for requests. |
| 40 | +- `response_tokens` (int): The count of tokens used for responses. |
| 41 | + |
| 42 | +## File: `ManageEngineAgent.py` |
| 43 | + |
| 44 | +### Overview |
| 45 | + |
| 46 | +The `ManageEngineAgent` class encapsulates the functionality to interface with the ManageEngine API using conversation strategies. It incorporates tools and agents configured for specific tasks related to service desk management. |
| 47 | + |
| 48 | +### Inputs |
| 49 | + |
| 50 | +This class requires similar inputs as defined in `typed.py`. |
| 51 | + |
| 52 | +### Outputs |
| 53 | + |
| 54 | +The outputs are consistent with the structure defined in `typed.py`, primarily delivering conversation records, API tool usage, and token counts. |
| 55 | + |
| 56 | +### Usage |
| 57 | + |
| 58 | +Here’s a conceptual example of how the class might be instantiated and used: |
| 59 | + |
| 60 | +```python |
| 61 | +inputs = { |
| 62 | + "zoho_access_token": "your_access_token_here", |
| 63 | + "user_prompt": "Create a new service ticket", |
| 64 | + "prompt_value": {"ticket_details": "Network downtime"}, |
| 65 | + "max_agent_calls": 5 |
| 66 | +} |
| 67 | + |
| 68 | +agent = ManageEngineAgent(inputs) |
| 69 | +result = agent.run() |
| 70 | + |
| 71 | +# Access conversation history |
| 72 | +conversation_history = result['conversation_history'] |
| 73 | +``` |
| 74 | + |
| 75 | +### Key Functions |
| 76 | + |
| 77 | +- **Initialization**: The constructor (`__init__`) initializes the class, sets up headers, and prepares an agent strategy with provided configuration inputs. |
| 78 | +- **Execution**: The `run` method executes the agentic strategy, which interacts with the ManageEngine ServiceDesk through API calls, and returns the results, including usage metrics. |
| 79 | + |
| 80 | +## File: `__init__.py` |
| 81 | + |
| 82 | +This file serves to define the package initialization; it appears to be empty in this implementation, acting as a placeholder for potential future enhancements or import/export definitions. |
| 83 | + |
| 84 | +--- |
| 85 | + |
| 86 | +This code is designed for developers who need to interact programmatically with ManageEngine ServiceDesk, facilitating automated service desk operations via a conversational interface guided by structured input and output schemas. |
0 commit comments