Getting Started

  1. Install Maitai SDK
  2. Implement chat completions
  3. Run your application
  4. Next Steps

Installation

Install the Maitai SDK:

pip install maitai-python

Implementation

Implementing Maitai into your application requires minimal code changes.

import maitai

messages = [
    {"role": "system", "content": "You are a helpful ordering assistant..."},
    {"role": "user", "content": "Generate a response to the customer..."},
]

response = maitai.chat.completions.create(
    messages=messages,
    model="llama3-70b-8192", # Remove this line to set model in Portal
    application="YOUR_APPLICATION", # Unique identifier for your application
    intent="CONVERSATION", # Intent of the request. Used to learn your prompt and power auto corrections.
    session_id="YOUR_SESSION_ID", # Unique ID that you generate for each session. Used to group requests.
    metadata={} ## Store custom tags here for future reference
)

Maitai requires openai version 1.30.1 or later. If you are using an older version, please upgrade.

pip install openai --upgrade

The full implementation reference can be found here.

Run Your Application

Run your application, make sure it makes at least one Chat Completion Request, then head over to https://portal.trymaitai.ai and watch Maitai learn your application in real time.

Next Steps