Skip to main content

Quickstart

This guide will walk you through the installation of the taskingai Python package and the initial setup required to use it, including the handling of the necessary TASKINGAI_API_KEY.


Installation

First, you need to install the taskingai package. This can be done easily using pip, the package installer for Python:

pip install taskingai

Setting Up Your Credentials

Before you can start using the taskingai package, you need to obtain an TASKINGAI_API_KEY. This key is essential for authentication and can typically be obtained on TaskingAI console, creating a project, and navigating to the API keys page.

To set up your API key, choose one of the following methods:

  1. (Recommended) Set it as an environment variable on your local system, and the SDK will automatically load the key.
export TASKINGAI_API_KEY=YOUR_API_KEY
  1. Specify your API key to the SDK by passing it as a parameter to the init function in your Python code:
import taskingai

taskingai.init(api_key='YOUR_API_KEY')

Sample Code

Here's a simple example of how to create a chat completion task using taskingai in your Python code:

from taskingai.inference import chat_completion, SystemMessage, UserMessage

# choose an available chat_completion model from your project
model_id = "YOUR_MODEL_ID"

# create a chat_completion task
chat_completion = chat_completion(
model_id=model_id,
messages=[
SystemMessage("You are a professional assistant."),
UserMessage("Hi"),
]
)

Next Steps

Now that you have successfully installed the taskingai package and created your first chat_completion task, you can explore more features of TaskingAI. Here are some suggestions:

  1. Explore Different Models: TaskingAI supports a variety of models for different tasks. You can explore these models and their capabilities in the Models section.

  2. Assistant: TaskingAI provides a powerful assistant feature that can help you with various tasks. Learn more about this in the Assistant section.

  3. Tools: TaskingAI offers a range of tools that can enhance your productivity. Check out the Tools section for more information.

  4. Retrievals: TaskingAI provides various retrieval methods that can help you fetch and manage your data. Explore the Retrievals section to learn more.

Remember, the key to mastering TaskingAI is practice and exploration. Don't hesitate to experiment with different models and tasks to see what you can achieve!