Skip to content

Commit

Permalink
fix chat retrieval context display
Browse files Browse the repository at this point in the history
  • Loading branch information
brianpetro committed Sep 17, 2024
1 parent acad8a2 commit af435a4
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/sc_actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,7 @@ export class ScActions {
}
}]
});
const results = (await lookup(this.env, { hypotheticals: [hyd] }))
.map(res => {
res.entity.score = res.score; // DEPRECATED: handling when last score added to entity is not top score (needs to be fixed in Entities.nearest)
return res.entity;
})
;
const results = (await lookup(this.env, { hypotheticals: [hyd] }));
await this.env.chats.current.add_tool_output("lookup", results);
return;
}
Expand Down Expand Up @@ -146,8 +141,8 @@ export class ScActions {
*/
function parse_lookup_tool_output(tool_output) {
let content = "```sc-context\n";
tool_output.forEach((note, i) => {
content += `${note.entity.path}\n`;
tool_output.forEach((result, i) => {
content += `${result.entity.path}\n`;
});
content += "```";
return { role: "system", content };
Expand Down

0 comments on commit af435a4

Please sign in to comment.