Tutorials
[Javascript] Pass a query with conversation history!
API Documentation
Endpoints
Tutorials
- Create an Instance with multiple Data Sources
- Dynamically Creating Custom GPT-4 Instances for Substack Blog Posts with BerriAI
- Embed your Berri App into your Website
- Classification + Multi-prompting Tutorial
- Improving Document QA w/ Custom Chunking Tutorial
- Build a slackbot to call your Berri / chatGPT endpoints
- [Javascript] Pass a query with conversation history!
- [Javascript] Pass multiple files and urls!
- Improving Results - 3 strategies w/ Berri
Additional Resources
Support & FAQs
Tutorials
[Javascript] Pass a query with conversation history!
This tutorial will guide you on how to query your BerriAI instance and pass in conversation history, in javascript.
const axios = require("axios").default;
const url = "https://api.berri.ai/query";
const params = {
user_email: "ishaan@berri.ai",
instance_id: "92232da7-4e9f-45d1-a05b-6a8abd1e9285",
query: "What is your pricing? ",
model: "gpt-3.5-turbo",
top_k: 5,
dynamic_prompt:
"You are an AI sales assistant. Answer all questions respectfully. Your company charges $500/mo. Someone from Facebook is asking you a question, they are currently on your company's pricing page. This person has visited the webiste 5 times.",
history: JSON.stringify(["hi", "HELLO", "how are you?", "i'm well"]),
};
axios
.get(url, { params })
.then((response) => {
console.log(response.data);
})
.catch((error) => {
console.error(error);
});