A functional programming interface for building AI systems
Project description
λprompt - Functional programming interface for building AI systems
pip install lambdaprompt
Try it out in colab link | [link2] (l2)
lambdaprompt is a python package, ...
- minimalistic API
- functional helpers
- create complex and emergent behavior
For using openAI, set up API keys as environment variables or set after importing
OPENAI_API_KEY=...
import lambdaprompt; lambdaprompt.setup(openai_api_key=’...’)
How to
Map
prompt.map([“yes”, “no”])
Reduce
prompt.reduce(...)
Composition
…
For Pandas Users (Useful for data processing)
df.prompt.apply(...)
Making Prompts
LLM JINJA templates
prompt = LLM(“goal of prompt”, “””
{{ template }}
…
“””
Decorator
@promptify
def excalamation(arg):
return arg+"!"*10
Advanced usage
Pre-and-post call hooks (tracing and logging) [see example]
lambdaprompt.register(pre=print, post=print)
Design Patterns
- Response Optimization
- Summarization and Aggregations
- Meta-Prompting
Contributions are welcome
To add: An issue template
To add: A pull request template
TODO: Check all dependent prompts in the library via signature-check are correct This ensures that when someone changes an upstream prompt, they must at least see all dependent prompts that they should update.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
lambdaprompt-0.0.1.tar.gz
(5.0 kB
view hashes)
Built Distribution
Close
Hashes for lambdaprompt-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | de49b41db3de3fa3691e99af1d43d3fa8f169d38e86a7f30124a05add5acff2c |
|
MD5 | 38bab70bbdac325e4238332bdb26f5cb |
|
BLAKE2b-256 | 6b7e683c848cfdd374dd91e8fc709cd2d1931479cbf1154dd910a94d6d4e89f1 |