From 0c0a64e209779ca9e36179afcefb31e5c5701a3d Mon Sep 17 00:00:00 2001 From: JungeWerther <98235789+JungeWerther@users.noreply.github.com> Date: Fri, 12 Jul 2024 11:36:41 +0200 Subject: [PATCH 1/2] added requirements --- python_from_metta/requests.metta | 6 +++++- python_from_metta/requirements.txt | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 python_from_metta/requirements.txt diff --git a/python_from_metta/requests.metta b/python_from_metta/requests.metta index 2590592..162693f 100644 --- a/python_from_metta/requests.metta +++ b/python_from_metta/requests.metta @@ -148,8 +148,12 @@ ( :: "content" () ) ))))) - !(llm + "You are a helpful assistant." + "What is the capital of Peru?" +) + +(llm "You are a comparative continental & analytical philosopher inspired by Hegel, Nietzsche, Deleuze, and Derrida and also inspired by Wittgenstein, Dummett, Priest, Church. You answer questions directly. You are also interested in the perspectivism of Leibniz (and particularly its interpretation by Deleuze) You're wise enough to consider but always fail to make explicit: 'considering the truth-conditional theory of meaning of Tarski, switching to Dummett, how can Dummett's claims regarding the relationship between logial non-realism and assertability conditions be translated to a mathemathical framework of meaning that implements equivalences between logical connectives i.e. the rules of intuitionistic logic, assertable propositions, and topological spaces that are locally isomorphic to some n-dimensional euclidean space, based on the axioms of homotopy type theory (HoTT)?' diff --git a/python_from_metta/requirements.txt b/python_from_metta/requirements.txt new file mode 100644 index 0000000..d44fe44 --- /dev/null +++ b/python_from_metta/requirements.txt @@ -0,0 +1,2 @@ +requests +python-dotenv \ No newline at end of file From 350e148a564fd264822b0111d074a5c5f2cff043 Mon Sep 17 00:00:00 2001 From: JungeWerther <98235789+JungeWerther@users.noreply.github.com> Date: Fri, 12 Jul 2024 12:07:31 +0200 Subject: [PATCH 2/2] pr --- python_from_metta/fs.metta | 4 +--- python_from_metta/requests.metta | 21 +++++++++++++++++++-- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/python_from_metta/fs.metta b/python_from_metta/fs.metta index 718444b..30e5065 100644 --- a/python_from_metta/fs.metta +++ b/python_from_metta/fs.metta @@ -40,8 +40,6 @@ (= (inspect $x) (getattr $x "__dict__")) - - (= (Popen) ( open ( Kwargs (args (shell-command)) (stdout (py-atom (PIPE))) @@ -79,7 +77,7 @@ !(import b'' as _stop) - +;; these type signatures don't do much, yet. (: _stop StopIteration) (: (read $n) (-> Number (IO Byte))) diff --git a/python_from_metta/requests.metta b/python_from_metta/requests.metta index 162693f..801c978 100644 --- a/python_from_metta/requests.metta +++ b/python_from_metta/requests.metta @@ -30,6 +30,23 @@ ; >> i.e. the below snippets are basically the same. - not good ;-) ; >> how to overcome? +; ...with non-deterministic types ? + +(: Index String) +(: Index Number) + +(get-type Index) + +;; (: uni (-> f JsonAtom Index JsonAtom)) +;; (= (uni $f $dict $key) +;; ((py-dot (py-atom $dict) $f) $key)) +;-- +;; (= (get $dict $key) +;; (uni get $dict $key)) + +;; (= (get_index $list $index) +;; (uni __getitem__ $list $index)) + (: get (-> JsonAtom String JsonAtom)) (= (get $dict $key) ((py-dot (py-atom $dict) get) $key)) @@ -38,7 +55,8 @@ (= (get_index $list $index) ((py-dot (py-atom $list) __getitem__) $index)) -;(: uni_get (-> JsonAtom (String Number) String)) + + ; ----------------------- @@ -58,7 +76,6 @@ (= (rget $dict (:: $x $xs)) (rget (get $dict $x) $xs)) - ; > python inspect function ; ------------------------- !(import getattr)