langchain-ai
langchain
BlogDocsChangelog

fix(core): implement `ChatPromptTemplate.save()` method

#32654Closed
Comparing
keyuchen21:fix-chat-prompt-save
(
abdb539
) with
master
(
2d0713c
)
CodSpeed Performance Gauge
0%
Untouched
14

Benchmarks

Passed

test_init_time
libs/partners/anthropic/tests/unit_tests/test_standard.py::TestAnthropicStandard
CodSpeed Performance Gauge
0%
3.8 ms3.8 ms
test_stream_time
libs/partners/anthropic/tests/integration_tests/test_standard.py::TestAnthropicStandard
CodSpeed Performance Gauge
0%
37.5 ms37.4 ms
test_stream_time
libs/partners/openai/tests/integration_tests/chat_models/test_responses_standard.py::TestOpenAIStandard
CodSpeed Performance Gauge
0%
1.1 s1.1 s
test_stream_time
libs/partners/openai/tests/integration_tests/chat_models/test_base_standard.py::TestOpenAIStandard
CodSpeed Performance Gauge
0%
1.1 s1.1 s
test_stream_time
libs/partners/openai/tests/integration_tests/chat_models/test_responses_standard.py::TestOpenAIResponses
CodSpeed Performance Gauge
0%
935.5 ms935.1 ms
test_init_time
libs/partners/mistralai/tests/unit_tests/test_standard.py::TestMistralStandard
CodSpeed Performance Gauge
0%
12.5 ms12.5 ms
test_init_time
libs/partners/deepseek/tests/unit_tests/test_chat_models.py::TestChatDeepSeekUnit
CodSpeed Performance Gauge
0%
1.6 s1.6 s
test_init_time
libs/partners/openai/tests/unit_tests/chat_models/test_azure_standard.py::TestOpenAIStandard
CodSpeed Performance Gauge
0%
1.7 s1.7 s
test_init_time
libs/partners/fireworks/tests/unit_tests/test_standard.py::TestFireworksStandard
CodSpeed Performance Gauge
0%
6.6 s6.6 s
test_init_time
libs/partners/xai/tests/unit_tests/test_chat_models_standard.py::TestXAIStandard
CodSpeed Performance Gauge
0%
3.3 s3.3 s
test_init_time
libs/partners/groq/tests/unit_tests/test_standard.py::TestGroqStandard
CodSpeed Performance Gauge
0%
1.6 s1.6 s
test_init_time_with_client
libs/partners/anthropic/tests/unit_tests/test_standard.py
CodSpeed Performance Gauge
0%
5.3 ms5.3 ms
test_init_time
libs/partners/openai/tests/unit_tests/chat_models/test_responses_standard.py::TestOpenAIResponses
CodSpeed Performance Gauge
0%
17.1 ms17.2 ms
test_init_time
libs/partners/openai/tests/unit_tests/chat_models/test_base_standard.py::TestOpenAIStandard
CodSpeed Performance Gauge
0%
17.1 ms17.1 ms

Commits

Click on a commit to change the comparison range
Base
master
2d0713c
+0.03%
core: fix ChatPromptTemplate.save() implementation - Replace NotImplementedError with working implementation - Use dumpd() for proper serialization to ensure compatibility with load() - Support both JSON and YAML formats - Add comprehensive unit tests for save functionality - Handle error cases (invalid extensions, partial variables) - Ensure directory creation when saving to nested paths Fixes #32637 Co-Authored-By: Keyu <noreply@anthropic.com>
b21a18d
3 months ago
by keyuchen21
0%
fix: resolve linting issues in test_chat.py - Remove trailing whitespace - Remove whitespace in blank lines - Use Path.open() instead of open() for file operations
6cb2c75
3 months ago
by keyuchen21
+1.3%
fix: correct test cases to properly load JSON data - Parse JSON data before passing to load() function - Fix trailing whitespace issues - Tests now correctly verify save/load functionality
ec471e8
3 months ago
by keyuchen21
+2.22%
style: apply ruff formatting to test_chat.py - Add blank line after import statement - Add trailing comma in function arguments - Consolidate single-line ChatPromptTemplate instantiations
abdb539
3 months ago
by keyuchen21
© 2025 CodSpeed Technology
Home Terms Privacy Docs