Skip to content
Open
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
1 change: 0 additions & 1 deletion ddtrace/llmobs/_integrations/langchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -915,7 +915,6 @@ def handle_prompt_template_invoke(self, instance, result, args: List[Any], kwarg
"template": template,
"chat_template": chat_template,
"id": prompt_id if prompt_id is not None else "unknown",
"version": "0.0.0",
"rag_context_variables": [],
"rag_query_variables": [],
"tags": tags,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
fixes:
- |
langchain: This fix resolves an issue where auto instrumented prompt templates incorrectly included a
``version`` field. The version field is now omitted unless explicitly set by the user.
7 changes: 0 additions & 7 deletions tests/contrib/langchain/test_langchain_llmobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,6 @@ def test_llmobs_chain(langchain_core, langchain_openai, openai_url, llmobs_event
{"content": "{input}", "role": "user"},
],
"variables": {"input": "Can you explain what an LLM chain is?"},
"version": "0.0.0",
"_dd_context_variable_keys": ["context"],
"_dd_query_variable_keys": ["question"],
},
Expand Down Expand Up @@ -456,7 +455,6 @@ def test_llmobs_chain_nested(langchain_core, langchain_openai, openai_url, llmob
"id": "langchain.unknown_prompt_template",
"chat_template": [{"content": "what is the city {person} is from?", "role": "user"}],
"variables": {"person": "Spongebob Squarepants", "language": "Spanish"},
"version": "0.0.0",
"_dd_context_variable_keys": ["context"],
"_dd_query_variable_keys": ["question"],
},
Expand All @@ -469,7 +467,6 @@ def test_llmobs_chain_nested(langchain_core, langchain_openai, openai_url, llmob
"id": "test_langchain_llmobs.prompt2",
"chat_template": [{"content": "what country is the city {city} in? respond in {language}", "role": "user"}],
"variables": {"city": mock.ANY, "language": "Spanish"},
"version": "0.0.0",
"_dd_context_variable_keys": ["context"],
"_dd_query_variable_keys": ["question"],
},
Expand Down Expand Up @@ -505,7 +502,6 @@ def test_llmobs_chain_batch(langchain_core, langchain_openai, llmobs_events, tra
"id": "langchain.unknown_prompt_template",
"chat_template": [{"content": "Tell me a short joke about {topic}", "role": "user"}],
"variables": {"topic": "chickens"},
"version": "0.0.0",
"_dd_context_variable_keys": ["context"],
"_dd_query_variable_keys": ["question"],
},
Expand All @@ -519,7 +515,6 @@ def test_llmobs_chain_batch(langchain_core, langchain_openai, llmobs_events, tra
"id": "langchain.unknown_prompt_template",
"chat_template": [{"content": "Tell me a short joke about {topic}", "role": "user"}],
"variables": {"topic": "pigs"},
"version": "0.0.0",
"_dd_context_variable_keys": ["context"],
"_dd_query_variable_keys": ["question"],
},
Expand All @@ -534,7 +529,6 @@ def test_llmobs_chain_batch(langchain_core, langchain_openai, llmobs_events, tra
"id": "langchain.unknown_prompt_template",
"chat_template": [{"content": "Tell me a short joke about {topic}", "role": "user"}],
"variables": {"topic": "chickens"},
"version": "0.0.0",
"_dd_context_variable_keys": ["context"],
"_dd_query_variable_keys": ["question"],
},
Expand All @@ -548,7 +542,6 @@ def test_llmobs_chain_batch(langchain_core, langchain_openai, llmobs_events, tra
"id": "langchain.unknown_prompt_template",
"chat_template": [{"content": "Tell me a short joke about {topic}", "role": "user"}],
"variables": {"topic": "pigs"},
"version": "0.0.0",
"_dd_context_variable_keys": ["context"],
"_dd_query_variable_keys": ["question"],
},
Expand Down
Loading