Skip to content
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

feat(prompts): add prompts as first class citizens #145

Merged
merged 14 commits into from
Jul 12, 2024

Conversation

timonv
Copy link
Member

@timonv timonv commented Jul 11, 2024

Adds Prompts as first class citizens. This is a breaking change as SimplePrompt with just a a &str is no longer allowed.

This introduces Prompt and PromptTemplate. A template uses jinja style templating build on tera. Templates can be converted into prompts, and have context added. A prompt is then send to something that prompts, i.e. openai or bedrock.

Additional prompts can be added either compiled or as one-offs. Additionally, it's perfectly fine to prompt with just a string as well, just provide an .into().

For future development, some LLMs really benefit from system prompts, which this would enable. For the query pipeline we can also take a much more structured approach with composed templates and conditionals.

@timonv timonv changed the title feat: add prompts as first class citizens feat(prompts): add prompts as first class citizens Jul 12, 2024
@timonv timonv marked this pull request as ready for review July 12, 2024 13:00
@timonv timonv merged commit 70ea268 into master Jul 12, 2024
7 checks passed
@timonv timonv deleted the feat/prompts-first-class branch July 12, 2024 16:47
This was referenced Jul 12, 2024
timonv added a commit that referenced this pull request Jul 12, 2024
## 🤖 New release
* `swiftide`: 0.5.0 -> 0.6.0

<details><summary><i><b>Changelog</b></i></summary><p>

<blockquote>

## [0.6.0](https://github.com/bosun-ai/swiftide/releases/tag/0.6.0) -
2024-07-12

### Features

-
[70ea268](70ea268)
*(prompts)* Add prompts as first class citizens
([#145](#145))

-
[699cfe4](699cfe4)
*(uncategorized)* Embed modes and named vectors
([#123](#123))

### Bug Fixes

-
[9334934](9334934)
*(chunkcode)* Use correct chunksizes
([#122](#122))

-
[7357fea](7357fea)
*(deps)* Update rust crate spider to v1.98.6
([#119](#119))

-
[353cd9e](353cd9e)
*(qdrant)* Upgrade and better defaults
([#118](#118))

-
[b53636c](b53636c)
*(uncategorized)* Inability to store only some of `EmbeddedField`s
([#139](#139))

### Documentation

-
[5691ac9](5691ac9)
*(readme)* Add preproduction warning

-
[4c40e27](4c40e27)
*(readme)* Add back coverage badge

-
[3e447fe](3e447fe)
*(readme)* Link to CONTRIBUTING
([#114](#114))

-
[37af322](37af322)
*(rustdocs)* Rewrite the initial landing page
([#149](#149))

-
[7686c2d](7686c2d)
*(uncategorized)* Templated prompts are now a major feature

### Performance

-
[ea8f823](ea8f823)
*(uncategorized)* Improve local build performance and crate cleanup
([#148](#148))

### Miscellaneous Tasks

-
[364e13d](364e13d)
*(swiftide)* Loosen up dependencies
([#140](#140))

-
[d2a9ea1](d2a9ea1)
*(uncategorized)* Enable clippy pedantic
([#132](#132))

-
[51c114c](51c114c)
*(uncategorized)* Various tooling & community improvements
([#131](#131))

-
[84dd65d](84dd65d)
*(uncategorized)* Rename all mentions of ingest to index
([#130](#130))


**Full Changelog**:
0.1.0...0.6.0


<!-- generated by git-cliff -->
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/MarcoIeni/release-plz/).

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Timon Vonk <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant