Skip to content

Commit 615466a

Browse files
committed
feat: color output
1 parent 95fa3c2 commit 615466a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/ai/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
GET_ELEMENT_SELECTORS_CONTEXT,
77
HELP_CONTEXT
88
} from './context'
9-
import { isObject } from '../shared'
9+
import { isObject, logStart, logSuccess } from '../shared'
1010

1111
type OpenAIChatModel =
1212
| 'gpt-4-0125-preview'
@@ -105,7 +105,7 @@ export function createCrawlOpenAI(
105105
} = option
106106

107107
const spinner = ora(
108-
`AI is answering your question, please wait a moment`
108+
logStart(`AI is answering your question, please wait a moment`)
109109
).start()
110110
const completion = await openai.chat.completions.create({
111111
model,
@@ -117,7 +117,7 @@ export function createCrawlOpenAI(
117117
response_format: { type: responseFormatType },
118118
temperature: 0.1
119119
})
120-
spinner.succeed(`AI has completed your question`)
120+
spinner.succeed(logSuccess(`AI has completed your question`))
121121

122122
const content = completion.choices[0].message.content
123123
const result =

0 commit comments

Comments
 (0)