GIA Universidad de La HabanaUniversity of Havana

Lingo

Aplicaciones con modelos de lenguaje, en PythonLanguage model applications, in Python

Una biblioteca asíncrona y tipada para construir aplicaciones con modelos de lenguaje. Las conversaciones se escriben como flujos de Python que se pausan para preguntar y retoman donde se quedaron.An async, typed library for building language model applications. Conversations are written as Python flows that pause to ask and resume where they left off.

pip install lingo-ai

Un ejemploAn example

from lingo import Lingo

app = Lingo("Wizard", description="A helpful setup wizard")

@app.skill
async def onboarding(ctx, eng):
    name = await eng.ask(ctx, "What is your name?")
    email = await eng.ask(ctx, f"Hi {name}, what is your email?")
    if await eng.decide(ctx, f"Is {email} a valid corporate email address?"):
        await eng.reply(ctx, "Registration complete.")
    else:
        await eng.reply(ctx, "Personal emails are not allowed.")

if __name__ == "__main__":
    from lingo.cli import loop
    loop(app)

v2.2.1 · PyPI · licencia MITv2.2.1 · PyPI · MIT licence