Skip to content

Commit

Permalink
Change name of contentfragment in conversation rendering for model (#…
Browse files Browse the repository at this point in the history
…3430)

* Change name of contentfragment in conversation rendering for model

Related [discussion](https://dust4ai.slack.com/archives/C050A0S2Z7F/p1706189052158989)

* fix as per IRL

* review
  • Loading branch information
philipperolet authored Jan 25, 2024
1 parent d76b87d commit ca1aa8b
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions front/lib/api/assistant/generation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,14 @@ export async function renderConversationForModel({
});
} else if (isContentFragmentType(m)) {
messages.unshift({
role: "content_fragment" as const,
name: "inject_content_fragment",
content: `${m.title}\nCONTENT:\n${m.content}`,
role: "content_fragment",
name: `inject_${m.contentType}`,
content:
`TITLE: ${m.title}\n` +
`TYPE: ${m.contentType}${
m.contentType === "file_attachment" ? " (user provided)" : ""
}\n` +
`CONTENT:\n${m.content}`,
});
} else {
((x: never) => {
Expand Down

0 comments on commit ca1aa8b

Please sign in to comment.