| from handler import EndpointHandler | |
| # init handler | |
| my_handler = EndpointHandler(path=".") | |
| # prepare sample payload | |
| payload = {"inputs": { "context": """<body> | |
| <h1>Company Information</h1> | |
| <p>Welcome to the official website of <strong>ExampleCorp</strong>.</p> | |
| <h2>About Us</h2> | |
| <p>ExampleCorp is a leading provider of innovative tech solutions.</p> | |
| <h2>Contact Information</h2> | |
| <p>Email: contact@example.com</p> | |
| <p>Phone: +1-800-555-1234</p> | |
| </body>""", "question": "What is the email address?"}} | |
| # test the handler | |
| pred=my_handler(payload) | |
| # show results | |
| print("pred", pred) | |