duckduckgo ai chat
1.0.0
영어 | 중국어
duckduckgo-ai-chat은 gpt-4o-mini를 무료로 사용할 수 있는 JavaScript/TypeScript용 Duckduckgo AI Chat API를 제공합니다.
npx jsr add @mumulhl/duckduckgo-ai-chat
# or
pnpm dlx jsr add @mumulhl/duckduckgo-ai-chat
# or
yarn dlx jsr add @mumulhl/duckduckgo-ai-chat
# or
deno add jsr:@mumulhl/duckduckgo-ai-chat
import { initChat } from "@mumulhl/duckduckgo-ai-chat" ;
// Initialize, optional models are gpt-4o-mini, claude-3-haiku, llama, mixtral
const chat = await initChat ( "gpt-4o-mini" ) ;
// Fetch the full reply in one go
let message = await chat . fetchFull ( "Hello" ) ;
console . log ( message )
// Redo
chat . redo ( )
message = await chat . fetchFull ( "Hello" ) ;
console . log ( message )
// Fetch the streamed reply
const stream = chat . fetchStream ( "Hello" ) ;
for await ( let data of stream ) {
console . log ( data )
}
불쌍한 별 개수...