-
Notifications
You must be signed in to change notification settings - Fork 1.5k
[WIP] Allow customization of all hard coded strings sent to the model #3656
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
Draft
adtyavrdhn
wants to merge
87
commits into
pydantic:main
Choose a base branch
from
adtyavrdhn:custom_model_prompt_templates
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
87 commits
Select commit
Hold shift + click to select a range
543d414
initial commit
adtyavrdhn c5686de
Removing from here for the moment
adtyavrdhn 8d9d9b9
Adding prompt_templates to public APIs in Agent.run family
adtyavrdhn 4968c1f
lint
adtyavrdhn 5d04126
docstring
adtyavrdhn b901be7
fix
adtyavrdhn ea4a9b8
remove test
adtyavrdhn 933022f
removing unused part
adtyavrdhn 6cc9b1d
fixing test
adtyavrdhn c8ebcea
format
adtyavrdhn 7eaa90b
fix
adtyavrdhn 16c4d92
Adding return kind to ToolReturnPart
adtyavrdhn edb115a
adding docstring
adtyavrdhn c1d77cf
lint
adtyavrdhn e8de0b3
Fix tests + dbos and temporal implementation of runs with prompt_temp…
adtyavrdhn 086e035
Fix tests + dbos and temporal implementation of runs with prompt_temp…
adtyavrdhn f23b841
Fix tests
adtyavrdhn 1ef50f3
merge
adtyavrdhn acc5420
useless diff
adtyavrdhn a34c391
useless diff
adtyavrdhn 5920092
lint
adtyavrdhn 4ac181f
fix prefect
adtyavrdhn ef8cc54
lint
adtyavrdhn 874d70e
fix
adtyavrdhn c4ef9ba
rolling back vercel adapter return kind
adtyavrdhn 71608af
fix test
adtyavrdhn e368175
RunContext type
adtyavrdhn e7fc0c9
RunContext type
adtyavrdhn eefe430
fix test
adtyavrdhn d2d0498
fix test
adtyavrdhn d4a0c2d
fix test + coverage
adtyavrdhn 2e8a1f2
fix lint
adtyavrdhn f8b5026
fix test
adtyavrdhn b3632b7
fix test
adtyavrdhn 9bebf4f
lint
adtyavrdhn 59981c1
renaming variable
adtyavrdhn 987293e
removing useless comment
adtyavrdhn 400b34e
Merge branch 'main' of https://github.com/pydantic/pydantic-ai into c…
adtyavrdhn 3c6ea8e
Merge branch 'main' of https://github.com/pydantic/pydantic-ai into c…
adtyavrdhn def1747
rolling back from __repr__
adtyavrdhn 74c6e23
removing mutating of message history without copy(ruining history)
adtyavrdhn 9aadb71
moving prompt_templates to a diff file
adtyavrdhn 41f4f2b
Using class default values for init of content
adtyavrdhn 8253d8f
Moving tool call denied
adtyavrdhn 09b2597
removing prompt_templates from messages.py
adtyavrdhn 0477465
lint
adtyavrdhn f5fb994
keep prompt_templates non-able, read default values off of the class …
adtyavrdhn b6415aa
fixing ToolDenied
adtyavrdhn 339ea74
Moving to a default instance instead of reading class variables
adtyavrdhn 8141c3a
fixing tooldenied overwritten by prompt_template
adtyavrdhn fee446d
fixing string in tool denied message
adtyavrdhn 45dff51
tool return kind in google
adtyavrdhn 0f729f0
Adding handling for retry prompt templates
adtyavrdhn 3570d40
Removing retry_prompt for more granular controls
adtyavrdhn 946a20b
fixing test snapshots
adtyavrdhn 454bda1
better test string
adtyavrdhn da87aa5
lint fix
adtyavrdhn 539be42
Merge branch 'main' of https://github.com/pydantic/pydantic-ai into c…
adtyavrdhn 65e1321
fix test
adtyavrdhn 1ef3ddc
lint fix
adtyavrdhn 05d031e
fixing test for retry prompt part, adding default value
adtyavrdhn 6723457
fixing test for retry prompt part, adding default value
adtyavrdhn e28a4ff
fixing test for retry prompt part, adding default value
adtyavrdhn a31598b
adding PromptOutput
adtyavrdhn 04b6f14
fixing docs
adtyavrdhn c979029
coverage for tool-denied message
adtyavrdhn 201d7f6
coverage for prompted output
adtyavrdhn cdc477d
cleanup
adtyavrdhn 81755bb
lint cleanup, skeptical about cov after refactor
adtyavrdhn 7df0a25
coverage
adtyavrdhn 165e795
adding comment
adtyavrdhn f39cc66
Adding PromptConfig, composition templates inside PromptConfig, can a…
adtyavrdhn 90bfab2
Revamping of PreparedToolSet to allow using tool_config as well
adtyavrdhn c91b2ab
merge
adtyavrdhn 12c3ad6
merge conflicts ughh
adtyavrdhn 4069ad8
fixes
adtyavrdhn 378d0e6
test fixes
adtyavrdhn 2c1fe89
docs
adtyavrdhn 2c74c5a
fixing not passing prompt_config via iter
adtyavrdhn c36ee12
better test for tool config overriding check
adtyavrdhn 2bde52a
lint cleanup
adtyavrdhn 18b2fa8
fixing order
adtyavrdhn ca0c29c
fixing doc
adtyavrdhn e5285f0
fixing doc
adtyavrdhn ecf13ce
changes for coverage
adtyavrdhn 60c1f89
changes for coverage
adtyavrdhn b0aa837
toolconfig could be none
adtyavrdhn 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
Some comments aren't visible on the classic Files Changed page.
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| # `pydantic_ai.prompt_config` | ||
|
|
||
| ::: pydantic_ai.prompt_config | ||
| options: | ||
| inherited_members: true | ||
| members: | ||
| - PromptConfig | ||
| - PromptTemplates | ||
| - ToolConfig |
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
I'm not too opposed to having this new field, but I wonder if it's strictly necessary. Since we build the
RetryPromptParts in this file, would it be an option to explicitly pass something likecontent=self.prompt_templates.generate(self.prompt_templates.tool_denied, ctx)?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.
I think we could but I like the idea of this kind in the messages, I think the visibility of the ToolReturnPart's context increases.