This is an Express application that provides an API for filtering user data based on user-defined JSONPath queries and a given user schema.
The application allows users to generate their custom JSONPath queries automaticallyw ith help of gpt 3 or gpt 4 by giving user query and is according to the defined schema. Users can fetch a subset of user data that matches their specified criteria.
-
Clone the repository:
git clone https://github.com/kailashw/json-evaluator.git
-
Change into the project directory:
cd json-evaluator
-
Install dependencies:
npm install
-
create a
.env
file and add your open api key.touch .env OPENAI_API_KEY="YOUR_OPEN_API_KEY"
-
Start the application:
npm start
The API will be available at http://localhost:3000
.
Endpoint for filtering user data based on user-defined JSONPath queries.
--header 'Content-Type: application/json' \
--data '{
"query": "list of hospitals details from Bangalore.",
"model": "network_hospital",
"usegpt4": true
}'
In case of invalid JSONPath queries or mismatched schemas, the API will return appropriate error responses.
- Express.js: For creating the API endpoints and handling HTTP requests.
- jsonpath-plus: For evaluating JSONPath queries.
- gpt 3.5/ 4 : For generating JSON Path based on schema and user query.
If you'd like to contribute to this project, feel free to open an issue or submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.