Quick Start Guide#
Installation#
To get started with byLLM, install the base package:
AI-Integrated Function Example#
Let's consider an example program where we attempt to categorize a person by their personality using an LLM. For simplicity we will be using names of historical figures.
Standard Implementation#
Traditional implementation of this program with a manual algorithm:
Limitations: Defining an algorithm in code for this problem is difficult, while integrating an LLM to perform the task would require manual prompt engineering, response parsing, and type conversion to be implemented by the developer.
byLLM Implementation#
The by
keyword abstraction enables functions to process inputs of any type and generate contextually appropriate outputs of the specified type:
Step 1: Configure LLM Model#
Step 2: Implement LLM-Integrated Function#
Add by llm
to enable LLM integration:
This will auto-generate a prompt for performing the task and provide an output that strictly adheres to the type Personality
.
Step 3: Execute the Application#
Set your API key and run:
For complete usage methodologies of the by
abstraction, refer to the Usage Guide for documentation on object methods, object instantiation, and multi-agent workflows.
byLLM Usage in Python#
As byLLM is a python package, it can be natively used in jac. The following code show the above example application built in native python with byLLM.
To learn more about usage of by
in python, please refer to byLLM python Interface.