agsamantha/node_modules/openai/lib/chatCompletionUtils.js

20 lines
700 B
JavaScript
Raw Permalink Normal View History

2024-10-02 15:15:21 -05:00
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isPresent = exports.isToolMessage = exports.isFunctionMessage = exports.isAssistantMessage = void 0;
const isAssistantMessage = (message) => {
return message?.role === 'assistant';
};
exports.isAssistantMessage = isAssistantMessage;
const isFunctionMessage = (message) => {
return message?.role === 'function';
};
exports.isFunctionMessage = isFunctionMessage;
const isToolMessage = (message) => {
return message?.role === 'tool';
};
exports.isToolMessage = isToolMessage;
function isPresent(obj) {
return obj != null;
}
exports.isPresent = isPresent;
//# sourceMappingURL=chatCompletionUtils.js.map