Model API guide
Model Guide for you to implement FLock model
Pre-requirement
Manual creation via website
Generate API Key via Acquiring the API Key
Create Model via Model Customisation
Technology Stack
TypeScript
JavaScript
API Call example
How it Works
Setup
Package installation
.env
.env
Create an
.env
file in the root directory or in your existing env file, add the followings:
Step by Step guide
Create a
flockModel.ts
Create a
async/await
functionflockModel
wrapping the API calluse
axios.post
method for requestWe will pass two parameters
question
knowledge_source_id
get the response of the call
We chose to use
try/catch
to handle any error during the call to debug the process.
Last updated