v0.13.0
PromptingTools v0.13.0
Added
- Added initial support for Google Gemini models for
aigenerate
(requires environment variableGOOGLE_API_KEY
and package GoogleGenAI.jl to be loaded). It must be loaded explicitly as it's not yet registered. - Added a utility to compare any two string sequences (and other iterators)
length_longest_common_subsequence
. It can be used to fuzzy match strings (eg, detecting context/sources in an AI-generated response or fuzzy matching AI response to some preset categories). See the docstring for more information?length_longest_common_subsequence
. - Rewrite of
aiclassify
to classify into an arbitrary list of categories (including with descriptions). It's a quick and easy option for "routing" and similar use cases, as it exploits the logit bias trick and outputs only 1 token. Currently, onlyOpenAISchema
is supported. See?aiclassify
for more information. - Initial support for multiple completions in one request for OpenAI-compatible API servers. Set via API kwarg
n=5
and it will request 5 completions in one request, saving the network communication time and paying the prompt tokens only once. It's useful for majority voting, diversity, or challenging agentic workflows. - Added new fields to
AIMessage
andDataMessage
types to simplify tracking in complex applications. Added fields:cost
- the cost of the query (summary per call, so count only once if you requested multiple completions in one call)log_prob
- summary log probability of the generated sequence, set API kwarglogprobs=true
to receive itrun_id
- ID of the AI API callsample_id
- ID of the sample in the batch if you requested multiple completions, otherwisesample_id==nothing
(they will have the samerun_id
)finish_reason
- the reason why the AI stopped generating the sequence (eg, "stop", "length") to provide more visibility for the user
- Support for Fireworks.ai and Together.ai providers for fast and easy access to open-source models. Requires environment variables
FIREWORKS_API_KEY
andTOGETHER_API_KEY
to be set, respectively. See the?FireworksOpenAISchema
and?TogetherOpenAISchema
for more information. - Added an
extra
field toChunkIndex
object for RAG workloads to allow additional flexibility with metadata for each document chunk (assumed to be a vector of the same length as the document chunks). - Added
airetry
function toPromptingTools.Experimental.AgentTools
to allow "guided" automatic retries of the AI calls (eg,AIGenerate
which is the "lazy" counterpart ofaigenerate
) if a given condition fails. It's useful for robustness and reliability in agentic workflows. You can provide conditions as functions and the same holds for feedback to the model as well. See a guessing game example in?airetry
.
Updated
- Updated names of endpoints and prices of Mistral.ai models as per the latest announcement and pricing. Eg,
mistral-small
->mistral-small-latest
. In addition, the latest Mistral model has been addedmistral-large-latest
(aliased asmistral-large
andmistrall
, same for the others).mistral-small-latest
andmistral-large-latest
now support function calling, which means they will work withaiextract
(You need to explicitly providetool_choice
, see the docs?aiextract
).
Removed
- Removed package extension for GoogleGenAI.jl, as it's not yet registered. Users must load the code manually for now.
Commits
Merged pull requests: