• Resolved msitoo

    (@msitoo)


    Hey, I created embedding files for each of my posts providing more info about them, each embedding starts with the page url. I would like to append the visitor’s query with the current page url in order for the chatbot to know what post he is referring to and what info to pull up.

    Are you able to help me with this?
    How to achieve this or a different method i should use?
    (the {content} placeholder doesn’t seem to work for me, and would be less reliable anyway)

    Thanks!

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

    (@valwa)

    Hello @msitoo ,

    Regrettably, there is no straightforward solution to achieve this, as it primarily depends on the inherent characteristics of the models themselves. It would be advisable for you to attempt to prompt engineer a solution by instructing your chatbot to display the information sources. However, caution must be exercised, as this approach may inadvertently generate URLs that, in terms of their pattern, resemble the one you initially provided in your embeddings but are non existing.

    We would be pleased if you haven’t already joined us on our Discord community server, where you can contribute by sharing with other users about prompt engineering.

    Hope this helps 😊

    Thread Starter msitoo

    (@msitoo)

    Hey, thanks for your reply,

    I think I didn’t phrase my question clear enough,

    what I want to do is edit the user’s query before it is sent, so that the query is sent with the current page url, I don’t need the chatbot to reply with the current url, just that it’ll know what page the user is on, and according to that it’ll pull up the relevant answers/info from the embedding files, since every embedding file has the url it’s referring to in the top of it.

    Hope it is clear now

    Thanks!

    Plugin Support Val Meow

    (@valwa)

    Hello @msitoo ,

    I apologize for not being able to directly identify your specific requirement.

    Please consult the documentation for the following filter: mwai_ai_query($query). This function allows you to modify the query before it is sent and perform the manipulation you want.

    Here is an exemple of how to change to query :

    Regardless of the user’s input, the query message will always be “Can you count from 1 to 10?” You can retrieve the user’s prompt from the $query object and append it with your URL, in your specific use case.

    Hope this helps ! 😊

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Append query with current page URL’ is closed to new replies.