byLLM as a Library for Python#
The byLLM module is a Jaclang plugin that provides AI functionality. Since Jaclang supersets Python, byLLM can be integrated into Python applications. This guide demonstrates how to use byLLM in Python.
byLLM is a Python package that needs to be installed using:
Importing byLLM in Python#
byLLM functionality is accessed by importing the byllm
module and using the by
decorator on functions.
NOTE:
Here byLLM can only use primitive types and dataclasses as input and output types. We are working to resolve this limitation.
Model Hyper-parameters#
In Jaclang, hyper-parameters are set by passing them to the LLM model:
The temperature
hyper-parameter controls the randomness of the output. Lower values produce more deterministic output, while higher values produce more random output.
In Python, hyper-parameters are passed similarly:
Using Python Functions as Tools#
Python functions can be used as tools in byLLM. Functions defined in Python are callable by the LLM to perform specific tasks: