Rocky_Mountain_Vending/.pnpm-store/v10/files/d5/f818ee692895a1fc5f71f2557191005773d4fa521402725a05fc5326b7402374bceca836de3115aab7d7a8857ab78697e40a4e0196b84fbe84b8db2f27df8c
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

72 lines
1.9 KiB
Text

Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const genAiAttributes = require('../gen-ai-attributes.js');
const constants = require('./constants.js');
/**
* Maps OpenAI method paths to Sentry operation names
*/
function getOperationName(methodPath) {
if (methodPath.includes('chat.completions')) {
return genAiAttributes.OPENAI_OPERATIONS.CHAT;
}
if (methodPath.includes('responses')) {
// The responses API is also a chat operation
return genAiAttributes.OPENAI_OPERATIONS.CHAT;
}
return methodPath.split('.').pop() || 'unknown';
}
/**
* Get the span operation for OpenAI methods
* Following Sentry's convention: "gen_ai.{operation_name}"
*/
function getSpanOperation(methodPath) {
return `gen_ai.${getOperationName(methodPath)}`;
}
/**
* Check if a method path should be instrumented
*/
function shouldInstrument(methodPath) {
return constants.INSTRUMENTED_METHODS.includes(methodPath );
}
/**
* Build method path from current traversal
*/
function buildMethodPath(currentPath, prop) {
return currentPath ? `${currentPath}.${prop}` : prop;
}
/**
* Check if response is a Chat Completion object
*/
function isChatCompletionResponse(response) {
return (
response !== null &&
typeof response === 'object' &&
'object' in response &&
(response ).object === 'chat.completion'
);
}
/**
* Check if response is a Responses API object
*/
function isResponsesApiResponse(response) {
return (
response !== null &&
typeof response === 'object' &&
'object' in response &&
(response ).object === 'response'
);
}
exports.buildMethodPath = buildMethodPath;
exports.getOperationName = getOperationName;
exports.getSpanOperation = getSpanOperation;
exports.isChatCompletionResponse = isChatCompletionResponse;
exports.isResponsesApiResponse = isResponsesApiResponse;
exports.shouldInstrument = shouldInstrument;
//# sourceMappingURL=utils.js.map