.. taskgen documentation master file, created by
sphinx-quickstart on Thu Sep 12 12:52:27 2024.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Installation
------------
.. code-block:: shell
pip install taskgen-ai
Sponsors
--------
Taskgen is a community-driven open-source initiative that thrives on the generous contributions of our sponsors,
enabling us to pursue innovative developments.
A huge thank you to our current sponsors:
.. raw:: html
SimbianAI
We invite organizations and individuals to join our sponsorship program.
By becoming a sponsor, you can play a pivotal role in our project's growth.
Minimal Example
---------------
At a minimum, make sure you have installed ``taskgen-ai``.
First, create a file named ``app.py`` with the following contents:
.. code-block:: python
# Set up API key and do the necessary imports
from taskgen import *
import os
# this is only if you use OpenAI as your LLM
os.environ['OPENAI_API_KEY'] = ''
def llm(system_prompt: str, user_prompt: str) -> str:
''' Here, we use OpenAI for illustration, you can change it to your own LLM '''
# ensure your LLM imports are all within this function
from openai import OpenAI
# define your own LLM here
client = OpenAI()
response = client.chat.completions.create(
model='gpt-4o-mini',
temperature = 0,
messages=[
{"role": "system", "content": system_prompt},
{"role": "user", "content": user_prompt}
]
)
return response.choices[0].message.content
# Verify that llm function is working
llm(system_prompt = 'You are a classifier to classify the sentiment of a sentence',
user_prompt = 'It is a beautiful and sunny day')
Then, run the following command:
.. code-block:: shell
python app.py
Now you can see your output in the terminal.
.. code-block:: shell
Positive
Taskgen Tutorials
==================
.. toctree::
:maxdepth: 2
tutorials/index
Usage Reference
==============
.. toctree::
:maxdepth: 2
usage/index
Taskgen Reference
==================
.. toctree::
:maxdepth: 2
taskgen/index
Community and Contributing
==========================
.. toctree::
:maxdepth: 2
about/index