Model API guide

Model Guide for you to implement FLock model

Pre-requirement

Manual creation via website

Technology Stack

  • TypeScript

  • JavaScript

API Call example

Conversational Rag Chat

post

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
post
/chat/conversational_rag_chat

How it Works

Setup

Package installation

.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 function flockModel wrapping the API call

    • use axios.post method for request

    • We 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

Was this helpful?