@openai/agents-core
Version:
The OpenAI Agents SDK is a lightweight yet powerful framework for building multi-agent workflows.
66 lines • 1.71 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.user = user;
exports.system = system;
exports.assistant = assistant;
/**
* Creates a user message entry
*
* @param input The input message from the user.
* @param options Any additional options that will be directly passed to the model.
* @returns A message entry.
*/
function user(input, options) {
return {
type: 'message',
role: 'user',
content: typeof input === 'string'
? [
{
type: 'input_text',
text: input,
},
]
: input,
providerData: options,
};
}
/**
* Creates a system message entry
*
* @param input The system prompt.
* @param options Any additional options that will be directly passed to the model.
* @returns A message entry.
*/
function system(input, options) {
return {
type: 'message',
role: 'system',
content: input,
providerData: options,
};
}
/**
* Creates an assistant message entry for example for multi-shot prompting
*
* @param content The assistant response.
* @param options Any additional options that will be directly passed to the model.
* @returns A message entry.
*/
function assistant(content, options) {
return {
type: 'message',
role: 'assistant',
content: typeof content === 'string'
? [
{
type: 'output_text',
text: content,
},
]
: content,
status: 'completed',
providerData: options,
};
}
//# sourceMappingURL=message.js.map