-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Support contextually overriding agent instructions #2926
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
66b5270
Support overriding agent instructions
mwildehahn e5c9c0f
Review feedback
mwildehahn 4c5defd
Fix type error
mwildehahn 57d1b75
Rename test file
mwildehahn faf126e
Fix lint errors
mwildehahn 753ce5d
Formatting tweaks
mwildehahn 6f54670
Add coverage
mwildehahn 9a30a71
Fix lint errors
mwildehahn 682d232
Fix lint error
mwildehahn d12245c
Add helper function
mwildehahn 3fc144f
Change variable name
mwildehahn e42630e
Add more tests
mwildehahn 57d1523
Address review comments
mwildehahn 122c040
Lint
mwildehahn 37a48d8
Fix instruction typing
mwildehahn 2b7459f
Fix typing
mwildehahn 7aef1ab
Ignore coverage
mwildehahn 1fd3627
...cool cool
mwildehahn 02add1c
Review feedback
mwildehahn cfd880a
Fix formatting
mwildehahn f54f0e2
Update comment
mwildehahn ce4205b
Update docstrings to be consistent
mwildehahn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
...cool cool
- Loading branch information
commit 1fd362764345eb2e60e5875668eb0e53c068c46c
There are no files selected for viewing
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
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.
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.
Sorry for continuing to come up with more ways to refactor this, but what do you think about making
self._instructions
andself._override_instructions
always hold alist[str | _system_prompt.SystemPromptFunc[AgentDepsT]]
, and change__init__
andoverride
to storelist(instructions)
so that any single items automatically get wrapped in a list, and this method and the one above can be much simpler?