Repository navigation
feat: add publish() to PromptClient - #34
Open
techkayacodes wants to merge 3 commits into
Open
techkayacodes wants to merge 3 commits into
techkayacodes wants to merge 3 commits into
Conversation
techkayacodes
requested review from
guptadevik2003,
iamDyeus and
sujal-maheshwari2004
as code owners
November 19, 2026 22:52
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
Fixes #23
What changed
PromptClient.publish(uri, template, slots=None, message="", branch="")inpriompt_sdk/client.py, wired toPromptServiceStub.PublishPromptwithmetadata=self._mdand returningPublishPromptResponse._derive_slots(template)to extract ASCII{slot}names in first-seen, deduplicated order whenslots is Nonewhile skipping escaped{{/}}literal braces (matchingvalidate.Slotsinpriompt/proto). Explicitslots(includingslots=[]) are forwarded as-is.get(uri)and matchinglist(prefix)entries (uri.startswith(prefix)) only whenbranch in ("", "main"), keeping the cache warm for non-main branch publishes.FakeStuband added 11 unit tests intests/test_client.pycovering slot derivation, explicit slots, request/metadata forwarding, and cache invalidation across"","main", and non-main branches.publish()inREADME.md.How I tested it
pytestin a Python 3.13.18.venv(uv pip install -e . pytest) and ranpytest -v tests/test_client.py: 40 passed in 0.46s.Checklist
#23and PR linksFixes #23README.mdupdated