diff --git a/src/sap_cloud_sdk/outputmanagement/__init__.py b/src/sap_cloud_sdk/agentoutputtools/__init__.py similarity index 86% rename from src/sap_cloud_sdk/outputmanagement/__init__.py rename to src/sap_cloud_sdk/agentoutputtools/__init__.py index 5ac00e5e..cf68b1f2 100644 --- a/src/sap_cloud_sdk/outputmanagement/__init__.py +++ b/src/sap_cloud_sdk/agentoutputtools/__init__.py @@ -1,11 +1,11 @@ -"""SAP Ariba Output Management Service SDK for Python.""" +"""SAP Ariba Agent Output Tools SDK for Python.""" import logging import os from typing import Optional -from .client import OutputManagementClient -from ._service_client import OutputManagementServiceClient +from .client import AgentOutputToolsClient +from ._service_client import AgentOutputToolsServiceClient from ._models import ( OutputRequest, OutputRequestBuilder, @@ -21,7 +21,7 @@ from .config import DestinationCredentialConfig from .constants import FileFormat, Channel from .exceptions import ( - OutputManagementException, + AgentOutputToolsException, AuthenticationException, ValidationException, NetworkException, @@ -37,9 +37,9 @@ def create_client( destination_name: Optional[str] = None, access_strategy: Optional[str] = None, instance: Optional[str] = None, -) -> OutputManagementClient: +) -> AgentOutputToolsClient: """ - Create an Output Management client with configuration from environment or parameters. + Create an Agent Output Tools client with configuration from environment or parameters. This is the recommended factory function for creating clients. It follows the SDK's standard pattern of reading configuration from environment variables with optional overrides. @@ -60,7 +60,7 @@ def create_client( CLOUD_SDK_OMS_INSTANCE environment variable or defaults to "default". Returns: - Configured OutputManagementClient instance + Configured AgentOutputToolsClient instance Raises: ValidationException: If destination_name is not provided and not found in environment @@ -68,7 +68,7 @@ def create_client( Example: ```python - from sap_cloud_sdk.outputmanagement import create_client, DestinationCredentialConfig + from sap_cloud_sdk.agentoutputtools import create_client, DestinationCredentialConfig # Using environment variables client = create_client() @@ -100,7 +100,7 @@ def create_client( if destination_credential_config is not None: destination_config = destination_credential_config logger.info( - f"Creating Output Management client with provided DestinationCredentialConfig: " + f"Creating Agent Output Tools client with provided DestinationCredentialConfig: " f"destination '{destination_config.destination_name}'" ) else: @@ -120,7 +120,7 @@ def create_client( ) logger.info( - f"Creating Output Management client with destination '{dest_name}', " + f"Creating Agent Output Tools client with destination '{dest_name}', " f"access_strategy '{access_strat}', instance '{inst}'" ) @@ -139,19 +139,19 @@ def create_client( logger.info(f"Retrieved destination base URL: {base_url}") # Create service client directly - service_client = OutputManagementServiceClient( + service_client = AgentOutputToolsServiceClient( base_url=base_url, destination=http_destination, destination_instance=destination_config.instance or "default", ) - # Wrap it in the unified OutputManagementClient - return OutputManagementClient(service_client) + # Wrap it in the unified Agent Output Tools client + return AgentOutputToolsClient(service_client) __all__ = [ # Main client and factory function - "OutputManagementClient", + "AgentOutputToolsClient", "create_client", # Models "OutputRequest", @@ -170,7 +170,7 @@ def create_client( "FileFormat", "Channel", # Exceptions - "OutputManagementException", + "AgentOutputToolsException", "AuthenticationException", "ValidationException", "NetworkException", diff --git a/src/sap_cloud_sdk/outputmanagement/_models.py b/src/sap_cloud_sdk/agentoutputtools/_models.py similarity index 93% rename from src/sap_cloud_sdk/outputmanagement/_models.py rename to src/sap_cloud_sdk/agentoutputtools/_models.py index 408cdc97..8916168c 100644 --- a/src/sap_cloud_sdk/outputmanagement/_models.py +++ b/src/sap_cloud_sdk/agentoutputtools/_models.py @@ -1,4 +1,4 @@ -"""Data models for SAP Output Management Service.""" +"""Data models for SAP Agent Output Tools Service.""" from __future__ import annotations @@ -16,14 +16,14 @@ class FormConfiguration(BaseModel): - """Form channel configuration. + """Form channel configuration for Agent Output Tools. Attributes: form_id: Form identifier - form_name: Form name (required by Output Management service) - form_template_name: Form template name (required by Output Management service) - form_language: Form language code (required by Output Management service) - file_format: File format for the generated form (required by Output Management service) + form_name: Form name (required by Agent Output Tools service) + form_template_name: Form template name (required by Agent Output Tools service) + form_language: Form language code (required by Agent Output Tools service) + file_format: File format for the generated form (required by Agent Output Tools service) form_data: Optional form data callback_url: Optional callback URL for form submission """ @@ -69,7 +69,7 @@ class PreGeneratedAttachment(BaseModel): Example: ```python - from sap_cloud_sdk.outputmanagement._models import PreGeneratedAttachment + from sap_cloud_sdk.agentoutputtools._models import PreGeneratedAttachment attachment = PreGeneratedAttachment( url="https://dms.example.com/browser/root?objectId=12345&cmisselector=content", @@ -136,8 +136,8 @@ class AttachmentConfig(BaseModel): Example - Generated Attachment: ```python - from sap_cloud_sdk.outputmanagement._models import AttachmentConfig, FormConfiguration - from sap_cloud_sdk.outputmanagement.constants import FileFormat + from sap_cloud_sdk.agentoutputtools._models import AttachmentConfig, FormConfiguration + from sap_cloud_sdk.agentoutputtools.constants import FileFormat form_config = FormConfiguration( form_name="PurchaseOrderForm", @@ -151,7 +151,7 @@ class AttachmentConfig(BaseModel): Example - Pre-generated Attachment from DMS: ```python - from sap_cloud_sdk.outputmanagement._models import AttachmentConfig, PreGeneratedAttachment + from sap_cloud_sdk.agentoutputtools._models import AttachmentConfig, PreGeneratedAttachment pre_gen_attachment = PreGeneratedAttachment( url="https://dms.example.com/browser/root?objectId=12345&cmisselector=content", @@ -216,7 +216,7 @@ class EmailConfiguration(BaseModel): Example - Simple Notification: ```python - from sap_cloud_sdk.outputmanagement._models import EmailConfiguration + from sap_cloud_sdk.agentoutputtools._models import EmailConfiguration config = EmailConfiguration( emailNotificationTemplateKey="PO_APPROVAL_NOTIFICATION", @@ -228,12 +228,12 @@ class EmailConfiguration(BaseModel): Example - With Document Attachment: ```python - from sap_cloud_sdk.outputmanagement._models import ( + from sap_cloud_sdk.agentoutputtools._models import ( EmailConfiguration, AttachmentConfig, FormConfiguration ) - from sap_cloud_sdk.outputmanagement.constants import FileFormat + from sap_cloud_sdk.agentoutputtools.constants import FileFormat form_config = FormConfiguration( form_name="PurchaseOrderForm", @@ -336,7 +336,7 @@ class Config: class OutputManagementInfo(BaseModel): """ - Contains information required by Output Management to decide on how to orchestrate the output. + Contains information required by Agent Output Tools to decide on how to orchestrate the output. This class encapsulates the configuration and metadata needed for output processing, including business document identification, delivery channels, and channel-specific configurations. @@ -353,11 +353,11 @@ class OutputManagementInfo(BaseModel): Example: ```python - from sap_cloud_sdk.outputmanagement._models import ( + from sap_cloud_sdk.agentoutputtools._models import ( OutputManagementInfo, EmailConfiguration ) - from sap_cloud_sdk.outputmanagement.constants import Channel + from sap_cloud_sdk.agentoutputtools.constants import Channel email_config = EmailConfiguration( emailNotificationTemplateKey="PO_NOTIFICATION", @@ -435,7 +435,7 @@ class Config: class OutputRequestData(BaseModel): """ - Container for the data payload of an Output Management request. + Container for the data payload of an Agent Output request. This class serves as the envelope for the actual request data, containing two essential components: - OutputManagement: Metadata and configuration for output orchestration @@ -463,16 +463,16 @@ class OutputRequestData(BaseModel): ``` Attributes: - output_management: Information required by Output Management for orchestration (required) + output_management: Information required by Agent Output Tools for orchestration (required) business_document: The business document as a dictionary/JSON object (required) Example: ```python - from sap_cloud_sdk.outputmanagement._models import ( + from sap_cloud_sdk.agentoutputtools._models import ( OutputRequestData, OutputManagementInfo ) - from sap_cloud_sdk.outputmanagement.constants import Channel + from sap_cloud_sdk.agentoutputtools.constants import Channel output_mgmt = OutputManagementInfo( businessDocumentType="com.sap.procurement.PurchaseOrder", @@ -499,7 +499,7 @@ class OutputRequestData(BaseModel): output_management: OutputManagementInfo = Field( ..., alias="OutputManagement", - description="Information required by Output Management to orchestrate the output", + description="Information required by Agent Output Tools to orchestrate the output", ) business_document: Dict[str, Any] = Field( @@ -521,10 +521,10 @@ class Config: class OutputRequest(BaseModel): """ - Represents an Output Management request following the CloudEvents 1.0 specification. + Represents an Agent Output Tools request following the CloudEvents 1.0 specification. This is the main request object that encapsulates all information required to trigger - document generation and delivery through the Output Management service. It follows the + document generation and delivery through the Agent Output Tools service. It follows the CloudEvents specification for event-driven architectures. Attributes: @@ -541,13 +541,13 @@ class OutputRequest(BaseModel): Example: ```python - from sap_cloud_sdk.outputmanagement._models import ( + from sap_cloud_sdk.agentoutputtools._models import ( OutputRequest, OutputRequestData, OutputManagementInfo, EmailConfiguration ) - from sap_cloud_sdk.outputmanagement.constants import Channel + from sap_cloud_sdk.agentoutputtools.constants import Channel # Create email configuration email_config = EmailConfiguration( @@ -771,7 +771,7 @@ class Config: class OutputResponse(BaseModel): """Output response wrapper. - Response object for Output Management service operations. + Response object for Agent Output Tools service operations. Contains the request identifier or error information. """ diff --git a/src/sap_cloud_sdk/outputmanagement/_service_client.py b/src/sap_cloud_sdk/agentoutputtools/_service_client.py similarity index 97% rename from src/sap_cloud_sdk/outputmanagement/_service_client.py rename to src/sap_cloud_sdk/agentoutputtools/_service_client.py index f80f399b..1a51b2b6 100644 --- a/src/sap_cloud_sdk/outputmanagement/_service_client.py +++ b/src/sap_cloud_sdk/agentoutputtools/_service_client.py @@ -1,4 +1,4 @@ -"""Output Management service client implementation.""" +"""Agent Output Tools client implementation.""" import base64 import logging @@ -27,8 +27,8 @@ logger = logging.getLogger(__name__) -class OutputManagementServiceClient: - """Service client for Output Management. +class AgentOutputToolsServiceClient: + """Service client for Agent Output Tools. Handles low-level HTTP communication, authentication (OAuth with mTLS), certificate management, and request/response processing. @@ -61,10 +61,10 @@ def __init__( f"Loaded SENDER_PROVIDER_SUBACCOUNT_ID: {self._sender_provider_subaccount_id}" ) - logger.info(f"Initialized Output Management Service client for {base_url}") + logger.info(f"Initialized Agent Output Tools Service client for {base_url}") def send_output_request(self, output_request: OutputRequest) -> OutputResponse: - """Send an output request to the Output Management service. + """Send an output request to the Agent Output service. Args: output_request: The output request to submit diff --git a/src/sap_cloud_sdk/outputmanagement/client.py b/src/sap_cloud_sdk/agentoutputtools/client.py similarity index 91% rename from src/sap_cloud_sdk/outputmanagement/client.py rename to src/sap_cloud_sdk/agentoutputtools/client.py index 4d7d5008..1d01797a 100644 --- a/src/sap_cloud_sdk/outputmanagement/client.py +++ b/src/sap_cloud_sdk/agentoutputtools/client.py @@ -1,4 +1,4 @@ -"""Unified Output Management client.""" +"""Unified Agent Output Tools client.""" import logging import os @@ -17,25 +17,25 @@ AttachmentConfig, PreGeneratedAttachment, ) -from ._service_client import OutputManagementServiceClient +from ._service_client import AgentOutputToolsServiceClient from .constants import Channel from .utils import RequestValidator logger = logging.getLogger(__name__) -class OutputManagementClient: +class AgentOutputToolsClient: """ - Unified client for Output Management operations. + Unified client for Agent Output Tools operations. This client provides four main methods: - 1. send_email() - Send emails directly via Output Management API + 1. send_email() - Send emails directly via Agent Output Tools API 2. send_email_with_mcp() - Send emails via MCP server integration 3. create_output_request() - Create an output request object 4. send_output_request() - Send a pre-configured output request Usage: - from sap_cloud_sdk.outputmanagement import create_client + from sap_cloud_sdk.agentoutputtools import create_client client = create_client(destination_name="ARIBA_OUTPUT_SERVICE") @@ -47,16 +47,16 @@ class OutputManagementClient: ) """ - def __init__(self, service_client: OutputManagementServiceClient): + def __init__(self, service_client: AgentOutputToolsServiceClient): """ - Initialize the Output Management client. + Initialize the Agent Output Tools client. Args: service_client: The underlying service client implementation """ self._service_client = service_client - @record_metrics(Module.OUTPUT_MANAGEMENT, Operation.OUTPUT_MANAGEMENT_SEND_EMAIL) + @record_metrics(Module.AGENT_OUTPUT_TOOLS, Operation.AGENT_OUTPUT_TOOLS_SEND_EMAIL) def send_email( self, notification_template_key: str, @@ -67,7 +67,7 @@ def send_email( attachment_urls: Optional[List[str]] = None, ) -> OutputResponse: """ - Send an email using the Output Management service. + Send an email using the Agent Output Tools service. Args: notification_template_key: ANS template identifier @@ -81,7 +81,7 @@ def send_email( OutputResponse containing the request ID if successful, or error details Example: - >>> from sap_cloud_sdk.outputmanagement import create_client + >>> from sap_cloud_sdk.agentoutputtools import create_client >>> client = create_client(destination_name="ARIBA_OUTPUT_SERVICE") >>> response = client.send_email( ... notification_template_key="PO_NOTIFICATION", @@ -118,7 +118,7 @@ def send_email( return self.send_output_request(output_request) @record_metrics( - Module.OUTPUT_MANAGEMENT, Operation.OUTPUT_MANAGEMENT_SEND_EMAIL_WITH_MCP + Module.AGENT_OUTPUT_TOOLS, Operation.AGENT_OUTPUT_TOOLS_SEND_EMAIL_WITH_MCP ) async def send_email_with_mcp( self, @@ -150,7 +150,7 @@ async def send_email_with_mcp( Response from the MCP tool Example: - >>> from sap_cloud_sdk.outputmanagement import create_client + >>> from sap_cloud_sdk.agentoutputtools import create_client >>> client = create_client(destination_name="ARIBA_OUTPUT_SERVICE") >>> response = await client.send_email_with_mcp( ... tool_name="sendEmail", @@ -243,7 +243,7 @@ def create_output_request( OutputRequest object ready to be sent Example: - >>> from sap_cloud_sdk.outputmanagement import create_client + >>> from sap_cloud_sdk.agentoutputtools import create_client >>> client = create_client(destination_name="ARIBA_OUTPUT_SERVICE") >>> output_request = client.create_output_request( ... notification_template_key="PO_NOTIFICATION", @@ -304,7 +304,7 @@ def create_output_request( return output_request @record_metrics( - Module.OUTPUT_MANAGEMENT, Operation.OUTPUT_MANAGEMENT_SEND_OUTPUT_REQUEST + Module.AGENT_OUTPUT_TOOLS, Operation.AGENT_OUTPUT_TOOLS_SEND_OUTPUT_REQUEST ) def send_output_request(self, output_request: OutputRequest) -> OutputResponse: """ @@ -317,7 +317,7 @@ def send_output_request(self, output_request: OutputRequest) -> OutputResponse: OutputResponse containing the request ID if successful, or error details Example: - >>> from sap_cloud_sdk.outputmanagement import create_client + >>> from sap_cloud_sdk.agentoutputtools import create_client >>> client = create_client(destination_name="ARIBA_OUTPUT_SERVICE") >>> output_request = client.create_output_request( ... notification_template_key="PO_NOTIFICATION", diff --git a/src/sap_cloud_sdk/outputmanagement/config.py b/src/sap_cloud_sdk/agentoutputtools/config.py similarity index 94% rename from src/sap_cloud_sdk/outputmanagement/config.py rename to src/sap_cloud_sdk/agentoutputtools/config.py index e0f05d83..0afc242d 100644 --- a/src/sap_cloud_sdk/outputmanagement/config.py +++ b/src/sap_cloud_sdk/agentoutputtools/config.py @@ -1,4 +1,4 @@ -"""Destination credential configuration for Output Management Service.""" +"""Destination credential configuration for Agent Output Tools Service.""" from typing import Optional from pydantic import BaseModel, Field, field_validator @@ -10,7 +10,7 @@ class DestinationCredentialConfig(BaseModel): - """Configuration for accessing Output Management Service via SAP BTP Destination. + """Configuration for accessing Agent Output Tools Service via SAP BTP Destination. This class provides a simple configuration wrapper for destination-based access. Uses relative imports since this module is part of sap_cloud_sdk. Attributes: @@ -18,8 +18,8 @@ class DestinationCredentialConfig(BaseModel): access_strategy: Optional access strategy - "PROVIDER_ONLY" or "SUBSCRIBER_ONLY" Example: ```python - from sap_cloud_sdk.outputmanagement import OutputManagementServiceClientProvider - from sap_cloud_sdk.outputmanagement.config import DestinationCredentialConfig + from sap_cloud_sdk.agentoutputtools import AgentOutputToolsServiceClientProvider + from sap_cloud_sdk.agentoutputtools.config import DestinationCredentialConfig # Create config config = DestinationCredentialConfig( destination_name="OUTPUT_MANAGEMENT_DEST", diff --git a/src/sap_cloud_sdk/outputmanagement/constants.py b/src/sap_cloud_sdk/agentoutputtools/constants.py similarity index 94% rename from src/sap_cloud_sdk/outputmanagement/constants.py rename to src/sap_cloud_sdk/agentoutputtools/constants.py index 4cf7b0b4..991419bb 100644 --- a/src/sap_cloud_sdk/outputmanagement/constants.py +++ b/src/sap_cloud_sdk/agentoutputtools/constants.py @@ -1,4 +1,4 @@ -"""Constants for the Output Management SDK.""" +"""Constants for the Agent Output Tools SDK.""" from enum import Enum diff --git a/src/sap_cloud_sdk/outputmanagement/exceptions.py b/src/sap_cloud_sdk/agentoutputtools/exceptions.py similarity index 74% rename from src/sap_cloud_sdk/outputmanagement/exceptions.py rename to src/sap_cloud_sdk/agentoutputtools/exceptions.py index bc784480..e67c1dfe 100644 --- a/src/sap_cloud_sdk/outputmanagement/exceptions.py +++ b/src/sap_cloud_sdk/agentoutputtools/exceptions.py @@ -1,10 +1,10 @@ -"""Exception classes for the Output Management SDK.""" +"""Exception classes for the Agent Output Tools SDK.""" from typing import Optional, Dict, Any -class OutputManagementException(Exception): - """Base exception for Output Management SDK.""" +class AgentOutputToolsException(Exception): + """Base exception for Agent Output Tools SDK.""" def __init__( self, @@ -37,31 +37,31 @@ def __str__(self) -> str: return " | ".join(parts) -class AuthenticationException(OutputManagementException): +class AuthenticationException(AgentOutputToolsException): """Exception for authentication failures.""" pass -class ValidationException(OutputManagementException): +class ValidationException(AgentOutputToolsException): """Exception for validation failures.""" pass -class NetworkException(OutputManagementException): +class NetworkException(AgentOutputToolsException): """Exception for network-related errors.""" pass -class DestinationNotFoundException(OutputManagementException): +class DestinationNotFoundException(AgentOutputToolsException): """Exception for destination not found errors.""" pass -class DestinationAccessException(OutputManagementException): +class DestinationAccessException(AgentOutputToolsException): """Exception for destination access errors.""" pass diff --git a/src/sap_cloud_sdk/outputmanagement/py.typed b/src/sap_cloud_sdk/agentoutputtools/py.typed similarity index 100% rename from src/sap_cloud_sdk/outputmanagement/py.typed rename to src/sap_cloud_sdk/agentoutputtools/py.typed diff --git a/src/sap_cloud_sdk/outputmanagement/user-guide.md b/src/sap_cloud_sdk/agentoutputtools/user-guide.md similarity index 92% rename from src/sap_cloud_sdk/outputmanagement/user-guide.md rename to src/sap_cloud_sdk/agentoutputtools/user-guide.md index a13b0e6f..4c385b7f 100644 --- a/src/sap_cloud_sdk/outputmanagement/user-guide.md +++ b/src/sap_cloud_sdk/agentoutputtools/user-guide.md @@ -1,8 +1,8 @@ -# SAP Cloud SDK for Python - Output Management Service User Guide +# SAP Cloud SDK for Python - Agent Output Tools Service User Guide ## Overview -The Output Management Service provides a simplified way to send emails through SAP Ariba Output Service. This guide covers the unified `OutputManagementClient` which offers four main methods for sending notification emails with optional attachments using ANS (Ariba Notification Service) templates. +The Agent Output Tools Service provides a simplified way to send emails through SAP Ariba Output Service. This guide covers the unified `AgentOutputToolsClient` which offers four main methods for sending notification emails with optional attachments using ANS (Ariba Notification Service) templates. ## Installation @@ -32,7 +32,7 @@ See further information about installation in the [main documentation](/README.m ### Required Setup -1. **SAP BTP Destination**: Configure a destination in SAP BTP Destination Service pointing to your Output Management service. +1. **SAP BTP Destination**: Configure a destination in SAP BTP Destination Service pointing to your Agent Output Tools service. 2. **ANS Template**: Create notification templates in Ariba Notification Service (ANS) 3. **Python Environment**: Python 3.11 or higher 4. **SAP Cloud SDK**: Install the SAP Cloud SDK for Python @@ -46,7 +46,7 @@ pip install sap-cloud-sdk Your destination should be configured with: - **Name**: e.g., `ARIBA_OUTPUT_SERVICE` - **Type**: HTTP -- **URL**: Your Output Management service endpoint +- **URL**: Your Agent Output Tools service endpoint - **Authentication**: OAuth2 with mTLS (client certificate) - **Properties**: Include OAuth token service URL and certificate configuration @@ -55,7 +55,7 @@ Your destination should be configured with: Here's the simplest way to send an email: ```python -from sap_cloud_sdk.outputmanagement import create_client +from sap_cloud_sdk.agentoutputtools import create_client # Create client using the factory function client = create_client(destination_name="ARIBA_OUTPUT_SERVICE") @@ -82,7 +82,7 @@ else: ## Client Methods -The `OutputManagementClient` provides four main methods: +The `AgentOutputToolsClient` provides four main methods: ### 1. `send_email()` - Direct Email Sending Send an email directly with a single method call. This is the most convenient method for simple use cases. @@ -180,7 +180,7 @@ response = await client.send_email_with_mcp( Send a notification email using an ANS template: ```python -from sap_cloud_sdk.outputmanagement import create_client +from sap_cloud_sdk.agentoutputtools import create_client # Create client client = create_client(destination_name="ARIBA_OUTPUT_SERVICE") @@ -210,7 +210,7 @@ else: Send to multiple recipients with CC: ```python -from sap_cloud_sdk.outputmanagement import create_client +from sap_cloud_sdk.agentoutputtools import create_client client = create_client(destination_name="ARIBA_OUTPUT_SERVICE") @@ -233,7 +233,7 @@ response = client.send_email( Specify the template language: ```python -from sap_cloud_sdk.outputmanagement import create_client +from sap_cloud_sdk.agentoutputtools import create_client client = create_client(destination_name="ARIBA_OUTPUT_SERVICE") @@ -252,7 +252,7 @@ response = client.send_email( Attach a pre-generated document from DMS (Document Management Service): ```python -from sap_cloud_sdk.outputmanagement import create_client +from sap_cloud_sdk.agentoutputtools import create_client client = create_client(destination_name="ARIBA_OUTPUT_SERVICE") @@ -273,7 +273,7 @@ response = client.send_email( Attach multiple documents from DMS: ```python -from sap_cloud_sdk.outputmanagement import create_client +from sap_cloud_sdk.agentoutputtools import create_client client = create_client(destination_name="ARIBA_OUTPUT_SERVICE") @@ -298,7 +298,7 @@ response = client.send_email( The recommended way to create a client is using the `create_client()` factory function. This function supports configuration via environment variables or explicit parameters: ```python -from sap_cloud_sdk.outputmanagement import create_client +from sap_cloud_sdk.agentoutputtools import create_client # Option 1: Using environment variables # Set CLOUD_SDK_OMS_DESTINATION_NAME, CLOUD_SDK_OMS_ACCESS_STRATEGY, CLOUD_SDK_OMS_INSTANCE @@ -317,7 +317,7 @@ client = create_client( Control how the destination is accessed: ```python -from sap_cloud_sdk.outputmanagement import create_client +from sap_cloud_sdk.agentoutputtools import create_client # Provider-only access (default) client = create_client( @@ -335,7 +335,7 @@ client = create_client( Specify a custom destination service instance: ```python -from sap_cloud_sdk.outputmanagement import create_client +from sap_cloud_sdk.agentoutputtools import create_client client = create_client( destination_name="ARIBA_OUTPUT_SERVICE", instance="my-custom-instance" @@ -347,7 +347,7 @@ client = create_client( For more control, create the output request object separately: ```python -from sap_cloud_sdk.outputmanagement import create_client +from sap_cloud_sdk.agentoutputtools import create_client client = create_client(destination_name="ARIBA_OUTPUT_SERVICE") @@ -378,7 +378,7 @@ response = client.send_output_request(output_request) Always check for errors in the response: ```python -from sap_cloud_sdk.outputmanagement import create_client +from sap_cloud_sdk.agentoutputtools import create_client client = create_client(destination_name="ARIBA_OUTPUT_SERVICE") @@ -400,7 +400,7 @@ else: Validation errors occur before the request is sent: ```python -from sap_cloud_sdk.outputmanagement import create_client +from sap_cloud_sdk.agentoutputtools import create_client client = create_client(destination_name="ARIBA_OUTPUT_SERVICE") @@ -422,7 +422,7 @@ if response.error: Handle network and authentication errors: ```python -from sap_cloud_sdk.outputmanagement import create_client +from sap_cloud_sdk.agentoutputtools import create_client try: client = create_client(destination_name="ARIBA_OUTPUT_SERVICE") @@ -456,7 +456,7 @@ except Exception as e: Create the client once and reuse it: ```python -from sap_cloud_sdk.outputmanagement import create_client +from sap_cloud_sdk.agentoutputtools import create_client # Good: Create once and reuse client = create_client(destination_name="ARIBA_OUTPUT_SERVICE") @@ -481,7 +481,7 @@ for order in orders: Validate your data before calling the API: ```python -from sap_cloud_sdk.outputmanagement import create_client +from sap_cloud_sdk.agentoutputtools import create_client def send_order_confirmation(order): @@ -532,7 +532,7 @@ business_document = { Always handle errors and provide meaningful feedback: ```python -from sap_cloud_sdk.outputmanagement import create_client +from sap_cloud_sdk.agentoutputtools import create_client import time @@ -577,7 +577,7 @@ Always log the request ID for tracking: ```python import logging -from sap_cloud_sdk.outputmanagement import create_client +from sap_cloud_sdk.agentoutputtools import create_client logger = logging.getLogger(__name__) @@ -601,7 +601,7 @@ else: ### create_client() -Factory function to create an Output Management client. +Factory function to create an Agent Output Tools client. **Parameters:** @@ -616,7 +616,7 @@ Factory function to create an Output Management client. **Example:** ```python -from sap_cloud_sdk.outputmanagement import create_client +from sap_cloud_sdk.agentoutputtools import create_client # Using explicit parameters client = create_client( @@ -633,7 +633,7 @@ client = create_client() #### `send_email()` -Send an email directly using the Output Management service. +Send an email directly using the Agent Output Tools service. **Parameters:** @@ -691,7 +691,7 @@ output_request = client.create_output_request( #### `send_output_request()` -Send a pre-configured output request to the Output Management service. +Send a pre-configured output request to the Agent Output Tools service. **Parameters:** @@ -744,7 +744,7 @@ response = await client.send_email_with_mcp( ### Use Case 1: Order Confirmation ```python -from sap_cloud_sdk.outputmanagement import create_client +from sap_cloud_sdk.agentoutputtools import create_client def send_order_confirmation(order): @@ -778,7 +778,7 @@ def send_order_confirmation(order): ### Use Case 2: Invoice with PDF Attachment ```python -from sap_cloud_sdk.outputmanagement import create_client +from sap_cloud_sdk.agentoutputtools import create_client def send_invoice_with_pdf(invoice, pdf_dms_url): @@ -806,7 +806,7 @@ def send_invoice_with_pdf(invoice, pdf_dms_url): ### Use Case 3: Bulk Notification ```python -from sap_cloud_sdk.outputmanagement import create_client +from sap_cloud_sdk.agentoutputtools import create_client def send_bulk_notification(recipients, notification_data): @@ -872,7 +872,7 @@ to = ["invalid-email", "user@"] The SDK provides specific exception classes for different error scenarios: ```python -from sap_cloud_sdk.outputmanagement import ( +from sap_cloud_sdk.agentoutputtools import ( create_client, OutputManagementException, AuthenticationException, @@ -924,14 +924,14 @@ export CLOUD_SDK_OMS_INSTANCE="default" Then use the factory function without parameters: ```python -from sap_cloud_sdk.outputmanagement import create_client +from sap_cloud_sdk.agentoutputtools import create_client client = create_client() # Uses environment variables ``` ## Additional Resources -- [SAP Ariba Output Management Documentation](https://help.sap.com/docs/ariba) +- [SAP Ariba Agent Output Tools Documentation](https://help.sap.com/docs/ariba) - [SAP BTP Destination Service](https://help.sap.com/docs/connectivity) - [SAP Cloud SDK for Python](https://github.com/SAP/cloud-sdk-python) diff --git a/src/sap_cloud_sdk/outputmanagement/utils.py b/src/sap_cloud_sdk/agentoutputtools/utils.py similarity index 97% rename from src/sap_cloud_sdk/outputmanagement/utils.py rename to src/sap_cloud_sdk/agentoutputtools/utils.py index bdc27940..97279644 100644 --- a/src/sap_cloud_sdk/outputmanagement/utils.py +++ b/src/sap_cloud_sdk/agentoutputtools/utils.py @@ -1,9 +1,9 @@ """Request validation utilities. -This module provides comprehensive validation for Output Management requests including: +This module provides comprehensive validation for Agent Output Tools requests including: - CloudEvents specification compliance - Business document validation -- Output management configuration validation +- Agent Output Tools configuration validation - Channel-specific validation Author: SAP SE @@ -22,12 +22,12 @@ class RequestValidator: """ - Validator utility class for Output Management requests. + Validator utility class for Agent Output Tools requests. This class provides comprehensive validation for OutputRequest objects including: - CloudEvents specification compliance - Business document validation - - Output management configuration validation + - Agent Output Tools configuration validation - Channel-specific validation (delegates to specific validators) """ @@ -43,7 +43,7 @@ def validate(output_request: OutputRequest) -> Optional[str]: This method performs comprehensive validation including: - CloudEvents specification compliance (source, id, type format) - Required business document information - - Output management metadata validation + - Agent Output Tools metadata validation - Channel configuration validation (delegates to channel-specific validators) Args: diff --git a/src/sap_cloud_sdk/core/telemetry/module.py b/src/sap_cloud_sdk/core/telemetry/module.py index c3ceb80a..e758779b 100644 --- a/src/sap_cloud_sdk/core/telemetry/module.py +++ b/src/sap_cloud_sdk/core/telemetry/module.py @@ -19,7 +19,7 @@ class Module(str, Enum): DMS = "dms" EXTENSIBILITY = "extensibility" OBJECTSTORE = "objectstore" - OUTPUT_MANAGEMENT = "outputmanagement" + AGENT_OUTPUT_TOOLS = "agentoutputtools" PRINT = "print" TELEMETRY = "telemetry" diff --git a/src/sap_cloud_sdk/core/telemetry/operation.py b/src/sap_cloud_sdk/core/telemetry/operation.py index eb8a018c..615077a6 100644 --- a/src/sap_cloud_sdk/core/telemetry/operation.py +++ b/src/sap_cloud_sdk/core/telemetry/operation.py @@ -314,9 +314,9 @@ class Operation(str, Enum): AGENT_MEMORY_UPDATE_RETENTION_CONFIG = "update_retention_config" # Output Management Operations - OUTPUT_MANAGEMENT_SEND_EMAIL = "send_email" - OUTPUT_MANAGEMENT_SEND_EMAIL_WITH_MCP = "send_email_with_mcp" - OUTPUT_MANAGEMENT_SEND_OUTPUT_REQUEST = "send_output_request" + AGENT_OUTPUT_TOOLS_SEND_EMAIL = "send_email" + AGENT_OUTPUT_TOOLS_SEND_EMAIL_WITH_MCP = "send_email_with_mcp" + AGENT_OUTPUT_TOOLS_SEND_OUTPUT_REQUEST = "send_output_request" def __str__(self) -> str: return self.value diff --git a/tests/outputmanagement/__init__.py b/tests/agentoutputtools/__init__.py similarity index 100% rename from tests/outputmanagement/__init__.py rename to tests/agentoutputtools/__init__.py diff --git a/tests/outputmanagement/integration/__init__.py b/tests/agentoutputtools/integration/__init__.py similarity index 73% rename from tests/outputmanagement/integration/__init__.py rename to tests/agentoutputtools/integration/__init__.py index 66782770..598f679f 100644 --- a/tests/outputmanagement/integration/__init__.py +++ b/tests/agentoutputtools/integration/__init__.py @@ -1,3 +1,3 @@ # SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Cloud SDK contributors # SPDX-License-Identifier: Apache-2.0 -"""Integration tests for Output Management.""" +"""Integration tests for Agent Output Tools.""" diff --git a/tests/outputmanagement/integration/outputmanagement.feature b/tests/agentoutputtools/integration/agentoutputtools.feature similarity index 96% rename from tests/outputmanagement/integration/outputmanagement.feature rename to tests/agentoutputtools/integration/agentoutputtools.feature index be783a59..8c15b8f3 100644 --- a/tests/outputmanagement/integration/outputmanagement.feature +++ b/tests/agentoutputtools/integration/agentoutputtools.feature @@ -1,13 +1,13 @@ # SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Cloud SDK contributors # SPDX-License-Identifier: Apache-2.0 -Feature: Output Management Integration +Feature: Agent Output Tools Integration As a developer using the SDK I want to send output requests and email notifications - So that I can trigger document generation and delivery through Output Management + So that I can trigger document generation and delivery through Agent Output Tools Background: - Given an Output Management client + Given an Agent Output Tools client # ==================== Basic Email Notification ==================== diff --git a/tests/outputmanagement/integration/conftest.py b/tests/agentoutputtools/integration/conftest.py similarity index 76% rename from tests/outputmanagement/integration/conftest.py rename to tests/agentoutputtools/integration/conftest.py index d3b40485..5339e975 100644 --- a/tests/outputmanagement/integration/conftest.py +++ b/tests/agentoutputtools/integration/conftest.py @@ -1,6 +1,6 @@ # SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Cloud SDK contributors # SPDX-License-Identifier: Apache-2.0 -"""Pytest configuration for Output Management integration tests.""" +"""Pytest configuration for Agent Output Tools integration tests.""" import logging import os @@ -14,8 +14,8 @@ import pytest from dotenv import load_dotenv -from sap_cloud_sdk.outputmanagement import create_client, OutputManagementClient, DestinationCredentialConfig -from sap_cloud_sdk.outputmanagement._service_client import OutputManagementServiceClient +from sap_cloud_sdk.agentoutputtools import create_client, AgentOutputToolsClient, DestinationCredentialConfig +from sap_cloud_sdk.agentoutputtools._service_client import AgentOutputToolsServiceClient from sap_cloud_sdk.destination.config import DestinationConfig logger = logging.getLogger(__name__) @@ -26,8 +26,8 @@ MOCK_BASE_URL = f"http://{MOCK_HOST}:{MOCK_PORT}" -class MockOutputManagementHandler(BaseHTTPRequestHandler): - """Mock HTTP handler for Output Management service.""" +class MockAgentOutputToolsHandler(BaseHTTPRequestHandler): + """Mock HTTP handler for Agent Output Tools service.""" def log_message(self, format, *args): """Suppress default logging.""" @@ -78,8 +78,8 @@ def _send_error_response(self, status_code: int, message: str): self.wfile.write(json.dumps(error_response).encode("utf-8")) -class MockOutputManagementServer: - """Mock Output Management server for local testing.""" +class MockAgentOutputToolsServer: + """Mock Agent Output Tools server for local testing.""" def __init__(self, host: str = MOCK_HOST, port: int = MOCK_PORT): self.host = host @@ -89,11 +89,11 @@ def __init__(self, host: str = MOCK_HOST, port: int = MOCK_PORT): def start(self): """Start the mock server.""" - self.server = HTTPServer((self.host, self.port), MockOutputManagementHandler) + self.server = HTTPServer((self.host, self.port), MockAgentOutputToolsHandler) self.thread = Thread(target=self.server.serve_forever, daemon=True) self.thread.start() logger.info( - f"Mock Output Management server started at http://{self.host}:{self.port}" + f"Mock Agent Output Tools server started at http://{self.host}:{self.port}" ) def stop(self): @@ -101,15 +101,15 @@ def stop(self): if self.server: self.server.shutdown() self.server.server_close() - logger.info("Mock Output Management server stopped") + logger.info("Mock Agent Output Tools server stopped") @pytest.fixture(scope="session") -def output_management_client(): - """Create an Output Management client for testing. +def agent_output_tools_client(): + """Create an Agent Output Tools client for integration testing. Supports two modes: - 1. Cloud mode (default): Uses real BTP Output Management service + 1. Cloud mode (default): Uses real BTP Agent Output Tools service 2. Local mode (CLOUD_SDK_OMS_TEST_MODE=local): Uses mock HTTP server Cloud mode is the default for proper integration testing. @@ -120,10 +120,10 @@ def output_management_client(): test_mode = os.getenv("CLOUD_SDK_OMS_TEST_MODE", "cloud").lower() if test_mode == "local": - logger.info("Using LOCAL mode for Output Management integration tests") + logger.info("Using LOCAL mode for Agent Output Tools integration tests") return _create_local_client() else: - logger.info("Using CLOUD mode for Output Management integration tests") + logger.info("Using CLOUD mode for Agent Output Tools integration tests") return _create_cloud_client() @@ -135,25 +135,25 @@ def _create_cloud_client(): return client except Exception as e: pytest.skip( - f"Output Management cloud integration tests require credentials: {e}" + f"Agent Output Tools cloud integration tests require credentials: {e}" ) def _create_local_client(): """Create client for local testing with mock server.""" # Start mock server - server = MockOutputManagementServer() + server = MockAgentOutputToolsServer() server.start() # Create service client pointing to mock server - service_client = OutputManagementServiceClient( + service_client = AgentOutputToolsServiceClient( base_url=MOCK_BASE_URL, destination=None, destination_instance=None ) # Create high-level client - client = OutputManagementClient(service_client=service_client) + client = AgentOutputToolsClient(service_client=service_client) logger.info( - f"Created Output Management client for local testing at {MOCK_BASE_URL}" + f"Created Agent Output Tools client for local testing at {MOCK_BASE_URL}" ) return client diff --git a/tests/outputmanagement/integration/test_outputmanagement_bdd.py b/tests/agentoutputtools/integration/test_outputmanagement_bdd.py similarity index 95% rename from tests/outputmanagement/integration/test_outputmanagement_bdd.py rename to tests/agentoutputtools/integration/test_outputmanagement_bdd.py index 31f98c8a..7f06810a 100644 --- a/tests/outputmanagement/integration/test_outputmanagement_bdd.py +++ b/tests/agentoutputtools/integration/test_outputmanagement_bdd.py @@ -1,6 +1,6 @@ # SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Cloud SDK contributors # SPDX-License-Identifier: Apache-2.0 -"""BDD step definitions for Output Management integration tests.""" +"""BDD step definitions for Agent Output Tools integration tests.""" import logging from pathlib import Path @@ -8,7 +8,7 @@ import pytest from pytest_bdd import given, parsers, scenarios, then, when -from sap_cloud_sdk.outputmanagement import ( +from sap_cloud_sdk.agentoutputtools import ( AttachmentConfig, Channel, EmailConfiguration, @@ -21,7 +21,7 @@ logger = logging.getLogger(__name__) # Load all scenarios from the feature file -scenarios(str(Path(__file__).parent / "outputmanagement.feature")) +scenarios(str(Path(__file__).parent / "agentoutputtools.feature")) # ============================================================================ @@ -40,11 +40,11 @@ def context(): # ============================================================================ -@given("an Output Management client") -def output_management_client_available(output_management_client, context): - """Store the Output Management client in context.""" - context["client"] = output_management_client - logger.info("Output Management client initialized") +@given("an Agent Output Tools client") +def agent_output_tools_client_available(agent_output_tools_client, context): + """Store the Agent Output Tools client in context.""" + context["client"] = agent_output_tools_client + logger.info("Agent Output Tools client initialized") # ============================================================================ diff --git a/tests/outputmanagement/unit/__init__.py b/tests/agentoutputtools/unit/__init__.py similarity index 100% rename from tests/outputmanagement/unit/__init__.py rename to tests/agentoutputtools/unit/__init__.py diff --git a/tests/outputmanagement/unit/conftest.py b/tests/agentoutputtools/unit/conftest.py similarity index 78% rename from tests/outputmanagement/unit/conftest.py rename to tests/agentoutputtools/unit/conftest.py index 3da3ff0a..57c50acc 100644 --- a/tests/outputmanagement/unit/conftest.py +++ b/tests/agentoutputtools/unit/conftest.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company # SPDX-License-Identifier: Apache-2.0 -"""Pytest configuration for output management unit tests.""" +"""Pytest configuration for agent output tools unit tests.""" import pytest @@ -9,7 +9,7 @@ @pytest.fixture def sample_email_config(): """Provide a sample email configuration for testing.""" - from sap_cloud_sdk.outputmanagement import EmailConfiguration + from sap_cloud_sdk.agentoutputtools import EmailConfiguration return EmailConfiguration( emailNotificationTemplateKey="TEST_TEMPLATE", @@ -21,7 +21,7 @@ def sample_email_config(): @pytest.fixture def sample_attachment(): """Provide a sample attachment for testing.""" - from sap_cloud_sdk.outputmanagement import AttachmentConfig, FormConfiguration + from sap_cloud_sdk.agentoutputtools import AttachmentConfig, FormConfiguration form_config = FormConfiguration( form_id="test-form", @@ -36,7 +36,7 @@ def sample_attachment(): @pytest.fixture def sample_output_response(): """Provide a sample output response for testing.""" - from sap_cloud_sdk.outputmanagement import OutputResponse + from sap_cloud_sdk.agentoutputtools import OutputResponse return OutputResponse(outputRequestId="test-req-123") @@ -44,7 +44,7 @@ def sample_output_response(): @pytest.fixture def sample_pre_generated_attachment(): """Provide a sample pre-generated attachment for testing.""" - from sap_cloud_sdk.outputmanagement import PreGeneratedAttachment + from sap_cloud_sdk.agentoutputtools import PreGeneratedAttachment return PreGeneratedAttachment( url="https://dms.example.com/attachments/test-file.pdf", source="DMS" @@ -54,6 +54,6 @@ def sample_pre_generated_attachment(): @pytest.fixture def sample_destination_config(): """Provide a sample destination configuration for testing.""" - from sap_cloud_sdk.outputmanagement import DestinationCredentialConfig + from sap_cloud_sdk.agentoutputtools import DestinationCredentialConfig return DestinationCredentialConfig(destination_name="test-output-management") diff --git a/tests/outputmanagement/unit/test_basic.py b/tests/agentoutputtools/unit/test_basic.py similarity index 68% rename from tests/outputmanagement/unit/test_basic.py rename to tests/agentoutputtools/unit/test_basic.py index a55b43b7..164e5ee4 100644 --- a/tests/outputmanagement/unit/test_basic.py +++ b/tests/agentoutputtools/unit/test_basic.py @@ -1,42 +1,42 @@ # SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company # SPDX-License-Identifier: Apache-2.0 -"""Basic unit tests for output management module.""" +"""Basic unit tests for agent output tools module.""" -class TestOutputManagementModule: - """Test basic output management module functionality.""" +class TestAgentOutputToolsModule: + """Test basic agent output tools module functionality.""" def test_module_imports(self): - """Test that output management module can be imported.""" - from sap_cloud_sdk import outputmanagement + """Test that agent output tools module can be imported.""" + from sap_cloud_sdk import agentoutputtools - assert outputmanagement is not None + assert agentoutputtools is not None def test_client_import(self): """Test that unified client can be imported.""" - from sap_cloud_sdk.outputmanagement import OutputManagementClient + from sap_cloud_sdk.agentoutputtools import AgentOutputToolsClient - assert OutputManagementClient is not None + assert AgentOutputToolsClient is not None def test_service_client_import(self): """Test that service client can be imported.""" - from sap_cloud_sdk.outputmanagement._service_client import ( - OutputManagementServiceClient, + from sap_cloud_sdk.agentoutputtools._service_client import ( + AgentOutputToolsServiceClient, ) - assert OutputManagementServiceClient is not None + assert AgentOutputToolsServiceClient is not None def test_create_client_import(self): """Test that create_client factory function can be imported.""" - from sap_cloud_sdk.outputmanagement import create_client + from sap_cloud_sdk.agentoutputtools import create_client assert create_client is not None def test_constants_import(self): """Test that constants can be imported.""" - from sap_cloud_sdk.outputmanagement import FileFormat, Channel - from sap_cloud_sdk.outputmanagement.constants import Constants + from sap_cloud_sdk.agentoutputtools import FileFormat, Channel + from sap_cloud_sdk.agentoutputtools.constants import Constants assert Constants.API_OUTPUT_CONTROL is not None assert FileFormat.PDF is not None @@ -44,8 +44,8 @@ def test_constants_import(self): def test_exceptions_import(self): """Test that exceptions can be imported.""" - from sap_cloud_sdk.outputmanagement import ( - OutputManagementException, + from sap_cloud_sdk.agentoutputtools import ( + AgentOutputToolsException, ValidationException, AuthenticationException, NetworkException, @@ -53,7 +53,7 @@ def test_exceptions_import(self): DestinationAccessException, ) - assert OutputManagementException is not None + assert AgentOutputToolsException is not None assert ValidationException is not None assert AuthenticationException is not None assert NetworkException is not None @@ -62,7 +62,7 @@ def test_exceptions_import(self): def test_models_import(self): """Test that models can be imported.""" - from sap_cloud_sdk.outputmanagement import ( + from sap_cloud_sdk.agentoutputtools import ( OutputRequest, OutputRequestBuilder, OutputResponse, @@ -88,12 +88,12 @@ def test_models_import(self): def test_config_import(self): """Test that config can be imported.""" - from sap_cloud_sdk.outputmanagement import DestinationCredentialConfig + from sap_cloud_sdk.agentoutputtools import DestinationCredentialConfig assert DestinationCredentialConfig is not None def test_utils_import(self): """Test that utils can be imported.""" - from sap_cloud_sdk.outputmanagement.utils import RequestValidator + from sap_cloud_sdk.agentoutputtools.utils import RequestValidator assert RequestValidator is not None diff --git a/tests/outputmanagement/unit/test_client.py b/tests/agentoutputtools/unit/test_client.py similarity index 76% rename from tests/outputmanagement/unit/test_client.py rename to tests/agentoutputtools/unit/test_client.py index cf799e8c..eb4aa267 100644 --- a/tests/outputmanagement/unit/test_client.py +++ b/tests/agentoutputtools/unit/test_client.py @@ -1,29 +1,29 @@ # SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company # SPDX-License-Identifier: Apache-2.0 -"""Unit tests for the output management client.""" +"""Unit tests for the agent output tools client.""" from unittest.mock import Mock, patch import pytest -from sap_cloud_sdk.outputmanagement import OutputManagementClient -from sap_cloud_sdk.outputmanagement._service_client import OutputManagementServiceClient -from sap_cloud_sdk.outputmanagement._models import OutputRequest, OutputResponse +from sap_cloud_sdk.agentoutputtools import AgentOutputToolsClient +from sap_cloud_sdk.agentoutputtools._service_client import AgentOutputToolsServiceClient +from sap_cloud_sdk.agentoutputtools._models import OutputRequest, OutputResponse from sap_cloud_sdk.core.telemetry import Module, Operation -class TestOutputManagementClient: - """Test suite for OutputManagementClient.""" +class TestAgentOutputToolsClient: + """Test suite for AgentOutputToolsClient.""" def test_send_email_calls_service_client(self): """Test that send_email delegates to service client.""" - mock_service_client = Mock(spec=OutputManagementServiceClient) + mock_service_client = Mock(spec=AgentOutputToolsServiceClient) mock_service_client.send_output_request.return_value = OutputResponse( outputRequestId="req-123" ) - client = OutputManagementClient(service_client=mock_service_client) + client = AgentOutputToolsClient(service_client=mock_service_client) response = client.send_email( notification_template_key="TEST_TEMPLATE", @@ -36,12 +36,12 @@ def test_send_email_calls_service_client(self): def test_send_output_request_calls_service_client(self): """Test that send_output_request delegates to service client.""" - mock_service_client = Mock(spec=OutputManagementServiceClient) + mock_service_client = Mock(spec=AgentOutputToolsServiceClient) mock_service_client.send_output_request.return_value = OutputResponse( outputRequestId="req-456" ) - client = OutputManagementClient(service_client=mock_service_client) + client = AgentOutputToolsClient(service_client=mock_service_client) output_request = Mock(spec=OutputRequest) response = client.send_output_request(output_request) @@ -51,12 +51,12 @@ def test_send_output_request_calls_service_client(self): def test_send_email_records_request_metric(self): """Test that send_email records request metric.""" - mock_service_client = Mock(spec=OutputManagementServiceClient) + mock_service_client = Mock(spec=AgentOutputToolsServiceClient) mock_service_client.send_output_request.return_value = OutputResponse( outputRequestId="req-123" ) - client = OutputManagementClient(service_client=mock_service_client) + client = AgentOutputToolsClient(service_client=mock_service_client) with patch( "sap_cloud_sdk.core.telemetry.metrics_decorator.record_request_metric" @@ -74,9 +74,9 @@ def test_send_email_records_request_metric(self): # First call is from send_output_request assert mock_metric.call_args_list[0] == ( ( - Module.OUTPUT_MANAGEMENT, + Module.AGENT_OUTPUT_TOOLS, None, - Operation.OUTPUT_MANAGEMENT_SEND_OUTPUT_REQUEST, + Operation.AGENT_OUTPUT_TOOLS_SEND_OUTPUT_REQUEST, False, ), ) @@ -84,9 +84,9 @@ def test_send_email_records_request_metric(self): # Second call is from send_email assert mock_metric.call_args_list[1] == ( ( - Module.OUTPUT_MANAGEMENT, + Module.AGENT_OUTPUT_TOOLS, None, - Operation.OUTPUT_MANAGEMENT_SEND_EMAIL, + Operation.AGENT_OUTPUT_TOOLS_SEND_EMAIL, False, ), ) @@ -95,12 +95,12 @@ def test_send_email_records_request_metric(self): def test_send_output_request_records_request_metric(self): """Test that send_output_request records request metric.""" - mock_service_client = Mock(spec=OutputManagementServiceClient) + mock_service_client = Mock(spec=AgentOutputToolsServiceClient) mock_service_client.send_output_request.return_value = OutputResponse( outputRequestId="req-456" ) - client = OutputManagementClient(service_client=mock_service_client) + client = AgentOutputToolsClient(service_client=mock_service_client) output_request = Mock(spec=OutputRequest) with patch( @@ -109,9 +109,9 @@ def test_send_output_request_records_request_metric(self): response = client.send_output_request(output_request) mock_metric.assert_called_once_with( - Module.OUTPUT_MANAGEMENT, + Module.AGENT_OUTPUT_TOOLS, None, - Operation.OUTPUT_MANAGEMENT_SEND_OUTPUT_REQUEST, + Operation.AGENT_OUTPUT_TOOLS_SEND_OUTPUT_REQUEST, False, ) @@ -122,8 +122,8 @@ async def test_send_email_with_mcp_records_request_metric(self): """Test that send_email_with_mcp records request metric.""" from unittest.mock import AsyncMock - mock_service_client = Mock(spec=OutputManagementServiceClient) - client = OutputManagementClient(service_client=mock_service_client) + mock_service_client = Mock(spec=AgentOutputToolsServiceClient) + client = AgentOutputToolsClient(service_client=mock_service_client) # Mock MCP tool with AsyncMock for ainvoke mock_mcp_tool = Mock() @@ -141,9 +141,9 @@ async def test_send_email_with_mcp_records_request_metric(self): ) mock_metric.assert_called_once_with( - Module.OUTPUT_MANAGEMENT, + Module.AGENT_OUTPUT_TOOLS, None, - Operation.OUTPUT_MANAGEMENT_SEND_EMAIL_WITH_MCP, + Operation.AGENT_OUTPUT_TOOLS_SEND_EMAIL_WITH_MCP, False, ) @@ -151,8 +151,8 @@ async def test_send_email_with_mcp_records_request_metric(self): def test_send_email_with_validation_error_does_not_call_service(self): """Test that validation errors prevent service client calls.""" - mock_service_client = Mock(spec=OutputManagementServiceClient) - client = OutputManagementClient(service_client=mock_service_client) + mock_service_client = Mock(spec=AgentOutputToolsServiceClient) + client = AgentOutputToolsClient(service_client=mock_service_client) response = client.send_email( notification_template_key="", # Invalid: empty template key @@ -166,8 +166,8 @@ def test_send_email_with_validation_error_does_not_call_service(self): def test_create_output_request_returns_valid_request(self): """Test that create_output_request creates a valid OutputRequest.""" - mock_service_client = Mock(spec=OutputManagementServiceClient) - client = OutputManagementClient(service_client=mock_service_client) + mock_service_client = Mock(spec=AgentOutputToolsServiceClient) + client = AgentOutputToolsClient(service_client=mock_service_client) output_request = client.create_output_request( notification_template_key="TEST_TEMPLATE", diff --git a/tests/outputmanagement/unit/test_comprehensive.py b/tests/agentoutputtools/unit/test_comprehensive.py similarity index 95% rename from tests/outputmanagement/unit/test_comprehensive.py rename to tests/agentoutputtools/unit/test_comprehensive.py index 993820ff..5e192510 100644 --- a/tests/outputmanagement/unit/test_comprehensive.py +++ b/tests/agentoutputtools/unit/test_comprehensive.py @@ -1,19 +1,19 @@ # SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company # SPDX-License-Identifier: Apache-2.0 -"""Comprehensive tests for output management module.""" +"""Comprehensive tests for agent output tools module.""" -from sap_cloud_sdk.outputmanagement import ( +from sap_cloud_sdk.agentoutputtools import ( OutputResponse, EmailConfiguration, AttachmentConfig, PreGeneratedAttachment, FormConfiguration, - OutputManagementException, + AgentOutputToolsException, ValidationException, AuthenticationException, ) -from sap_cloud_sdk.outputmanagement._models import ErrorResponse +from sap_cloud_sdk.agentoutputtools._models import ErrorResponse class TestPydanticModelFeatures: @@ -172,27 +172,27 @@ def test_exception_with_nested_message(self): try: raise ValueError("Inner error") except ValueError as e: - error = OutputManagementException(f"Outer error: {str(e)}") + error = AgentOutputToolsException(f"Outer error: {str(e)}") assert "Inner error" in error.message assert "Outer error" in error.message def test_multiple_exception_types(self): """Test catching different exception types.""" errors = [ - OutputManagementException("General error"), + AgentOutputToolsException("General error"), ValidationException("Validation error"), AuthenticationException("Authentication error"), ] for error in errors: - assert isinstance(error, OutputManagementException) + assert isinstance(error, AgentOutputToolsException) assert isinstance(error, Exception) def test_exception_repr(self): """Test exception representation.""" - error = OutputManagementException("Test error") + error = AgentOutputToolsException("Test error") repr_str = repr(error) - assert "OutputManagementException" in repr_str or "Test error" in repr_str + assert "AgentOutputToolsException" in repr_str or "Test error" in repr_str class TestModelComparisons: diff --git a/tests/outputmanagement/unit/test_constants.py b/tests/agentoutputtools/unit/test_constants.py similarity index 92% rename from tests/outputmanagement/unit/test_constants.py rename to tests/agentoutputtools/unit/test_constants.py index 327051b9..363a652e 100644 --- a/tests/outputmanagement/unit/test_constants.py +++ b/tests/agentoutputtools/unit/test_constants.py @@ -1,9 +1,9 @@ # SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company # SPDX-License-Identifier: Apache-2.0 -"""Unit tests for output management constants.""" +"""Unit tests for agent output tools constants.""" -from sap_cloud_sdk.outputmanagement.constants import ( +from sap_cloud_sdk.agentoutputtools.constants import ( Constants, FileFormat, Channel, @@ -11,7 +11,7 @@ class TestConstants: - """Test output management constants.""" + """Test agent output tools constants.""" def test_api_output_control_exists(self): """Test API output control constant exists.""" diff --git a/tests/outputmanagement/unit/test_email_client_mcp.py b/tests/agentoutputtools/unit/test_email_client_mcp.py similarity index 83% rename from tests/outputmanagement/unit/test_email_client_mcp.py rename to tests/agentoutputtools/unit/test_email_client_mcp.py index 0375185d..ac4869bb 100644 --- a/tests/outputmanagement/unit/test_email_client_mcp.py +++ b/tests/agentoutputtools/unit/test_email_client_mcp.py @@ -1,23 +1,23 @@ # SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company # SPDX-License-Identifier: Apache-2.0 -"""Tests for OutputManagementClient MCP integration.""" +"""Tests for AgentOutputToolsClient MCP integration.""" import pytest from unittest.mock import Mock, AsyncMock, patch -from sap_cloud_sdk.outputmanagement import OutputManagementClient -from sap_cloud_sdk.outputmanagement._service_client import OutputManagementServiceClient +from sap_cloud_sdk.agentoutputtools import AgentOutputToolsClient +from sap_cloud_sdk.agentoutputtools._service_client import AgentOutputToolsServiceClient -class TestOutputManagementClientMCP: - """Test OutputManagementClient MCP integration methods.""" +class TestAgentOutputToolsClientMCP: + """Test AgentOutputToolsClient MCP integration methods.""" @pytest.fixture - def output_management_client(self): - """Create an OutputManagementClient instance for testing.""" + def agent_output_tools_client(self): + """Create an AgentOutputToolsClient instance for testing.""" # Create a mock service client - mock_service_client = Mock(spec=OutputManagementServiceClient) - return OutputManagementClient(mock_service_client) + mock_service_client = Mock(spec=AgentOutputToolsServiceClient) + return AgentOutputToolsClient(mock_service_client) @pytest.fixture def sample_business_document(self): @@ -45,10 +45,10 @@ def mock_mcp_tool(self): @pytest.mark.asyncio async def test_send_email_with_mcp_basic( - self, output_management_client, sample_business_document, mock_mcp_tool + self, agent_output_tools_client, sample_business_document, mock_mcp_tool ): """Test basic MCP email sending.""" - result = await output_management_client.send_email_with_mcp( + result = await agent_output_tools_client.send_email_with_mcp( tool_name="send_output_request", notification_template_key="PO_APPROVAL_NOTIFICATION", to_emails=["finance@company.com"], @@ -63,10 +63,10 @@ async def test_send_email_with_mcp_basic( @pytest.mark.asyncio async def test_send_email_with_mcp_with_cc( - self, output_management_client, sample_business_document, mock_mcp_tool + self, agent_output_tools_client, sample_business_document, mock_mcp_tool ): """Test MCP email sending with CC.""" - result = await output_management_client.send_email_with_mcp( + result = await agent_output_tools_client.send_email_with_mcp( tool_name="send_output_request", notification_template_key="PO_APPROVAL_NOTIFICATION", to_emails=["finance@company.com"], @@ -87,7 +87,7 @@ async def test_send_email_with_mcp_with_cc( @pytest.mark.asyncio async def test_send_email_with_mcp_with_attachments( - self, output_management_client, sample_business_document, mock_mcp_tool + self, agent_output_tools_client, sample_business_document, mock_mcp_tool ): """Test MCP email sending with attachments.""" attachment_urls = [ @@ -95,7 +95,7 @@ async def test_send_email_with_mcp_with_attachments( "https://dms.example.com/browser/root?objectId=67890&cmisselector=content", ] - result = await output_management_client.send_email_with_mcp( + result = await agent_output_tools_client.send_email_with_mcp( tool_name="send_output_request", notification_template_key="PO_APPROVAL_NOTIFICATION", to_emails=["finance@company.com"], @@ -118,10 +118,10 @@ async def test_send_email_with_mcp_with_attachments( @pytest.mark.asyncio async def test_send_email_with_mcp_traceparent_generated( - self, output_management_client, sample_business_document, mock_mcp_tool + self, agent_output_tools_client, sample_business_document, mock_mcp_tool ): """Test that traceparent is generated correctly.""" - result = await output_management_client.send_email_with_mcp( + result = await agent_output_tools_client.send_email_with_mcp( tool_name="send_output_request", notification_template_key="PO_APPROVAL_NOTIFICATION", to_emails=["finance@company.com"], @@ -147,10 +147,10 @@ async def test_send_email_with_mcp_traceparent_generated( @pytest.mark.asyncio async def test_send_email_with_mcp_sender_subaccount_from_param( - self, output_management_client, sample_business_document, mock_mcp_tool + self, agent_output_tools_client, sample_business_document, mock_mcp_tool ): """Test sender_provider_subaccount_id from parameter.""" - result = await output_management_client.send_email_with_mcp( + result = await agent_output_tools_client.send_email_with_mcp( tool_name="send_output_request", notification_template_key="PO_APPROVAL_NOTIFICATION", to_emails=["finance@company.com"], @@ -170,10 +170,10 @@ async def test_send_email_with_mcp_sender_subaccount_from_param( @pytest.mark.asyncio @patch.dict("os.environ", {"APPFND_CONHOS_SUBACCOUNTID": "env-subaccount-456"}) async def test_send_email_with_mcp_sender_subaccount_from_env( - self, output_management_client, sample_business_document, mock_mcp_tool + self, agent_output_tools_client, sample_business_document, mock_mcp_tool ): """Test sender_provider_subaccount_id from environment variable.""" - result = await output_management_client.send_email_with_mcp( + result = await agent_output_tools_client.send_email_with_mcp( tool_name="send_output_request", notification_template_key="PO_APPROVAL_NOTIFICATION", to_emails=["finance@company.com"], @@ -191,14 +191,20 @@ async def test_send_email_with_mcp_sender_subaccount_from_env( @pytest.mark.asyncio async def test_send_email_with_mcp_missing_tool_raises_error( - self, output_management_client, sample_business_document + self, agent_output_tools_client, sample_business_document ): """Test that missing MCP tool raises Exception.""" with pytest.raises( Exception, match="MCP tool invocation failed: mcp_tool parameter is required", ): - await output_management_client.send_email_with_mcp( + await agent_output_tools_client.send_email_with_mcp( + tool_name="send_output_request", + notification_template_key="PO_APPROVAL_NOTIFICATION", + to_emails=["finance@company.com"], + business_document=sample_business_document, + ) + await agent_output_tools_client.send_email_with_mcp( tool_name="send_output_request", notification_template_key="PO_APPROVAL_NOTIFICATION", to_emails=["finance@company.com"], @@ -208,14 +214,14 @@ async def test_send_email_with_mcp_missing_tool_raises_error( @pytest.mark.asyncio async def test_send_email_with_mcp_tool_failure( - self, output_management_client, sample_business_document + self, agent_output_tools_client, sample_business_document ): """Test handling of MCP tool invocation failure.""" mock_tool = Mock() mock_tool.ainvoke = AsyncMock(side_effect=Exception("MCP tool error")) with pytest.raises(Exception, match="MCP tool invocation failed"): - await output_management_client.send_email_with_mcp( + await agent_output_tools_client.send_email_with_mcp( tool_name="send_output_request", notification_template_key="PO_APPROVAL_NOTIFICATION", to_emails=["finance@company.com"], @@ -225,10 +231,10 @@ async def test_send_email_with_mcp_tool_failure( @pytest.mark.asyncio async def test_send_email_with_mcp_payload_structure( - self, output_management_client, sample_business_document, mock_mcp_tool + self, agent_output_tools_client, sample_business_document, mock_mcp_tool ): """Test that the MCP payload has correct structure.""" - result = await output_management_client.send_email_with_mcp( + result = await agent_output_tools_client.send_email_with_mcp( tool_name="send_output_request", notification_template_key="PO_APPROVAL_NOTIFICATION", to_emails=["finance@company.com", "accounting@company.com"], @@ -278,7 +284,7 @@ async def test_send_email_with_mcp_payload_structure( @pytest.mark.asyncio async def test_send_email_with_mcp_multiple_recipients( - self, output_management_client, sample_business_document, mock_mcp_tool + self, agent_output_tools_client, sample_business_document, mock_mcp_tool ): """Test MCP email sending with multiple recipients.""" recipients = [ @@ -287,7 +293,7 @@ async def test_send_email_with_mcp_multiple_recipients( "manager@company.com", ] - result = await output_management_client.send_email_with_mcp( + result = await agent_output_tools_client.send_email_with_mcp( tool_name="send_output_request", notification_template_key="PO_APPROVAL_NOTIFICATION", to_emails=recipients, @@ -308,7 +314,7 @@ async def test_send_email_with_mcp_multiple_recipients( @pytest.mark.asyncio async def test_send_email_with_mcp_complex_business_document( - self, output_management_client, mock_mcp_tool + self, agent_output_tools_client, mock_mcp_tool ): """Test MCP email with complex nested business document.""" complex_doc = { @@ -345,7 +351,7 @@ async def test_send_email_with_mcp_complex_business_document( } } - result = await output_management_client.send_email_with_mcp( + result = await agent_output_tools_client.send_email_with_mcp( tool_name="send_output_request", notification_template_key="INVOICE_NOTIFICATION", to_emails=["billing@customer.com"], @@ -365,11 +371,11 @@ async def test_send_email_with_mcp_complex_business_document( @pytest.mark.asyncio async def test_send_email_with_mcp_unique_trace_ids( - self, output_management_client, sample_business_document, mock_mcp_tool + self, agent_output_tools_client, sample_business_document, mock_mcp_tool ): """Test that each invocation generates unique trace IDs.""" # Call the method twice - await output_management_client.send_email_with_mcp( + await agent_output_tools_client.send_email_with_mcp( tool_name="send_output_request", notification_template_key="PO_APPROVAL_NOTIFICATION", to_emails=["finance@company.com"], @@ -377,7 +383,7 @@ async def test_send_email_with_mcp_unique_trace_ids( mcp_tool=mock_mcp_tool, ) - await output_management_client.send_email_with_mcp( + await agent_output_tools_client.send_email_with_mcp( tool_name="send_output_request", notification_template_key="PO_APPROVAL_NOTIFICATION", to_emails=["finance@company.com"], @@ -400,10 +406,10 @@ async def test_send_email_with_mcp_unique_trace_ids( @pytest.mark.asyncio async def test_send_email_with_mcp_no_optional_params( - self, output_management_client, sample_business_document, mock_mcp_tool + self, agent_output_tools_client, sample_business_document, mock_mcp_tool ): """Test MCP email with only required parameters.""" - result = await output_management_client.send_email_with_mcp( + result = await agent_output_tools_client.send_email_with_mcp( tool_name="send_output_request", notification_template_key="PO_APPROVAL_NOTIFICATION", to_emails=["finance@company.com"], diff --git a/tests/outputmanagement/unit/test_exceptions.py b/tests/agentoutputtools/unit/test_exceptions.py similarity index 55% rename from tests/outputmanagement/unit/test_exceptions.py rename to tests/agentoutputtools/unit/test_exceptions.py index aa8730da..51d5aea9 100644 --- a/tests/outputmanagement/unit/test_exceptions.py +++ b/tests/agentoutputtools/unit/test_exceptions.py @@ -1,12 +1,12 @@ # SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company # SPDX-License-Identifier: Apache-2.0 -"""Unit tests for output management exceptions.""" +"""Unit tests for agent output tools exceptions.""" import pytest -from sap_cloud_sdk.outputmanagement.exceptions import ( - OutputManagementException, +from sap_cloud_sdk.agentoutputtools.exceptions import ( + AgentOutputToolsException, ValidationException, AuthenticationException, NetworkException, @@ -15,31 +15,31 @@ ) -class TestOutputManagementExceptions: - """Test output management exception classes.""" +class TestAgentOutputToolsExceptions: + """Test agent output tools exception classes.""" - def test_output_management_exception_basic(self): - """Test basic OutputManagementException.""" - error = OutputManagementException("Test error") + def test_agent_output_tools_exception_basic(self): + """Test basic AgentOutputToolsException.""" + error = AgentOutputToolsException("Test error") assert error.message == "Test error" assert isinstance(error, Exception) - def test_output_management_exception_with_message(self): - """Test OutputManagementException with custom message.""" - message = "Something went wrong in output management" - error = OutputManagementException(message) + def test_agent_output_tools_exception_with_message(self): + """Test AgentOutputToolsException with custom message.""" + message = "Something went wrong in agent output tools" + error = AgentOutputToolsException(message) assert error.message == message - def test_output_management_exception_with_error_code(self): - """Test OutputManagementException with error code.""" - error = OutputManagementException("Test error", error_code="ERR001") + def test_agent_output_tools_exception_with_error_code(self): + """Test AgentOutputToolsException with error code.""" + error = AgentOutputToolsException("Test error", error_code="ERR001") assert error.message == "Test error" assert error.error_code == "ERR001" assert "ERR001" in str(error) - def test_output_management_exception_with_status_code(self): - """Test OutputManagementException with status code.""" - error = OutputManagementException("Test error", status_code=400) + def test_agent_output_tools_exception_with_status_code(self): + """Test AgentOutputToolsException with status code.""" + error = AgentOutputToolsException("Test error", status_code=400) assert error.message == "Test error" assert error.status_code == 400 assert "400" in str(error) @@ -48,73 +48,76 @@ def test_validation_exception(self): """Test ValidationException.""" error = ValidationException("Validation failed") assert error.message == "Validation failed" - assert isinstance(error, OutputManagementException) + assert isinstance(error, AgentOutputToolsException) assert isinstance(error, Exception) def test_authentication_exception(self): """Test AuthenticationException.""" error = AuthenticationException("Authentication failed") assert error.message == "Authentication failed" - assert isinstance(error, OutputManagementException) + assert isinstance(error, AgentOutputToolsException) assert isinstance(error, Exception) def test_network_exception(self): """Test NetworkException.""" error = NetworkException("Network error occurred") assert error.message == "Network error occurred" - assert isinstance(error, OutputManagementException) + assert isinstance(error, AgentOutputToolsException) assert isinstance(error, Exception) def test_destination_not_found_exception(self): """Test DestinationNotFoundException.""" error = DestinationNotFoundException("Destination not found") assert error.message == "Destination not found" - assert isinstance(error, OutputManagementException) + assert isinstance(error, AgentOutputToolsException) + assert isinstance(error, Exception) def test_destination_access_exception(self): """Test DestinationAccessException.""" error = DestinationAccessException("Cannot access destination") assert error.message == "Cannot access destination" - assert isinstance(error, OutputManagementException) + assert isinstance(error, AgentOutputToolsException) + assert isinstance(error, Exception) def test_exception_inheritance_chain(self): """Test exception inheritance chain.""" - assert issubclass(ValidationException, OutputManagementException) - assert issubclass(AuthenticationException, OutputManagementException) - assert issubclass(NetworkException, OutputManagementException) - assert issubclass(DestinationNotFoundException, OutputManagementException) - assert issubclass(DestinationAccessException, OutputManagementException) - assert issubclass(OutputManagementException, Exception) + assert issubclass(ValidationException, AgentOutputToolsException) + assert issubclass(AuthenticationException, AgentOutputToolsException) + assert issubclass(NetworkException, AgentOutputToolsException) + assert issubclass(DestinationNotFoundException, AgentOutputToolsException) + assert issubclass(DestinationAccessException, AgentOutputToolsException) + assert issubclass(AgentOutputToolsException, Exception) def test_exceptions_can_be_raised(self): """Test that exceptions can be raised and caught.""" - with pytest.raises(OutputManagementException): - raise OutputManagementException("Test") + with pytest.raises(AgentOutputToolsException): + raise AgentOutputToolsException("Test") with pytest.raises(ValidationException): raise ValidationException("Test") with pytest.raises(AuthenticationException): raise AuthenticationException("Test") + assert isinstance(AuthenticationException("Test"), Exception) def test_validation_error_caught_as_base_error(self): - """Test that ValidationException can be caught as base OutputManagementException.""" - with pytest.raises(OutputManagementException): + """Test that ValidationException can be caught as base AgentOutputToolsException.""" + with pytest.raises(AgentOutputToolsException): raise ValidationException("Validation failed") def test_authentication_error_caught_as_base_error(self): - """Test that AuthenticationException can be caught as base OutputManagementException.""" - with pytest.raises(OutputManagementException): + """Test that AuthenticationException can be caught as base AgentOutputToolsException.""" + with pytest.raises(AgentOutputToolsException): raise AuthenticationException("Auth failed") def test_exception_with_empty_message(self): """Test exceptions with empty message.""" - error = OutputManagementException("") + error = AgentOutputToolsException("") assert error.message == "" def test_exception_with_details(self): """Test exceptions with additional details.""" details = {"field": "email", "reason": "invalid format"} - error = OutputManagementException("Validation error", details=details) + error = AgentOutputToolsException("Validation error", details=details) assert error.details == details assert error.details["field"] == "email" diff --git a/tests/outputmanagement/unit/test_integration.py b/tests/agentoutputtools/unit/test_integration.py similarity index 94% rename from tests/outputmanagement/unit/test_integration.py rename to tests/agentoutputtools/unit/test_integration.py index 3c0cb7d8..c0ab5c46 100644 --- a/tests/outputmanagement/unit/test_integration.py +++ b/tests/agentoutputtools/unit/test_integration.py @@ -1,25 +1,25 @@ # SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company # SPDX-License-Identifier: Apache-2.0 -"""Integration-style unit tests for output management module.""" +"""Integration-style unit tests for agent output tools module (AgentOutputTools).""" import pytest -from sap_cloud_sdk.outputmanagement import ( +from sap_cloud_sdk.agentoutputtools import ( DestinationCredentialConfig, EmailConfiguration, AttachmentConfig, OutputResponse, FormConfiguration, PreGeneratedAttachment, - OutputManagementException, + AgentOutputToolsException, ValidationException, ) -from sap_cloud_sdk.outputmanagement._models import ErrorResponse +from sap_cloud_sdk.agentoutputtools._models import ErrorResponse -class TestOutputManagementIntegration: - """Integration-style tests for output management.""" +class TestAgentOutputToolsIntegration: + """Integration-style tests for agent output tools.""" def test_end_to_end_email_workflow(self): """Test complete email sending workflow.""" @@ -132,8 +132,8 @@ def test_multiple_recipients_workflow(self): def test_error_handling_workflow(self): """Test error handling in workflow.""" # Test that exceptions can be raised and caught - with pytest.raises(OutputManagementException): - raise OutputManagementException("General error") + with pytest.raises(AgentOutputToolsException): + raise AgentOutputToolsException("General error") with pytest.raises(ValidationException): raise ValidationException("Validation error") diff --git a/tests/outputmanagement/unit/test_models.py b/tests/agentoutputtools/unit/test_models.py similarity index 98% rename from tests/outputmanagement/unit/test_models.py rename to tests/agentoutputtools/unit/test_models.py index 4a98eecc..3ef49181 100644 --- a/tests/outputmanagement/unit/test_models.py +++ b/tests/agentoutputtools/unit/test_models.py @@ -1,19 +1,19 @@ # SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company # SPDX-License-Identifier: Apache-2.0 -"""Unit tests for output management models.""" +"""Unit tests for agent output tools models.""" import pytest from dataclasses import is_dataclass -from sap_cloud_sdk.outputmanagement import ( +from sap_cloud_sdk.agentoutputtools import ( OutputResponse, EmailConfiguration, AttachmentConfig, PreGeneratedAttachment, FormConfiguration, ) -from sap_cloud_sdk.outputmanagement._models import ErrorResponse +from sap_cloud_sdk.agentoutputtools._models import ErrorResponse class TestOutputResponse: