Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 31 additions & 6 deletions docs/src/content/docs/cookbook/monitoring/logging.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,16 @@ export interface OrchestratorOptions {
</TabItem>
<TabItem label="Python" icon="seti:python">
```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,
):
...
```
</TabItem>
</Tabs>
Expand All @@ -56,8 +65,8 @@ npm install @aws-lambda-powertools/logger

</TabItem>
<TabItem label="Python" icon="seti:python">
```python
// TODO: Add python code here
```bash
pip install aws-lambda-powertools
```
</TabItem>
</Tabs>
Expand All @@ -81,7 +90,12 @@ const logger = new Logger({
</TabItem>
<TabItem label="Python" icon="seti:python">
```python
// TODO: Add python code here
from aws_lambda_powertools import Logger

logger = Logger(
level="INFO",
service="MyOrchestratorService"
)
```
</TabItem>
</Tabs>
Expand Down Expand Up @@ -109,7 +123,18 @@ const orchestrator = new AgentSquad({
</TabItem>
<TabItem label="Python" icon="seti:python">
```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,
)
```
</TabItem>
</Tabs>
Expand All @@ -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.
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.