docs: complete scene 8 chat entry slice
This commit is contained in:
@@ -154,9 +154,14 @@ describe("projectPreparedAuthoringThread", () => {
|
||||
});
|
||||
|
||||
it("keeps the canonical projection unchanged without a request override", () => {
|
||||
expect(projectPreparedAuthoringThread("discover")).toEqual(
|
||||
projectPreparedAuthoringThread("discover"),
|
||||
);
|
||||
const firstUser = projectPreparedAuthoringThread("discover")
|
||||
.find((message) => message.role === "user");
|
||||
expect(firstUser?.parts).toEqual([
|
||||
{
|
||||
type: "text",
|
||||
text: "We need to author a report workflow for the lda_report scenario. What sources and capabilities are available?",
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
||||
it("overrides only the first user request and preserves Discover tool data", () => {
|
||||
|
||||
@@ -287,15 +287,15 @@ export const projectPreparedAuthoringThread = (
|
||||
|
||||
let requestReplaced = false;
|
||||
return recording.slice(0, finalPhaseIndex + 1).flatMap((phase) => {
|
||||
const conversation = phase.conversation.map((turn, index) =>
|
||||
agentTextMessage(
|
||||
const conversation = phase.conversation.map((turn, index) => {
|
||||
const shouldReplaceRequest = requestOverride !== undefined && !requestReplaced && turn.role === "user";
|
||||
if (shouldReplaceRequest) requestReplaced = true;
|
||||
return agentTextMessage(
|
||||
`authoring-${phase.phase}-message-${index}`,
|
||||
turn.role,
|
||||
requestOverride !== undefined && !requestReplaced && turn.role === "user"
|
||||
? (requestReplaced = true, requestOverride)
|
||||
: turn.text,
|
||||
),
|
||||
);
|
||||
shouldReplaceRequest ? requestOverride : turn.text,
|
||||
);
|
||||
});
|
||||
const groupId = authoringToolGroupId(phase.phase);
|
||||
const toolParts = phase.commands.flatMap((command, index) => {
|
||||
const callId = `${groupId}-command-${index}`;
|
||||
|
||||
Reference in New Issue
Block a user