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
RAG chat with a conversation history.
Authorizations
x-api-keystringRequired
Body
questionstringRequired
chat_historyany ofOptionalDefault:
[]or
knowledge_source_idstringRequired
Responses
200
Successful Response
application/json
422
Validation Error
application/json
post
/chat/conversational_rag_chatHow it Works
Setup
Package installation
.env
.envCreate an
.envfile in the root directory or in your existing env file, add the followings:
Step by Step guide
Create a
flockModel.tsCreate a
async/awaitfunctionflockModelwrapping the API calluse
axios.postmethod for requestWe will pass two parameters
questionknowledge_source_id
get the response of the call
We chose to use
try/catchto handle any error during the call to debug the process.
Last updated
Was this helpful?