Skip to main content

Lazer

Lazer is a Python library that provides a convenient way to expose Python functions as schemas for OpenAI chat models.

For those not in the know: OpenAI - Function Calling

What it Does

Allows you to more easily inform GPT about functions in your code 😊

Warning don't RCE yourself lol

Installation

To install Lazer, simply run:

pip install lazer

Usage

Here is an example of how to use Lazer:

from lazer import Lazer, LazerConversation

lazer = Lazer()

# GPT is now made aware of your function `qux`
@lazer.use
def qux(num: int, name: str) -> str:
    """Retrieve a number and a name from the user and compute the qux of it"""
    return str(num + len(name) * 13)

conversation = LazerConversation(lazer, {"model": "gpt-3.5-turbo-0613"})
response = conversation.talk("What is the qux of 3 and steven")
print(response)
# ... 81 ...

Note You do not have to use the LazerConversation GPT frontend, you can simply use the Lazer functions .use (decorator) and .get_functions() as well as .dispatch() to build your own GPT frontend utilizing Lazer.

Note If you are using the LazerConversation frontend be sure to set an OPENAI_API_KEY in a .env file somewhere in your directory.

Demo

Go to demo/ for some demo code.

Authors:

  • @JustinStitt
  • @diamondburned

Metadata

Release files for lazer 0.1.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lazer 0.1.10
File Size Uploaded Provenance Actions
lazer-0.1.10.tar.gz 3.5 kB Without provenance Details for lazer-0.1.10.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for lazer 0.1.10
File Interpreter ABI Platform Actions
lazer-0.1.10-py3-none-any.whl Python 3 none any Details for lazer-0.1.10-py3-none-any.whl

Total release size: 7.5 kB

Release files / lazer-0.1.10.tar.gz

Download URL lazer-0.1.10.tar.gz
Size 3.5 kB
Tags Source
SHA-256 checksum
How to use checksums
69a1db07ab3306b55e8dcd21bb982e86dd22e258aaec8df71b7d4a48bc9c7b9a
BLAKE2b-256 checksum
How to use checksums
c666af8075f468d3165e6104648a4d6a67231cb703e54365ad4b988a9af5a961
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.4.2 CPython/3.11.0 Linux/5.10.16.3-microsoft-standard-WSL2

Release files / lazer-0.1.10-py3-none-any.whl

Download URL lazer-0.1.10-py3-none-any.whl
Size 4.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
37a4be8f08c8d77e95ca4e14f3b392867d24f8afb44ebb69ddb8a2862a63b3de
BLAKE2b-256 checksum
How to use checksums
7dbc44e96d00f5a4eab47b4adebdada1d58e96d98e1ed96585e722cdee72ec84
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.4.2 CPython/3.11.0 Linux/5.10.16.3-microsoft-standard-WSL2

Security for lazer 0.1.10

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page