diff --git a/JS/edgechains/examples/hydeSearch/README.md b/JS/edgechains/examples/hydeSearch/README.md new file mode 100644 index 000000000..a5bc059e7 --- /dev/null +++ b/JS/edgechains/examples/hydeSearch/README.md @@ -0,0 +1,12 @@ +## How to run hydeSearch Example:- +- Use the following command in the root directory to run this example: + + `npm i` + + `npm run build` + + `npm start` + +- You will see that server will running on port `3000`. + +- Type `localhost:3000` in your favorite browser to use this example. \ No newline at end of file diff --git a/JS/edgechains/examples/wikiExample/README.md b/JS/edgechains/examples/wikiExample/README.md new file mode 100644 index 000000000..dee8cace0 --- /dev/null +++ b/JS/edgechains/examples/wikiExample/README.md @@ -0,0 +1,15 @@ +## How to run WikiExample:- +- Use the following command in the root directory to run this example: + + `npm i` + + `npm run build` + + `npm start` + +- This example searches on Wikipedia on given input by you and then it will ask to GPT to summarize the result of Wikipedia in `30` bullet points. + +- To use this example make a `POST` request call on `http://localhost:3000/wiki-summary`. +- Request body: + + `{"input": "Your Search Topic"}` \ No newline at end of file diff --git a/JS/edgechains/examples/wikiExample/src/WikiExample.test.ts b/JS/edgechains/examples/wikiExample/src/WikiExample.test.ts new file mode 100644 index 000000000..d0ccb5f5c --- /dev/null +++ b/JS/edgechains/examples/wikiExample/src/WikiExample.test.ts @@ -0,0 +1,12 @@ +const wikiSummary = require('./WikiExample'); + + +describe("Wiki Search", () => { + it("should return a response", async () => { + expect( + ( + await wikiSummary('Barak Obama') + ) + ).toContain("Barak Obama"); + }, 30000); +}); \ No newline at end of file