Skip to content

Instantly share code, notes, and snippets.

@diamondburned
Created June 14, 2023 04:51
Show Gist options
  • Save diamondburned/37c117014ecc1004b4a2b31024bcbeea to your computer and use it in GitHub Desktop.
Save diamondburned/37c117014ecc1004b4a2b31024bcbeea to your computer and use it in GitHub Desktop.

Lazer

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

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()

@lazer.use
def greet(name: str) -> str:
    return f"Hello, {name}!"

conversation = LazerConversation(lazer)
response = await conversation.talk("What is your name?")
print(response)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment