We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3b8d8be commit a16472bCopy full SHA for a16472b
src/lib/actions.ts
@@ -1,12 +1,4 @@
1
export const getSuggestions = async (chatHistory: [string, string][]) => {
2
- const chatTurns = chatHistory.map(([role, content]) => {
3
- if (role === 'human') {
4
- return { role: 'user', content };
5
- } else {
6
- return { role: 'assistant', content };
7
- }
8
- });
9
-
10
const chatModel = localStorage.getItem('chatModelKey');
11
const chatModelProvider = localStorage.getItem('chatModelProviderId');
12
@@ -16,7 +8,7 @@ export const getSuggestions = async (chatHistory: [string, string][]) => {
16
'Content-Type': 'application/json',
17
},
18
body: JSON.stringify({
19
- chatHistory: chatTurns,
+ chatHistory,
20
chatModel: {
21
13
providerId: chatModelProvider,
22
14
key: chatModel,
0 commit comments