• Resolved kotoedo

    (@kotoedo)


    Hi there! I have a custom Perplexity Environment for AI, and a designated chatbot that uses that environment with the Perplexity Sonar model. It doesn’t look like the custom chatbot I created respects my specific instructions that are aimed to filter the results to a specific website domain.

    In comparison, similar setup with an OpenAI out-of-the box type of AI Environment (with GPT-4.1 model), does return the expected results; i.e., the instructions given to the chatbot are taken into consideration.

    Does anyone have an idea why this is happening. Has anyone integrated an AI Engine custom chatbot with an Environment different than OpenAI or Claude.

    I’m using the free version of the plugin but I am willing to upgrade if the Pro version would resolve my problem.

    Thank you for your thoughts!

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

    (@valwa)

    Hey @kotoedo! 👋

    Out of the box, AI Engine simply sends your request (message + instructions) to the API defined in the environment used by your chatbot, waits for a response, and then displays it. The plugin does not alter the model’s behavior or modify the instructions in any way.

    So if you’re noticing unexpected behavior in the raw output of your chatbot, the issue is likely not coming from the plugin itself. I recommend testing the same request using fetch directly or a tool like Postman, just make sure you’re using the exact same parameters as in AI Engine, to see if you observe the same behavior.

    Hope this helps!

    Thread Starter kotoedo

    (@kotoedo)

    Thanks Val, yes it makes sense. I looked into the plugin’s code and it does what you say. The reason I asked the question is that the result of the same request within Perplexity Pro and within a page that uses AI Engine with Sonar are very different. I’m not sure if this is because Perplexity Pro uses a different model, or because Perplexity blocks some of the search parameters.

    Not sure if it matters (or if it’s possible), but I noticed that the Open AI chatbot settings provide a checkbox that allows to search the Web.

    Cheers

    Thread Starter kotoedo

    (@kotoedo)

    Hi again,

    It looks like if we add this filter in the call to the Perplexity API, the search results will become meaningful: “search_domain_filter”: [“sumo.or.jp”]. Not sure if this is a small feature to the Perplexity chatbots you may wish to consider.

    Cheers

    Thread Starter kotoedo

    (@kotoedo)

    Just to clarify, the previous comment for adding search_domain_filter parameter referred to both Perplexity models currently available through the plugin – Sonar and Sonar Pro.

    Thanks for considering the addition of this feature.

    Thread Starter kotoedo

    (@kotoedo)

    For those who are interested in a quick solution that would force Perplexity Sonar or Sonar-Pro models to return relevant search results limited to one (and max to ten) domains, read the help at https://docs.perplexity.ai/guides/search-domain-filters.

    Simply include search_domain_filter on line 75 of the build_body function of \ai-engine\classes\engines\perplexity.php (version 2.9.5 of the plugin) to reconstruct the API payload. Something like: $body[‘search_domain_filter’] = [‘sumo.or.jp’];

    Or, better:

    if ( !empty( $query->search_domain_filter ) ) {
    $body[‘search_domain_filter’] = $query->search_domain_filter;
    }

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

The topic ‘Perplexity chatbot with Sonar model doesn’t return expected results’ is closed to new replies.