Skip to main content

Easily connect large language models into your application

Project description

llmio

Easily connect large language models into your application.

pylint mypy ruff tests

Setup

pip install llmio

Example

import llmio


assistant = llmio.Assistant(
    description="""
    You are a calculator.
    Always use the provided commands to perform calculations,
    never try to calculate on your own.
    When being given a math problem, do not explain the steps,
    only execute them necessary commands and then present the answer.
    """,
    key="<openai-key>",
)


@assistant.command
def add(num1: float, num2: float) -> float:
    """
    Add two numbers
    """
    print(f"Adding {num1} + {num2}")
    return num1 + num2


@assistant.command
def multiply(num1: float, num2: float) -> float:
    """
    Multiply two numbers
    """
    print(f"Multiplying {num1} * {num2}")
    return num1 * num2


reply, _ = assistant.speak("calculate the answer of (10 + 20) * 1337")
print(reply)

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

llmio-0.0.1.tar.gz (6.1 kB view hashes)

Uploaded Source

Built Distribution

llmio-0.0.1-py3-none-any.whl (6.4 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