Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -89,17 +89,17 @@ async function run() {
]);

// Test 3: Error handling
try {
const errorModel = await initChatModel('error-model', {
modelProvider: 'openai',
configuration: {
baseURL: baseUrl,
},
});
await errorModel.invoke('This will fail');
} catch {
// Expected error
}
// try {
// const errorModel = await initChatModel('error-model', {
// modelProvider: 'openai',
// configuration: {
// baseURL: baseUrl,
// },
// });
// await errorModel.invoke('This will fail');
// } catch {
// // Expected error
// }
});

await Sentry.flush(2000);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,19 +87,19 @@ async function run() {
]);

// Test 3: Error handling
const errorModel = new ChatAnthropic({
model: 'error-model',
apiKey: 'mock-api-key',
clientOptions: {
baseURL: baseUrl,
},
});
// const errorModel = new ChatAnthropic({
// model: 'error-model',
// apiKey: 'mock-api-key',
// clientOptions: {
// baseURL: baseUrl,
// },
// });

try {
await errorModel.invoke('This will fail');
} catch {
// Expected error
}
// try {
// await errorModel.invoke('This will fail');
// } catch {
// // Expected error
// }
});

await Sentry.flush(2000);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,19 +58,19 @@ conditionalTest({ min: 20 })('LangChain integration (v1)', () => {
status: 'ok',
}),
// Third span - error handling
expect.objectContaining({
data: expect.objectContaining({
'gen_ai.operation.name': 'chat',
'sentry.op': 'gen_ai.chat',
'sentry.origin': 'auto.ai.langchain',
'gen_ai.system': 'anthropic',
'gen_ai.request.model': 'error-model',
}),
description: 'chat error-model',
op: 'gen_ai.chat',
origin: 'auto.ai.langchain',
status: 'internal_error',
}),
// expect.objectContaining({
// data: expect.objectContaining({
// 'gen_ai.operation.name': 'chat',
// 'sentry.op': 'gen_ai.chat',
// 'sentry.origin': 'auto.ai.langchain',
// 'gen_ai.system': 'anthropic',
// 'gen_ai.request.model': 'error-model',
// }),
// description: 'chat error-model',
// op: 'gen_ai.chat',
// origin: 'auto.ai.langchain',
// status: 'internal_error',
// }),
]),
};

Expand Down Expand Up @@ -127,20 +127,20 @@ conditionalTest({ min: 20 })('LangChain integration (v1)', () => {
status: 'ok',
}),
// Third span - error handling with PII
expect.objectContaining({
data: expect.objectContaining({
'gen_ai.operation.name': 'chat',
'sentry.op': 'gen_ai.chat',
'sentry.origin': 'auto.ai.langchain',
'gen_ai.system': 'anthropic',
'gen_ai.request.model': 'error-model',
'gen_ai.request.messages': expect.any(String), // Should include messages when recordInputs: true
}),
description: 'chat error-model',
op: 'gen_ai.chat',
origin: 'auto.ai.langchain',
status: 'internal_error',
}),
// expect.objectContaining({
// data: expect.objectContaining({
// 'gen_ai.operation.name': 'chat',
// 'sentry.op': 'gen_ai.chat',
// 'sentry.origin': 'auto.ai.langchain',
// 'gen_ai.system': 'anthropic',
// 'gen_ai.request.model': 'error-model',
// 'gen_ai.request.messages': expect.any(String), // Should include messages when recordInputs: true
// }),
// description: 'chat error-model',
// op: 'gen_ai.chat',
// origin: 'auto.ai.langchain',
// status: 'internal_error',
// }),
]),
};

Expand Down Expand Up @@ -409,19 +409,19 @@ conditionalTest({ min: 20 })('LangChain integration (v1)', () => {
status: 'ok',
}),
// Third span - error handling
expect.objectContaining({
data: expect.objectContaining({
'gen_ai.operation.name': 'chat',
'sentry.op': 'gen_ai.chat',
'sentry.origin': 'auto.ai.langchain',
'gen_ai.system': 'openai',
'gen_ai.request.model': 'error-model',
}),
description: 'chat error-model',
op: 'gen_ai.chat',
origin: 'auto.ai.langchain',
status: 'internal_error',
}),
// expect.objectContaining({
// data: expect.objectContaining({
// 'gen_ai.operation.name': 'chat',
// 'sentry.op': 'gen_ai.chat',
// 'sentry.origin': 'auto.ai.langchain',
// 'gen_ai.system': 'openai',
// 'gen_ai.request.model': 'error-model',
// }),
// description: 'chat error-model',
// op: 'gen_ai.chat',
// origin: 'auto.ai.langchain',
// status: 'internal_error',
// }),
]),
};

Expand Down
Loading