MCPcopy Create free account
hub / github.com/Effect-TS/effect / make

Function make

packages/ai/ai/src/Prompt.ts:1486–1500  ·  view source on GitHub ↗
(input: RawInput)

Source from the content-addressed store, hash-verified

1484 * @category Constructors
1485 */
1486export const make = (input: RawInput): Prompt => {
1487 if (Predicate.isString(input)) {
1488 const part = makePart("text", { text: input })
1489 const message = makeMessage("user", { content: [part] })
1490 return makePrompt([message])
1491 }
1492
1493 if (Predicate.isIterable(input)) {
1494 return makePrompt(decodeMessagesSync(Arr.fromIterable(input), {
1495 errors: "all"
1496 }))
1497 }
1498
1499 return input
1500}
1501
1502/**
1503 * Creates a Prompt from an array of messages.

Callers 1

Prompt.tsFile · 0.70

Calls 3

makeMessageFunction · 0.85
makePromptFunction · 0.85
makePartFunction · 0.70

Tested by

no test coverage detected