Skip to content

Conversation

@antznette1
Copy link

@antznette1 antznette1 commented Nov 6, 2025

  • Implemented
    ChatPromptTemplate.save by delegating to BasePromptTemplate.save, matching existing patterns in other prompt templates, enabling serialization to JSON/YAML consistent with other prompt templates.

  • Aligns
    ChatPromptTemplate with FewShotPromptTemplate’s pattern.

  • Changes
    libs/core/langchain_core/prompts/chat.py

    • Implemented save(self, file_path) to call super().save(file_path).
  • Behavior

    • No breaking changes.
    • New behavior:
      ChatPromptTemplate.save("path/to/file.yaml") now works as expected.
  • Test

    • “Added a roundtrip unit test for ChatPromptTemplate.save to JSON/YAML.”
  • Issue
    Fixes ChatPromptTemplate save() not implemented #32637

@antznette1 antznette1 requested a review from eyurtsev as a code owner November 6, 2025 17:49
@github-actions github-actions bot added the core Related to the package `langchain-core` label Nov 6, 2025
@codspeed-hq
Copy link

codspeed-hq bot commented Nov 6, 2025

CodSpeed Performance Report

Merging #33852 will not alter performance

Comparing antznette1:fix/chatprompttemplate-save-32637 (c9700da) with master (d40e340)

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

Summary

✅ 13 untouched
⏩ 21 skipped1

Footnotes

  1. 21 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@antznette1 antznette1 changed the title core(prompts): implement ChatPromptTemplate.save by delegating to BasePromptTemplate core(prompts): implement ChatPromptTemplate.save Nov 6, 2025
@antznette1 antznette1 changed the title core(prompts): implement ChatPromptTemplate.save fix(core): implement ChatPromptTemplate.save by delegating to BasePromptTemplate Nov 6, 2025
@github-actions github-actions bot added the fix label Nov 6, 2025
@github-actions github-actions bot added fix and removed fix labels Nov 7, 2025
@github-actions github-actions bot added fix and removed fix labels Nov 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Related to the package `langchain-core` fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ChatPromptTemplate save() not implemented

1 participant