Skip to content

Commit 6d6447f

Browse files
committed
Respect ChatOptions.Instructions in HuggingFaceClient.GetResponseAsync
1 parent 8d13088 commit 6d6447f

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/libs/HuggingFace/Extensions/HuggingFaceApi.ChatClient.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@ async Task<ChatResponse> IChatClient.GetResponseAsync(IEnumerable<ChatMessage> m
3434
}
3535
prompt.AppendLine();
3636
}
37+
38+
if (options?.Instructions is { } instructions)
39+
{
40+
AppendRole(ChatRole.System);
41+
prompt.Append(instructions).AppendLine();
42+
}
43+
3744
AppendRole(ChatRole.Assistant);
3845

3946
void AppendRole(ChatRole role) => prompt.Append("<|").Append(role.Value).Append("|>");

0 commit comments

Comments
 (0)