diff --git a/docs/src/content/docs/cookbook/monitoring/logging.mdx b/docs/src/content/docs/cookbook/monitoring/logging.mdx index 4575d78e..637766bd 100644 --- a/docs/src/content/docs/cookbook/monitoring/logging.mdx +++ b/docs/src/content/docs/cookbook/monitoring/logging.mdx @@ -33,7 +33,16 @@ export interface OrchestratorOptions { ```python -// TODO: Add python code here +class AgentSquad: + def __init__( + self, + options: AgentSquadConfig | dict | None = None, + storage: ChatStorage | None = None, + classifier: Classifier | None = None, + logger: Logger | None = None, + default_agent: Agent | None = None, + ): + ... ``` @@ -56,8 +65,8 @@ npm install @aws-lambda-powertools/logger -```python -// TODO: Add python code here +```bash +pip install aws-lambda-powertools ``` @@ -81,7 +90,12 @@ const logger = new Logger({ ```python -// TODO: Add python code here +from aws_lambda_powertools import Logger + +logger = Logger( + level="INFO", + service="MyOrchestratorService" +) ``` @@ -109,7 +123,18 @@ const orchestrator = new AgentSquad({ ```python -// TODO: Add python code here +from agent_squad.orchestrator import AgentSquad + +orchestrator = AgentSquad( + options={ + "LOG_AGENT_CHAT": True, + "LOG_CLASSIFIER_CHAT": True, + "LOG_CLASSIFIER_RAW_OUTPUT": True, + "LOG_CLASSIFIER_OUTPUT": True, + "LOG_EXECUTION_TIMES": True, + }, + logger=logger, +) ``` @@ -136,4 +161,4 @@ By setting these options to `true` or `false`, you can control the verbosity of 3. Use appropriate log levels (e.g., INFO, DEBUG, ERROR) to categorize your log messages. 4. Monitor your logs regularly to track the performance and behavior of your orchestrator. -By leveraging these logging capabilities, you can gain valuable insights into the operation of your Agent Squad and more easily diagnose any issues that may arise. \ No newline at end of file +By leveraging these logging capabilities, you can gain valuable insights into the operation of your Agent Squad and more easily diagnose any issues that may arise.