File size: 1,443 Bytes
90b0a17
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Instructions Directory

This directory contains all agent instructions used by the Data Extractor application in JSON format.

## Structure

```
instructions/
β”œβ”€β”€ README.md (this file)
└── agents/
    β”œβ”€β”€ data_extractor.json     # Data extraction agent instructions
    β”œβ”€β”€ data_arranger.json      # Data organization agent instructions
    └── code_generator.json     # Excel code generation agent instructions
```

## JSON Format

Each instruction file follows this structure:

```json
{
  "instructions": [
    "First instruction line",
    "Second instruction line",
    "..."
  ],
  "agent_type": "data_extractor|data_arranger|code_generator",
  "description": "Brief description of the agent's role",
  "category": "agents or other category"
}
```

## Benefits of JSON Format

1. **Structure**: Clean separation of instructions as array elements
2. **Metadata**: Includes agent type and description for context
3. **No Conversion**: Direct use as lists - no need to split strings
4. **Maintainability**: Easy to add, remove, or reorder instructions
5. **Validation**: JSON schema validation possible

## Usage

```python
from utils.prompt_loader import prompt_loader

# Load as list for agent initialization
instructions_list = prompt_loader.load_instructions_as_list("agents/data_extractor")

# Load as string for other uses
instructions_text = prompt_loader.load_instruction("agents/data_extractor")
```