Version 0.7.0 #989
mandel
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
New Features
The main new features are the following and are detailed bellow:
retryattribute to any block,indexfield to introduce a loop index inrepeatblocksfwithf.signature,The
retryfieldAny block can now have a
retryfield indicating how many times a block should be executed if it encounters a runtime error. For example, a model call can be retried 5 times as follows:The loop
indexfieldA common pattern in PDL programs is to introduce a variable to index the loop iterations. For example, a loop that turns a list of strings into a list of object with a field
nameandidwould be written as follows:With the new
indexfield that introduced a variable name as loop index, this code can now be simplified as follows:New type syntax
We extended the type syntax to be able to write directly some JSON Schema as block specification. To do so, the type must contain the
typeorenumfield. For example, we can write a model block that checks that the output starts with the letter "A" as follows:To make the syntax more uniform, we are using the JSON Schema syntax for the base type. So for example, we are using
numberinstead offloatfor floating point numbers. We discuss the breaking changes below.Extract function signature
In order to make the use of PDL functions as tools by LLMs easier, we provide the ability to extract the signature of a function
fby executingf.signature. Here is an example:The output is:
An example of tool use is given in
search.pdl.Independent contexts
Blocks containing lists of blocks (
text,array,object, andlastOf) as well as loops can now be annotated withcontext: independent. It means that each sub-block is executed in an independent copy of the context. Therefore, if we execute the following program, both model calls are executed with the same input containing the messageHello:Support for granite-io processors objects
In addition to the ability to call granite-io processors using the lookup mechanism using backend and processors names, it is possible now to use granite-io processors or backends created in Python. Here is an example:
Breaking Changes
This version of PDL is coming with a large number of breaking changes:
max_iterationsintomaxIterations,Types syntax
As mentioned above, to be consistent with JSON Schema, we renamed the basic types as follows:
str->stringbool->booleanint->integerfloat->numberobj->objectlist->arrayMoreover, since we can use JSON schema, we removed the old way to put constraints on types. So for example, the following type:
must be rewritten:
Finally, the type
nullnow corresponds to a value of any type. For example, the identity function can be written as follows:Granite-io processors
The structure of the granite-io block changed. Now, the
processorfield is required and the definition of io-processor is given has sub-fields of this field. So a block that was defined as follows:is now defined like this:
Loop iteration bound
The syntax to bound the number of iterations of a loop changed. It is now
maxIteration. Here is an exampleTrace format
The format of the traces generated with the
--trace(-t) option has changed. Some internal fields likedefsitehave changed topdl__defsite. It means that traces generated with old version of the interpreter are not compatible with the new version of the UI.What's Changed
parse_dictfunction topdl_parserby @mandel in feat: add aparse_dictfunction topdl_parser#943blockby @hirokuni-kitahara in Add a new retry feature toblock#824signaturefield to closures containing the function signature by @mandel in feat: add asignaturefield to closures containing the function signature #948indexfield torepeatblocks to name loop index by @mandel in feat: addindexfield torepeatblocks to name loop index #950f.signatureby @mandel in docs: add example off.signature#955defsitefrom messages in model inputs by @mandel in fix: removedefsitefrom messages in model inputs #956max_iterationsintomaxIterationsby @mandel in feat: renamemax_iterationsintomaxIterations#961returnsintoreturn_by @mandel in refactor: rename internal fieldreturnsintoreturn_#964write_traceinpdl.pdlby @mandel in feat: exportwrite_traceinpdl.pdl#966defsiteintopdl__defsiteby @mandel in refactor: rename message fielddefsiteintopdl__defsite#965New Contributors
block#824Full Changelog: v0.6.1...v0.7.0
This discussion was created from the release Version 0.7.0.
Beta Was this translation helpful? Give feedback.
All reactions