UNPKG

@convo-lang/convo-lang

Version:
25 lines 679 B
import { convoPromptImagePropKey } from "./convo-lang-ui-types.js"; export const getConvoPromptMediaUrl = (img, purpose) => { if (typeof img === 'string') { return img; } if (!img) { return undefined; } return img.url ?? img.getUrl?.(purpose) ?? img[convoPromptImagePropKey]?.(); }; export const isMdConvoEnabledFor = (role, state) => { if (state === 'all') { return true; } if (state === true || state === 'assistant') { return role === 'assistant'; } else if (state === 'user') { return role === 'user'; } else { return false; } }; //# sourceMappingURL=convo-lang-ui-lib.js.map