File size: 2,003 Bytes
e62c239
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# Car Sharing Administration Agent

This agent helps with car sharing administration by tracking kilometers traveled and generating reports.

## Features

- Record trips with starting and ending kilometer readings
- Calculate total kilometers traveled in a month
- Manage multiple users
- Parse kilometer readings from simple user input

## How to Use

### Recording a Trip

1. Set your user name first (if not already set)
   ```
   Please set my name as John Doe
   ```

2. Record a starting kilometer reading
   ```
   61520
   ```
   The agent will recognize this as a starting reading.

3. Record an ending kilometer reading
   ```
   64520
   ```
   The agent will calculate the distance traveled (3000 km in this example) and record the trip.

4. Alternatively, provide both readings at once
   ```
   I drove from 61520 to 64520
   ```
   The agent will parse both readings and record the trip.

### Getting Statistics

To get your monthly statistics, ask something like:
```
How many kilometers did I travel this month?
```
or
```
Show me my trip summary for April 2023
```

### Managing Users

You can switch between different users:
```
Switch to user Jane Doe
```

## Examples of Interactions

**Setting user:**
```
User: I'm John Doe
Agent: I've set your name as John Doe. You can now record your trips.
```

**Recording a trip:**
```
User: 61520
Agent: I've recorded 61520 as your starting kilometer reading. Please provide an ending reading when your trip is complete.

User: 64520
Agent: I've recorded your trip:
- Starting km: 61520
- Ending km: 64520
- Distance traveled: 3000 km
```

**Getting statistics:**
```
User: How many kilometers did I travel this month?
Agent: You've traveled 3000 kilometers in May 2023 across 1 trip.
```

## Technical Notes

The agent uses a SQLite database to store trip information. The database file (`car_sharing.db`) is created in the working directory.

User information is stored in a JSON file (`car_sharing_users.json`) in the working directory.