Help Please!

I’m trying to do a react chatbot. I’ve downloaded the latest version of the file. I went through the steps on the github but its not showing on the index.html . My application with all my corpus information is called mychatbot.js . How do i incorporate it into my index.html

Hi there, I’d like to help you figure this out. Can you please provide some more details?

  • Which repository are you using?
  • What do you mean by “downloaded the latest version of the file”?
  • When you mention mychatbot.js, is this a file you created yourself, from scratch? Is it written in React, another framework, or vanilla JS?
  • Can you describe the specific steps you took, what you expected to happen, and what actually happened?

Thanks!

Hi!
Which repository are you using? I used this repository https.://github.com/vectara/react-chatbot
What do you mean by “downloaded the latest version of the file”? I downloaded the latest version from this source code Release Release 2.0.0 · vectara/react-chatbot · GitHub

When you mention mychatbot.js, is this a file you created yourself, from scratch? Is it written in React, another framework, or vanilla JS? Yes, I created it from scratch using the code found here Vectara React-Chatbot. It is written in React

Can you describe the specific steps you took, what you expected to happen, and what actually happened?

Steps I took: 1. Downloaded the zip file 2. I opened it in VS code 3. Using the terminal I used this command “npm install @vectara/react-chatbot” 4. I then copied the react code into a new file i created called mychatbot.js (i put all my vectara corpus information in here - API, corpus and customer ID) 5. I moved the file into docs/src. 6. I then tried to incorporate the js file into the html file with the help chatgpt.

I expected to see the chatbot when i clicked on the index.html file within finder

When I clicked on it, I just see a blank page.

Hi, I read through the react-chatbot repo just now.

It seems you need to have an existing react app first, and then “install” it with npm install as per their instruction, and can use that code snippet anywhere in your react code base.

Opening the file on its own within Finder won’t work. You’d need to run your react app. One of the easier ways is to follow: Getting Started | Create React App


EDIT - confirmed that this works.

Actually I decided to switch apps to Vectara Answer. Do you know how I can add a different summarypromptname to the application? Can I just add a line of code to the .env file?

Yes you can specify summary_prompt_name with vectara-answer
See https://github.com/vectara/vectara-answer?tab=readme-ov-file#summarization-parameters-optional