@@ -1,5 +1,5 @@
|
||||
import { isNotEmpty } from '@typebot.io/lib/utils'
|
||||
import { ChatReply } from '@typebot.io/schemas'
|
||||
import { ContinueChatResponse } from '@typebot.io/schemas'
|
||||
import { OpenAIBlock } from '@typebot.io/schemas/features/blocks/integrations/openai'
|
||||
import { HTTPError } from 'got'
|
||||
import { ClientOptions, OpenAI } from 'openai'
|
||||
@@ -10,7 +10,7 @@ type Props = Pick<
|
||||
> & {
|
||||
apiKey: string
|
||||
temperature: number | undefined
|
||||
currentLogs?: ChatReply['logs']
|
||||
currentLogs?: ContinueChatResponse['logs']
|
||||
isRetrying?: boolean
|
||||
} & Pick<NonNullable<OpenAIBlock['options']>, 'apiVersion' | 'baseUrl'>
|
||||
|
||||
@@ -25,9 +25,9 @@ export const executeChatCompletionOpenAIRequest = async ({
|
||||
currentLogs = [],
|
||||
}: Props): Promise<{
|
||||
chatCompletion?: OpenAI.Chat.Completions.ChatCompletion
|
||||
logs?: ChatReply['logs']
|
||||
logs?: ContinueChatResponse['logs']
|
||||
}> => {
|
||||
const logs: ChatReply['logs'] = currentLogs
|
||||
const logs: ContinueChatResponse['logs'] = currentLogs
|
||||
if (messages.length === 0) return { logs }
|
||||
try {
|
||||
const config = {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { byId, isDefined } from '@typebot.io/lib'
|
||||
import { ChatReply, SessionState } from '@typebot.io/schemas'
|
||||
import { ContinueChatResponse, SessionState } from '@typebot.io/schemas'
|
||||
import { ChatCompletionOpenAIOptions } from '@typebot.io/schemas/features/blocks/integrations/openai'
|
||||
import { VariableWithUnknowValue } from '@typebot.io/schemas/features/typebot/variable'
|
||||
import { updateVariablesInSession } from '../../../variables/updateVariablesInSession'
|
||||
@@ -14,7 +14,7 @@ export const resumeChatCompletion =
|
||||
}: {
|
||||
outgoingEdgeId?: string
|
||||
options: ChatCompletionOpenAIOptions
|
||||
logs?: ChatReply['logs']
|
||||
logs?: ContinueChatResponse['logs']
|
||||
}
|
||||
) =>
|
||||
async (message: string, totalTokens?: number) => {
|
||||
|
||||
Reference in New Issue
Block a user