2
0

(openai) Add gpt-4 models and temperature setting

Closes #406
This commit is contained in:
Baptiste Arnaud
2023-03-20 17:26:21 +01:00
parent efdcec1c0c
commit 4109a8489c
4 changed files with 61 additions and 5 deletions

View File

@@ -0,0 +1,12 @@
import { Variable } from '@typebot.io/schemas'
import { parseGuessedValueType } from './parseGuessedValueType'
import { parseVariables } from './parseVariables'
export const parseVariableNumber =
(variables: Variable[]) =>
(input: number | `{{${string}}}` | undefined): number | undefined => {
if (typeof input === 'number' || input === undefined) return input
const parsedInput = parseGuessedValueType(parseVariables(variables)(input))
if (typeof parsedInput !== 'number') return undefined
return parsedInput
}