Effortlessly generate LLM APIs by simply defining input and output schemas.
Project description
llmgen
Effortlessly generate LLM APIs by simply defining input and output schemas (by pydantic).
Quick Start
Example:
from llmgen import OpenAiApiFactory
factory = OpenAiApiFactory(
api_key="your api key here",
)
ai_impl = llm.get_impl_decorator()
@ai_impl
def make_joke(theme: str) -> str
"""generate a random short joke based on theme""" # just describe your api in docstring
...
# call it just like you implmented it.
res = make_joke('cat')
print(res)
# >>> "Why was the cat sitting on the computer? It wanted to keep an eye on the mouse!"
checkout /demo to see more example.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
llmgen-0.3.1.tar.gz
(5.1 kB
view hashes)
Built Distribution
llmgen-0.3.1-py3-none-any.whl
(6.2 kB
view hashes)