🐛 (openai) Fix incompatible OpenAI types
This commit is contained in:
@@ -4,6 +4,7 @@ import { SessionState } from '@typebot.io/schemas'
|
|||||||
import {
|
import {
|
||||||
ChatCompletionOpenAIOptions,
|
ChatCompletionOpenAIOptions,
|
||||||
OpenAICredentials,
|
OpenAICredentials,
|
||||||
|
chatCompletionMessageRoles,
|
||||||
} from '@typebot.io/schemas/features/blocks/integrations/openai'
|
} from '@typebot.io/schemas/features/blocks/integrations/openai'
|
||||||
import { isEmpty } from '@typebot.io/lib'
|
import { isEmpty } from '@typebot.io/lib'
|
||||||
import { decrypt, isCredentialsV2 } from '@typebot.io/lib/api/encryption'
|
import { decrypt, isCredentialsV2 } from '@typebot.io/lib/api/encryption'
|
||||||
@@ -61,7 +62,16 @@ export const createChatCompletionOpenAI = async (
|
|||||||
newSessionState.isStreamEnabled
|
newSessionState.isStreamEnabled
|
||||||
)
|
)
|
||||||
return {
|
return {
|
||||||
clientSideActions: [{ streamOpenAiChatCompletion: { messages } }],
|
clientSideActions: [
|
||||||
|
{
|
||||||
|
streamOpenAiChatCompletion: {
|
||||||
|
messages: messages as {
|
||||||
|
content?: string
|
||||||
|
role: (typeof chatCompletionMessageRoles)[number]
|
||||||
|
}[],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
outgoingEdgeId,
|
outgoingEdgeId,
|
||||||
newSessionState,
|
newSessionState,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user