-
Notifications
You must be signed in to change notification settings - Fork 537
feat: refactor system_prompt to support preset and append options #183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| options = ClaudeCodeOptions( | ||
| system_prompt={"preset": "claude_code", "append": "Be concise."}, | ||
| ) | ||
| assert options.system_prompt == { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this test actually testing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as what test_claude_code_options_with_system_prompt was testing before, I think? Not a whole lot 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to clean this up, but feel free to merge
The base branch was changed.
Replace separate system_prompt and append_system_prompt fields with a single
system_prompt field that accepts:
- string: custom system prompt
- {"preset": "claude_code"}: use default Claude Code prompt
- {"preset": "claude_code", "append": "..."}: default prompt with additions
- None/undefined: vanilla Claude with no system prompt
This matches the TypeScript SDK API design and provides more flexible
system prompt configuration.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
Update SystemPromptPreset to include required type: "preset" field alongside preset: "claude_code", matching the TypeScript SDK structure. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
cf1edb4 to
d9dbf2c
Compare
| options = ClaudeCodeOptions( | ||
| system_prompt={"preset": "claude_code", "append": "Be concise."}, | ||
| ) | ||
| assert options.system_prompt == { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to clean this up, but feel free to merge
Replace separate system_prompt and append_system_prompt fields with a single system_prompt field that accepts:
This matches the TypeScript SDK API design and provides more flexible system prompt configuration.
🤖 Generated with Claude Code