Spaces:

File size: 702 Bytes
08b9171
9d3e64b
08b9171
 
 
9d3e64b
08b9171
9d3e64b
 
 
08b9171
9d3e64b
08b9171
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import gradio as gr
from pyswip import Prolog
janus.consult("knowledge_base.pl")

def yes_man(message, history):
    prolog = Prolog()
    # % Define the person
    prolog.assertz("us_citizen(john_doe)")
    prolog.assertz("lawfully_residing(john_doe, 'U.S.', date(1996, 1, 1))")
    prolog.assertz("condition(john_doe, 'Blind')")
    if message.endswith("?"):
        return prolog.query_once("eligible_for_ssi(john_doe)")
    else:
        return "Ask me about `eligible_for_ssi`!"

gr.ChatInterface(
    yes_man,
    title="Yes Man",
    description="Ask Yes Man any question",
    examples=["Hello", "Am I cool?", "Are tomatoes vegetables?"],
    cache_examples=True,
    retry_btn=None,
).launch()