2
0

♻️ Migrate from got to ky (#1416)

Closes #1415
This commit is contained in:
Baptiste Arnaud
2024-04-05 09:01:16 +02:00
committed by GitHub
parent ccc7101dd3
commit d96f384e02
59 changed files with 990 additions and 628 deletions

View File

@ -6,7 +6,7 @@ import { getChatCompletionStreamVarId } from '@typebot.io/openai-block/shared/ge
import { runChatCompletion } from '@typebot.io/openai-block/shared/runChatCompletion'
import { runChatCompletionStream } from '@typebot.io/openai-block/shared/runChatCompletionStream'
import { defaultOpenRouterOptions } from '../constants'
import { got } from 'got'
import ky from 'ky'
import { ModelsResponse } from '../types'
export const createChatCompletion = createAction({
@ -42,7 +42,7 @@ export const createChatCompletion = createAction({
id: 'fetchModels',
dependencies: [],
fetch: async () => {
const response = await got
const response = await ky
.get(defaultOpenRouterOptions.baseUrl + '/models')
.json<ModelsResponse>()

View File

@ -12,6 +12,6 @@
"typescript": "5.3.2",
"@typebot.io/lib": "workspace:*",
"@typebot.io/openai-block": "workspace:*",
"got": "12.6.0"
"ky": "1.2.3"
}
}