Releases: svilupp/PromptingTools.jl
Releases · svilupp/PromptingTools.jl
v0.20.1
PromptingTools v0.20.1
### Fixed
- Fixed
truncate_dimension
to ignore when 0 is provided (previously it would throw an error).
Commits
Merged pull requests:
v0.20.0
PromptingTools v0.20.0
Added
- Added a few new open-weights models hosted by Fireworks.ai to the registry (DBRX Instruct, Mixtral 8x22b Instruct, Qwen 72b). If you're curious about how well they work, try them!
- Added basic support for observability downstream. Created custom callback infrastructure with
initialize_tracer
andfinalize_tracer
and dedicated types areTracerMessage
andTracerMessageLike
. See?TracerMessage
for more information and the correspondingaigenerate
docstring. - Added
MultiCandidateChunks
which can hold candidates for retrieval across many indices (it's a flat structure to be similar toCandidateChunks
and easy to reason about). - JSON serialization support extended for
RAGResult
,CandidateChunks
, andMultiCandidateChunks
to increase observability of RAG systems - Added a new search refiner
TavilySearchRefiner
- it will search the web via Tavily API to try to improve on the RAG answer (see?refine!
). - Introduced a few small utilities for manipulation of nested kwargs (necessary for RAG pipelines), check out
getpropertynested
,setpropertynested
,merge_kwargs_nested
.
Updated
- [BREAKING] change to
CandidateChunks
where it's no longer allowed to be nested (ie,cc.positions
being a list of severalCandidateChunks
). This is a breaking change for theRAGTools
module only. We have introduced a newMultiCandidateChunks
types that can refer toCandidateChunks
across many indices. - Changed default model for
RAGTools.CohereReranker
to "cohere-rerank-english-v3.0".
Fixed
wrap_string
utility now correctly splits only on spaces. Previously it would split on newlines, which would remove natural formatting of prompts/messages when displayed viapprint
Commits
Merged pull requests:
- Correct hero cards (#129) (@cpfiffer)
- Update Hero section in docs (#130) (@svilupp)
- Add TraceMessage for observability (#133) (@svilupp)
- Update binary RAG pipeline (#136) (@svilupp)
Closed issues:
v0.19.0
PromptingTools v0.19.0
Added
- [BREAKING CHANGE] The default GPT-4 Turbo model alias ("gpt4t") now points to the official GPT-4 Turbo endpoint ("gpt-4-turbo").
- Adds references to
mistral-tiny
(7bn parameter model from MistralAI) to the model registry for completeness. - Adds the new GPT-4 Turbo model (
"gpt-4-turbo-2024-04-09"
), but you can simply use alias"gpt4t"
to access it.
Commits
Merged pull requests:
v0.18.0
PromptingTools v0.18.0
Added
- Adds support for binary embeddings in RAGTools (dispatch type for
find_closest
isfinder=BinaryCosineSimilarity()
), but you can also just convert the embeddings to binary yourself (always chooseMatrix{Bool}
for speed, notBitMatrix
) and use without any changes (very little performance difference at the moment). - Added Ollama embedding models to the model registry ("nomic-embed-text", "mxbai-embed-large") and versioned MistralAI models.
- Added template for data extraction with Chain-of-thought reasoning:
:ExtractDataCoTXML
. - Added data extraction support for Anthropic models (Claude 3) with
aiextract
. Try it with Claude-3 Haiku (model="claudeh"
) and Chain-of-though template (:ExtractDataCoTXML
). See?aiextract
for more information and check Anthropic's recommended practices.
Fixed
Commits
Merged pull requests:
v0.17.1
PromptingTools v0.17.1
Fixed
- Fixed a bug in
print_html
where the custom kwargs were not being passed to theHTML
constructor.
Commits
Merged pull requests:
v0.17.0
PromptingTools v0.17.0
Added
- Added support for
aigenerate
with Anthropic API. Preset model aliases areclaudeo
,claudes
, andclaudeh
, for Claude 3 Opus, Sonnet, and Haiku, respectively. - Enabled the GoogleGenAI extension since
GoogleGenAI.jl
is now officially registered. You can useaigenerate
by setting the model togemini
and providing theGOOGLE_API_KEY
environment variable. - Added utilities to make preparation of finetuning datasets easier. You can now export your conversations in JSONL format with ShareGPT formatting (eg, for Axolotl). See
?PT.save_conversations
for more information. - Added
print_html
utility for RAGTools module to print HTML-styled RAG answer annotations for web applications (eg, Genie.jl). See?PromptingTools.Experimental.RAGTools.print_html
for more information and examples.
Commits
Merged pull requests:
- Update CHANGELOG.md (#104) (@svilupp)
- A little README.md correction (#107) (@Muhammad-saad-2000)
- Update RAG Diagram (#108) (@svilupp)
- Add support for Claude API (#109) (@svilupp)
- Enable GoogleGenAI extension (#111) (@svilupp)
- Add ShareGPT template (#113) (@svilupp)
- Increase compat for GoogleGenAI v0.3 (#114) (@svilupp)
- Update html printing (#115) (@svilupp)
Closed issues:
- [FR] Add support for Claude API (#96)
v0.16.1
v0.16.0
PromptingTools v0.16.0
Added
- Added pretty-printing via
PT.pprint
that does NOT depend on Markdown and splits text to adjust to the width of the output terminal.
It is useful in notebooks to add newlines. - Added support annotations for RAGTools (see
?RAGTools.Experimental.annotate_support
for more information) to highlight which parts of the generated answer come from the provided context versus the model's knowledge base. It's useful for transparency and debugging, especially in the context of AI-generated content. You can experience it if you run the output ofairag
through pretty printing (PT.pprint
). - Added utility
distance_longest_common_subsequence
to find the normalized distance between two strings (or a vector of strings). Always returns a number between 0-1, where 0 means the strings are identical and 1 means they are completely different. It's useful for comparing the similarity between the context provided to the model and the generated answer. - Added a new documentation section "Extra Tools" to highlight key functionality in various modules, eg, the available text utilities, which were previously hard to discover.
- Extended documentation FAQ with tips on tackling rate limits and other common issues with OpenAI API.
- Extended documentation with all available prompt templates. See section "Prompt Templates" in the documentation.
- Added new RAG interface underneath
airag
inPromptingTools.RAGTools.Experimental
. Each step now has a dedicated function and a type that can be customized to achieve arbitrary logic (via defining methods for your own types).airag
is split into two main steps:retrieve
andgenerate!
. You can use them separately or together. See?airag
for more information.
Updated
- Renamed
split_by_length
text splitter torecursive_splitter
to make it easier to discover and understand its purpose.split_by_length
is still available as a deprecated alias.
Fixed
- Fixed a bug where
LOCAL_SERVER
default value was not getting picked up. Now, it defaults tohttp://localhost:10897/v1
if not set in the preferences, which is the address of the server started by Llama.jl. - Fixed a bug in multi-line code annotation, which was assigning too optimistic scores to the generated code. Now the score of the chunk is the length-weighted score of the "top" source chunk divided by the full length of score tokens (much more robust and demanding).
Commits
Merged pull requests:
- Update docs to Vitepress (#88) (@svilupp)
- Add support annotations (#90) (@svilupp)
- Update Documentation (#91) (@svilupp)
- Add Prompt Templates to the Docs (#92) (@svilupp)
- fix typo on set_preferences! examples, fixes #93 (#94) (@ceferisbarov)
- Rag Interface Rewrite (#95) (@svilupp)
Closed issues:
- Wrong syntax in README (#93)
v0.15.0
PromptingTools v0.15.0
Added
- Added experimental support for image generation with OpenAI DALL-E models, eg,
msg = aiimage("A white cat on a car")
. See ?aiimage for more details.
Commits
Merged pull requests:
v0.14.0
PromptingTools v0.14.0
Added
- Added a new documentation section "How it works" to explain the inner workings of the package. It's a work in progress, but it should give you a good idea of what's happening under the hood.
- Improved template loading, so if you load your custom templates once with
load_templates!("my/template/folder)
, it will remember your folder for all future re-loads. - Added convenience function
create_template
to create templates on the fly without having to deal withPT.UserMessage
etc. If you specify the keyword argumentload_as = "MyName"
, the template will be immediately loaded to the template registry. See?create_template
for more information and examples.
Commits
Merged pull requests: