Skip to content
Closed
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 @@ -93,6 +93,14 @@ describe('Anthropic integration', () => {
expect(streamingSpan!.name).toBe('chat claude-3-haiku-20240307');
expect(streamingSpan!.status).toBe('ok');
expect(streamingSpan!.attributes[GEN_AI_RESPONSE_STREAMING].value).toBe(true);

for (const span of [completionSpan!, errorSpan!, streamingSpan!]) {
expect(span.attributes[GEN_AI_INPUT_MESSAGES]).toBeUndefined();
expect(span.attributes[GEN_AI_SYSTEM_INSTRUCTIONS]).toBeUndefined();
expect(span.attributes[GEN_AI_RESPONSE_TEXT]).toBeUndefined();
expect(span.attributes[GEN_AI_RESPONSE_TOOL_CALLS]).toBeUndefined();
expect(span.attributes[GEN_AI_TOOL_DEFINITIONS]).toBeUndefined();
}
},
})
.expect({ event: EXPECTED_STREAM_EVENT_HANDLER_MESSAGE })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,15 @@ describe('Google GenAI integration', () => {
expect(errorSpan!.attributes[GEN_AI_OPERATION_NAME].value).toBe('generate_content');
expect(errorSpan!.attributes[GEN_AI_PROVIDER_NAME].value).toBe('google_genai');
expect(errorSpan!.attributes[GEN_AI_REQUEST_MODEL].value).toBe('error-model');

for (const span of [chatSpan!, generateContentSpan!, errorSpan!]) {
expect(span.attributes[GEN_AI_INPUT_MESSAGES]).toBeUndefined();
expect(span.attributes[GEN_AI_SYSTEM_INSTRUCTIONS]).toBeUndefined();
expect(span.attributes[GEN_AI_OUTPUT_MESSAGES]).toBeUndefined();
expect(span.attributes[GEN_AI_RESPONSE_TEXT]).toBeUndefined();
expect(span.attributes[GEN_AI_RESPONSE_TOOL_CALLS]).toBeUndefined();
expect(span.attributes[GEN_AI_TOOL_DEFINITIONS]).toBeUndefined();
}
},
})
.start()
Expand Down Expand Up @@ -352,6 +361,15 @@ describe('Google GenAI integration', () => {
expect(errorSpan!.status).toBe('error');
expect(errorSpan!.attributes['sentry.op'].value).toBe('gen_ai.generate_content');
expect(errorSpan!.attributes[GEN_AI_OPERATION_NAME].value).toBe('generate_content');

for (const span of [generateContentSpan!, chatSpan!, blockedSpan!, errorSpan!]) {
expect(span.attributes[GEN_AI_INPUT_MESSAGES]).toBeUndefined();
expect(span.attributes[GEN_AI_SYSTEM_INSTRUCTIONS]).toBeUndefined();
expect(span.attributes[GEN_AI_OUTPUT_MESSAGES]).toBeUndefined();
expect(span.attributes[GEN_AI_RESPONSE_TEXT]).toBeUndefined();
expect(span.attributes[GEN_AI_RESPONSE_TOOL_CALLS]).toBeUndefined();
expect(span.attributes[GEN_AI_TOOL_DEFINITIONS]).toBeUndefined();
}
},
})
.start()
Expand Down Expand Up @@ -511,6 +529,7 @@ describe('Google GenAI integration', () => {
expect(errorSpan!.status).toBe('error');
expect(errorSpan!.attributes['sentry.op'].value).toBe('gen_ai.embeddings');
expect(errorSpan!.attributes[GEN_AI_OPERATION_NAME].value).toBe('embeddings');
expect(errorSpan!.attributes[GEN_AI_EMBEDDINGS_INPUT]).toBeUndefined();
},
})
.start()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,13 @@ describe('LangChain integration', () => {
expect(errorSpan!.attributes['sentry.origin'].value).toBe('auto.ai.langchain');
expect(errorSpan!.attributes[GEN_AI_PROVIDER_NAME].value).toBe('anthropic');
expect(errorSpan!.attributes[GEN_AI_REQUEST_MODEL].value).toBe('error-model');

for (const span of [sonnetSpan!, opusSpan!, errorSpan!]) {
expect(span.attributes[GEN_AI_INPUT_MESSAGES]).toBeUndefined();
expect(span.attributes[GEN_AI_SYSTEM_INSTRUCTIONS]).toBeUndefined();
expect(span.attributes[GEN_AI_RESPONSE_TEXT]).toBeUndefined();
expect(span.attributes[GEN_AI_RESPONSE_TOOL_CALLS]).toBeUndefined();
}
},
})
.start()
Expand Down Expand Up @@ -333,6 +340,10 @@ describe('LangChain integration', () => {
expect(errorSpan!.status).toBe('error');
expect(errorSpan!.attributes['sentry.op'].value).toBe(GEN_AI_EMBEDDINGS);
expect(errorSpan!.attributes[GEN_AI_PROVIDER_NAME].value).toBe('openai');

for (const span of [...successfulSpans, errorSpan!]) {
expect(span.attributes[GEN_AI_EMBEDDINGS_INPUT]).toBeUndefined();
}
},
})
.start()
Expand Down
Loading