2
0

🐛 (anthropic) Fix transform functions when response mapping has Message content

This commit is contained in:
Baptiste Arnaud
2024-03-15 15:13:54 +01:00
parent a8a92594f3
commit 7d11a7dbc8
5 changed files with 23 additions and 0 deletions

View File

@@ -79,6 +79,9 @@ export const options = option.object({
const transformToChatCompletionOptions = (options: any) => ({ const transformToChatCompletionOptions = (options: any) => ({
...options, ...options,
action: 'Create chat completion', action: 'Create chat completion',
responseMapping: options.responseMapping?.map((res: any) =>
res.item === 'Message Content' ? { ...res, item: 'Message content' } : res
),
}) })
export const createChatMessage = createAction({ export const createChatMessage = createAction({

View File

@@ -80,6 +80,11 @@ export const createChatCompletion = createAction({
transform: (options) => ({ transform: (options) => ({
...options, ...options,
action: 'Create Chat Message', action: 'Create Chat Message',
responseMapping: options.responseMapping?.map((res: any) =>
res.item === 'Message content'
? { ...res, item: 'Message Content' }
: res
),
}), }),
}, },
], ],

View File

@@ -25,6 +25,11 @@ export const createChatCompletion = createAction({
transform: (options) => ({ transform: (options) => ({
...options, ...options,
action: 'Create Chat Message', action: 'Create Chat Message',
responseMapping: options.responseMapping?.map((res: any) =>
res.item === 'Message content'
? { ...res, item: 'Message Content' }
: res
),
}), }),
}, },
], ],

View File

@@ -32,6 +32,11 @@ export const createChatCompletion = createAction({
transform: (options) => ({ transform: (options) => ({
...options, ...options,
action: 'Create Chat Message', action: 'Create Chat Message',
responseMapping: options.responseMapping?.map((res: any) =>
res.item === 'Message content'
? { ...res, item: 'Message Content' }
: res
),
}), }),
}, },
], ],

View File

@@ -27,6 +27,11 @@ export const createChatCompletion = createAction({
transform: (options) => ({ transform: (options) => ({
...options, ...options,
action: 'Create Chat Message', action: 'Create Chat Message',
responseMapping: options.responseMapping?.map((res: any) =>
res.item === 'Message content'
? { ...res, item: 'Message Content' }
: res
),
}), }),
}, },
], ],