unchained / src /llm /openai /getTextPrompt.mts
barton
Duplicate from jbilcke-hf/VideoChain-API
53aa97a
raw
history blame
194 Bytes
import { ChatCompletionRequestMessage } from "openai"
export const getTextPrompt = (prompt: ChatCompletionRequestMessage[]) =>
prompt.reduce((acc, item) => acc.concat(item.content), "") || ""