-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test tools can now pass commands to each other.
- Loading branch information
1 parent
b3ee144
commit bb7bb8e
Showing
3 changed files
with
43 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,31 @@ | ||
import { helperThread, helperThreadID } from "../helpers.js"; | ||
import { RouterAssistant } from "../fixtures.js"; | ||
|
||
test("using an assistant as router to the echo tool", async () => { | ||
const assistant = await RouterAssistant.create(); | ||
let assistant; | ||
|
||
beforeAll(async () => { | ||
assistant = await RouterAssistant.create(); | ||
}); | ||
|
||
test("sends message to the echo tool", async () => { | ||
const threadID = await helperThreadID(); | ||
const output = await assistant.ask("i need sales help", threadID); | ||
const output = await assistant.ask("/hello", threadID); | ||
expect(output).toMatch(/unrouteable/); | ||
const output2 = await assistant.ask("/echo 123 hello", threadID); | ||
expect(output2).toMatch(/123 hello/); | ||
// Ensure each has own tread using metadata links. | ||
}); | ||
|
||
test("each has own thread using metadata links", async () => { | ||
const threadID = await helperThreadID(); | ||
await assistant.ask("/echo hello", threadID); | ||
const thread = await helperThread(threadID); | ||
expect(thread.metadata.echo).toMatch(/thread_/); | ||
const thread2 = await helperThread(thread.metadata.echo); | ||
expect(thread2.metadata.tool).toMatch(/Experts\.js \(EchoTool\)/); | ||
}); | ||
|
||
test("commands can pass from tool to tool", async () => { | ||
const threadID = await helperThreadID(); | ||
const output = await assistant.ask("/marco", threadID); | ||
expect(output).toMatch(/polo/); | ||
}); |