Using the Console App
Hey there
eureka_genai.services.console.cli.console_app module has been provided to facilitate easier interactions with the application. To demonstrate its capabilities, a simple CLI app is included in the sample apps, making it straightforward to ask questions and receive responses from the application. The CLI app also handles escalations if they are raised by the the graph:
The above script should be run after BentoML server has been started. Ensure that the server URL in the above code is correct.
The script will prompt user for a question. Intermediate responses and final answer will be printed to the console. In case of any escalations, the script handles prompting the user for responses. The user response is automatically formatted into a structure that Copilot application can use.
Once the request is completed, if there are no escalations, the cli_app will prompt the user for another question to ask in the same conversation context. If you wish to start a new conversation, simply run the cli_app again.
Using a React App
- installing node.js,
- installing the React App dependencies:
npm install
- setting the environment variable
REACT_APP_API_URLto the copilot app endpoint, for example:
3006 port, and
- starting the app:
npm start
Using cURL
cURL requests can also be used to make requests to the server. For example: The downside of using cURL requests is that follow-up questions in the same conversation and responses to escalations must be crafted manually. This is taken care of when using the Console App or the React App.Sample Response
Upon making the request described above, a series of responses are received as shown below, which are progressively returned to the user in real-time as they are generated within the graph:Using Postman
Ensure that a distinct correlation ID is used for each request. Failure to do so will result in the server returning an error. Use the following template request with Postman by updatingcopilot_request["context"]["request_context"]["user_input"] field:
Steps:
- Create HTTP request in Postman:
- Convert the request type to
post, add URL of the server (the endpoint should be/v2/query), and add the sample request to the request body: - Set the following headers for the request:
- Send the request. An empty responses will be received like in the following screenshot: