We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0473c7f commit 526acf3Copy full SHA for 526acf3
sentry_sdk/integrations/langchain.py
@@ -5,6 +5,7 @@
5
import sentry_sdk
6
from sentry_sdk.ai.monitoring import set_ai_pipeline_name
7
from sentry_sdk.ai.utils import (
8
+ GEN_AI_ALLOWED_MESSAGE_ROLES,
9
normalize_message_roles,
10
set_data_normalized,
11
get_start_span_function,
@@ -213,7 +214,13 @@ def on_llm_start(
213
214
_set_tools_on_span(span, all_params.get("tools"))
215
216
if should_send_default_pii() and self.include_prompts:
- normalized_messages = normalize_message_roles(prompts)
217
+ normalized_messages = [
218
+ {
219
+ "role": GEN_AI_ALLOWED_MESSAGE_ROLES.USER,
220
+ "content": {"type": "text", "text": prompt},
221
+ }
222
+ for prompt in prompts
223
+ ]
224
set_data_normalized(
225
span,
226
SPANDATA.GEN_AI_REQUEST_MESSAGES,
0 commit comments