Last active
November 17, 2023 23:43
-
-
Save eblume/da653cd3028f57177404587bc1d76fe5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import getpass | |
import typer | |
from typerassistant import TyperAssistant | |
from openai import OpenAI | |
app = typer.Typer() | |
client = OpenAI() # Assuming OPENAI_API_KEY is set in the environment | |
@app.command() | |
def say_hello(name: str): | |
print(f"Hello, {name}!") | |
@app.command() | |
def get_current_user(): | |
print(getpass.getuser()) | |
TyperAssistant(app, client=client) | |
app() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment