-
Notifications
You must be signed in to change notification settings - Fork 80
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
prompty vnext with agentic support #216
Open
sethjuarez
wants to merge
62
commits into
main
Choose a base branch
from
vnext
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.
Open
Conversation
This file contains 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
Signed-off-by: Seth Juarez <me@sethjuarez.com>
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.
The following has been added + corrected in the current Python runtime:
Merge of sample section into inputs
The following treats these inputs as samples
and expands it into this at runtime:
This makes the sample section effectively deprecated. If this section is used, the runtime will produce warnings but
still adhere to the input type checking described below.
Input Type Checking
Added advanced type checking for inputs. Sample items are no longer treated as defaults and execution will result
in a runtime error if input values without defaults are not provided. This caused a number of weird bugs with items not
passed into the runtime and using the sample value instead.
Additional Role Params
Currently, prompty role boundaries only could generate
{ "role": "value", content: "value" }
items as part of the messagesarray. This proves to be a bit limiting so the following addition was added to the prompty template spec:
This has the effect of producing:
In general, any arbitrary key/value pair can be added to the role definition and will be included in the output when
parsed. It is up to the execution invoker, however, to determine what to do with those values. In the current
Azure OpenAI Invoker, it discards anything other than
role
,content
, andname
(with one exception - more onthat below)
Strict Mode
The template section has been updated to include a
strict
mode and thetype
has been changed toformat
:Under strict mode, only role sections included in the prompt are valid during execution. This means that one cannot
pass in their own
system:
oruser:
messages as part of any input. This is set toFalse
but setting it toTrue
will throwexceptions if an attempt to inject user created roles is made.
The way the runtime protects against this is by injecting a
nonce
that is auto-generated per execution into each messageboundary before the template is rendered. This allows the executor to check for the existence of the valid
nonce
afterthe render process has occurred. In general, this mechanism is used by invoker providers to ensure consistency and avoid
message injection attacks.
strict
mode will be made the default execution mode sometime soon.Tools Section
As tools become more common place, the prompty runtime will now accept a tools section both in the prompty
frontmatter as well as in the prompt section. This allows for the creation of static and dynamic tools available
to the runtime should a provider with to use it. In the next several weeks, the runtime will use default function tools
the same way function calling is currently supported in the parameters section. More on this soon.
Inline Images
Added full path checking for inline images per request