Skip to main content

A functional programming interface for building AI systems

Project description

λprompt - Functional programming interface for building AI systems

lambdaprompt is a python package, ...

Getting started

Install pip install lambdaprompt

For using openAI, set up API keys as environment variables or set after importing OPENAI_API_KEY=... import lambdaprompt; lambdaprompt.setup(openai_api_key=’...’)

Try it out in colab [link]

Library demos and examples

[[ See Here ]]

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

Contributions are welcome

Contributing

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


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.0.tar.gz (2.6 kB view hashes)

Uploaded Source

Built Distribution

lambdaprompt-0.0.0-py3-none-any.whl (3.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page