Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Support Val Meow

    (@valwa)

    Hey @gmmedia ! ??

    It should work as long as you insert your own API keys for Google services. Additionally, make sure that your chatbot context hasn’t already been used; otherwise, this step will be skipped entirely (line 7).

    Feel free to modify this code to suit your own use case. Don’t hesitate to experiment with it ??

    Thread Starter Jochen Gererstorfer

    (@gmmedia)

    Yeah, I have my API keys inside. But it’s not working.

    My prompt: Who was US president in 2023?

    Output: I’m sorry, but I am an AI language model and I cannot predict future events. As of now, I cannot provide information on who will be the US president in 2023.

    Plugin Support Val Meow

    (@valwa)

    Hey?@gmmedia?! ??

    You can verify if the filter is functioning correctly by inspecting the logs associated with the context provided to your chatbot. For a detailed demonstration, you can consult the documentation, which includes an example (with the context search filter that you can adapt) of how to carry out this process. ??

    Thread Starter Jochen Gererstorfer

    (@gmmedia)

    After adding this snippet, I found this message in my log:

    PHP message: Empty Context.
    Plugin Support Val Meow

    (@valwa)

    Just to confirm, have you inserted this code snippet after making the modifications to the context based on the Google results? If not, it might not be very effective. Please don’t hesitate to use the error logs to see the values you are retrieving initially. ??

    Thread Starter Jochen Gererstorfer

    (@gmmedia)

    Just to confirm, have you inserted this code snippet after making the modifications to the context based on the Google results?

    Sorry, i don’t know what you mean? What modifications to what context?

    There was no message at all in the log, before I have added this snippet.

    Plugin Support Val Meow

    (@valwa)

    The process is as follows:

    1. Send a request using the chatbot.
    2. Trigger the filter.
    3. Ask the Google API for a result.
    4. Modify the chatbot context based on the received result.
    5. Return the context to the chatbot.
    6. Display a response in the chatbot.

    After step 3, you can use the error_log function to ensure that you are receiving the data you are waiting for. If it’s empty, this means you didn’t receive anything, which will then not impact your context.

    If you did receive something, you can add it to the chatbot context so it can use this data when formulating a response.

    In the GitHub code, at multiple places, a null value is returned if an error is encountered. If you encounter one of these errors, your context will be null anyway. Make sure this isn’t stemming from here first also.

    Hope this helps! ??

    Thread Starter Jochen Gererstorfer

    (@gmmedia)

    I am not a programmer. I don’t know where to start.

    Maybe that’s a good feature to implement in the Pro version.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Web Search’ is closed to new replies.