- Step1: Install OLI via npm (npm install oli) or include the CDN script in your HTML.
- Step2: Initialize OLI with your OpenAI API key using OLI.init({ apiKey: 'YOUR_KEY' }).
- Step3: Define custom functions with OLI.defineFunction({ name, description, handler }).
- Step4: Configure the agent by registering functions and setting conversation parameters.
- Step5: Render the chat UI using OLI.renderChat('#element').
- Step6: Listen for user messages and let OLI manage calls, responses, and state automatically.