🐛 (anthropic) Fix transform functions when response mapping has Message content
This commit is contained in:
@@ -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({
|
||||||
|
|||||||
@@ -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
|
||||||
|
),
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -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
|
||||||
|
),
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -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
|
||||||
|
),
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -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
|
||||||
|
),
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in New Issue
Block a user