Skip to content

khianvictorycalderon/NLP-Frontend-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NLP Frontend API

by Khian Victory D. Calderon

Preview

Usage (For vanilla HTML)

  1. In your javascript file:
    fetch("https://khianvictorycalderon.github.io/NLP-Frontend-API/nlp.js")
        .then(data => data.json)
        .then(data => {
            eval(data);
        });

Usage (For React Typescript)

  1. Create src/global.d.ts:
    export {}; // ensures this file is treated as a module
    
    declare global {
        interface Window {
            API: {
                generateResponse: (input: string[]) => string;
            };
        }
    }
  2. Then in your App.tsx (Using axios):
    const res = await axios.get("https://khianvictorycalderon.github.io/NLP-Frontend-API/nlp.js");
    eval(res.data);
    
    const conversation = window.API.getResponse(["Hi there"]);

Releases

No releases published

Packages

 
 
 

Contributors