npc0 commited on
Commit
9d3e64b
·
verified ·
1 Parent(s): 38bc588

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -1,14 +1,15 @@
1
  import gradio as gr
2
- import janus_swi as janus
3
  janus.consult("knowledge_base.pl")
4
 
5
  def yes_man(message, history):
 
6
  # % Define the person
7
- janus.assertz("us_citizen(john_doe)")
8
- janus.assertz("lawfully_residing(john_doe, 'U.S.', date(1996, 1, 1))")
9
- janus.assertz("condition(john_doe, 'Blind')")
10
  if message.endswith("?"):
11
- return janus.query_once("eligible_for_ssi(john_doe)")
12
  else:
13
  return "Ask me about `eligible_for_ssi`!"
14
 
 
1
  import gradio as gr
2
+ from pyswip import Prolog
3
  janus.consult("knowledge_base.pl")
4
 
5
  def yes_man(message, history):
6
+ prolog = Prolog()
7
  # % Define the person
8
+ prolog.assertz("us_citizen(john_doe)")
9
+ prolog.assertz("lawfully_residing(john_doe, 'U.S.', date(1996, 1, 1))")
10
+ prolog.assertz("condition(john_doe, 'Blind')")
11
  if message.endswith("?"):
12
+ return prolog.query_once("eligible_for_ssi(john_doe)")
13
  else:
14
  return "Ask me about `eligible_for_ssi`!"
15