Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

fix: response has changed from clippy

Jonathan Summers-Muir5339a7a345e7
diff --git a/packages/ui/src/components/Command/AiCommand.tsx b/packages/ui/src/components/Command/AiCommand.tsx
index 33d245c2775..fb448417a52 100644
--- a/packages/ui/src/components/Command/AiCommand.tsx
+++ b/packages/ui/src/components/Command/AiCommand.tsx
@@ -1,7 +1,7 @@
import type {
ChatCompletionResponseMessage,
- CreateChatCompletionResponse,
CreateChatCompletionResponseChoicesInner,
+ CreateCompletionResponse,
} from 'openai'
import { useCallback, useEffect, useReducer, useRef, useState } from 'react'
import ReactMarkdown from 'react-markdown'
@@ -151,12 +151,8 @@ const AiCommand = () => {
setIsResponding(true)
- const completionResponse: CreateChatCompletionResponse = JSON.parse(e.data)
- const [
- {
- delta: { content },
- },
- ] = completionResponse.choices as CreateChatCompletionResponseChoicesInnerDelta[]
+ const completionResponse: CreateCompletionResponse = JSON.parse(e.data)
+ const [{ text: content }] = completionResponse.choices
const text = content ?? ''