nsarrazin HF Staff commited on
Commit
1fcfcd5
·
unverified ·
1 Parent(s): 38c25e1

fix: use custom tool template only for huggingchat

Browse files
Files changed (1) hide show
  1. src/lib/server/models.ts +2 -2
src/lib/server/models.ts CHANGED
@@ -130,7 +130,7 @@ async function getChatPromptRender(
130
  // or use the `rag` mode without the citations
131
  const id = m.id ?? m.name;
132
 
133
- if (id.startsWith("CohereForAI")) {
134
  formattedMessages = [
135
  {
136
  role: "system",
@@ -157,7 +157,7 @@ async function getChatPromptRender(
157
  },
158
  ...formattedMessages,
159
  ];
160
- } else if (id.startsWith("meta-llama")) {
161
  const results = toolResults.flatMap((result) => {
162
  if (result.status === ToolResultStatus.Error) {
163
  return [
 
130
  // or use the `rag` mode without the citations
131
  const id = m.id ?? m.name;
132
 
133
+ if (isHuggingChat && id.startsWith("CohereForAI")) {
134
  formattedMessages = [
135
  {
136
  role: "system",
 
157
  },
158
  ...formattedMessages,
159
  ];
160
+ } else if (isHuggingChat && id.startsWith("meta-llama")) {
161
  const results = toolResults.flatMap((result) => {
162
  if (result.status === ToolResultStatus.Error) {
163
  return [