You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/testing/Writing_Tests/Integrate_Your_Agent.md
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,20 +2,20 @@
2
2
3
3
<divclass='subtitle'>Get your agent ready for testing</div>
4
4
5
-
`testing` works with a simple yet powerful trace format as the common denominator for testing agents.
5
+
`testing` works with a simple yet powerful trace format as the common denominator for testing agents.
6
6
7
7
This trace format is a list of dictionaries, where each dictionary represents a message in the conversation. It is equivalent to the [OpenAI chat format](https://platform.openai.com/docs/api-reference/chat/create).
8
8
9
9
Each message has a `role` key that specifies the role of the speaker (e.g., `user` or `assistant`) and a `content` key that contains the message content.
10
10
11
11
```json
12
12
{
13
-
"role": "user",
13
+
"role": "user",
14
14
"content": "Hello there"
15
15
},
16
16
{
17
-
"role": "assistant",
18
-
"content": "Hello there",
17
+
"role": "assistant",
18
+
"content": "Hello there",
19
19
"tool_calls": [
20
20
{
21
21
"type": "function",
@@ -29,35 +29,35 @@ Each message has a `role` key that specifies the role of the speaker (e.g., `use
29
29
]
30
30
},
31
31
{
32
-
"role": "user",
32
+
"role": "user",
33
33
"content": "I need help with something."
34
34
}
35
35
```
36
36
37
-
Based on this simple format, it is easy to integrate your agent with Invariant `testing`.
37
+
Based on this simple format, it is easy to integrate your agent with Invariant `testing`.
38
38
39
39
> **Extended Format Support**`testing` also supports additional custom properties in the trace format, e.g. for metadata. Note, however, that convenience methods like `Trace.tool_calls()` assume the standard format. Similarly, if you are planning to visualize the trace in [Explorer](/explorer/), we advise you to stick to the standard format.
40
40
41
41
To learn about how to do this, follow one of the example guides below:
0 commit comments