Help with the Botpress tutorial "Areplica of Sydne...
# 🤝help
t
Hello 👋, I'm new to the world of chatbots, never touched a line of code and started i just discovered about using Botpress 2 days ago. I followed this demonstration

https://www.youtube.com/watch?v=S5t-e81UF-g&t=392s&ab_channel=Botpress

about “the replica of Sydney the bing chat” and i’m at 33:44: I'm trying to connect my bot to the Bing API, but I'm running into issues and used a third-party service to access the Bing API, but I'm receiving an error when I try to run my code. Here's the code I used and the error I'm receiving:
Copy code
const { data: results } = await axios.post(
  '<https://google.serper.dev/search>',
  { q: event.preview },
  { headers: { 'X-API-KEY': 'c97772f5d170f2bf8be9b23f0e2b6f54a8275e47' } }
)

workflow.searchResults = ""
for (let organic of results.organic) {
  workflow.searchResults += organic.snippet
}

workflow.searchResults = workflow.searchResults.slice(0, 4000)
Error:
Copy code
Logs (3 items - 1 error)
Execute code "make a query to bing with event.preview as the question"
Error executing action "inline-ins-f415fa35c2.js" in flow:Main:node:Standard1 [SyntaxError, Invalid or unexpected token]
Entering workflow (flow:Error) [node:Entry] from (flow:Main) [node:Standard1]
Also I'm a bit confused because in the video he talks about connecting our bot with Bing's API, but the service he used thats is I assume “Google serper”, except I don't get the impression that it is the service they offer anyway, but anyway it's not a big deal because in the demonstration it works and for me it doesn't, so I still need to find a solution because even if it's not the official Bing API it's connected to, well, the Google query still works anyway, so any help would be appreciated. Thanks 😄
a
Hi @tall-sugar-91642 welcome to the world of chatbots! A quick security note: API keys are like passwords- you shouldn't share them on public forums 😅 You should deactivate that API key ad make a new one ASAP. For the search, a much easier way is to make a new knowledge base and select the "Seach the whole internet" as a source. See screenshots for the steps!
t
Yeah I deactivated before sending the message don’t worry 😅 thanks and I’m going to try what you just sent me asap
And does it means that the demonstration is obsolete and the feature you sent me wasn't available at the time of the recording or is it just another way of providing the same result ?
a
yep, that demo came before we rolled out knowlege bases. While you can still adopt the same approach that was taken in the demo, it's much easier now to use knowledge bases.
t
Yeah now it's super easy to use, great job guys can't wait to play with the bots
Hi, is it normal that the "Enable Knowledge Answering" is reversed, as you can see from the clip that i uploaded Compare to this demo at around 13:25

https://www.youtube.com/watch?v=loZzQkA6u_8&ab_channel=Botpress

a
Yes, knowledge is searched in the start node by default. You can turn this off by going into "Agents," clicking "Knowledge Agent," and then disabling "Answer on Start Node"
5 Views