AJAX Support from Agent Output #382
markcofano
started this conversation in
General
Replies: 1 comment
-
|
It would be most helpful to see examples of Neuron AI that are not invoked from the Unix CLI. Are there any plans to present documentation if the output of the final application is a website / progressive web app? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The output of our proprietary PHP platform results in a single html-formatted page which is sent to the browser. Many includes assemble a completed page from components. Buffering of component output is used to present the final page at the target URL. A click on links within this page either...
a) redirect users to another single page, rendered in the same way at a new URL or
b) call a php file using AJAX. This file prepares content. Javascript inserts that content at a target DOMID in the current page.
We now understand the basics of Neuron AI agents. We would like to have the output of the Agent work within the structure (b) defined above. The Neuron Agent output would be inserted into the current page at position defined by a specific DOMID.
Example of what we are wanting...
-- A form field in the current page accepts input from the user.
-- A submit button sends the input to a file that invokes an Neuron Agent
-- The Neuron agent accepts the user input and communicates with one or more LLMs
-- The output of the Agent ($strResponse->getContent()) is inserted into the current page below the user's input
When we attempt to do this using the sample agents provided in the tutorial, the output of $strResponse->getContent() replaces the entire (current) page. We have tried various methods to cause the output to be incorporated into the current page. We assume this is by design. Also some level of caching is in place as new input from the user is not always accepted by the Neuron Agent.
We have tried a couple of work-arounds:
#1 Storing the Neuron Agent output into a variable...
#2 Using PHP Buffering in the page invoking the Neuron Agent
Neither of these methods produces the desired result. The entire page invoking the call to the Neuron Agent is replaced with the output of $strResponse->getContent().
Our final goal is Progressive Web App that uses Neuron AI to provide AI resources to the App.
Please let us know what we are missing. Thank you.
Beta Was this translation helpful? Give feedback.
All reactions