Skip to content

Instantly share code, notes, and snippets.

@patham9
Created May 20, 2025 09:06
Show Gist options
  • Save patham9/b89ef4b8d7d40782766889b833ac5495 to your computer and use it in GitHub Desktop.
Save patham9/b89ef4b8d7d40782766889b833ac5495 to your computer and use it in GitHub Desktop.
MeTTa Motto (rel extraction test)
!(import! &self motto)
!(let $x ((chat-gpt-agent "gpt-4o-mini")
(system "You are an assistant. Answer as a tuple (R a b) (no commas) where R in {near} and a,b in {human, robot, chair}")
(user "the robot is close to the chair!"))
(let $L ((py-dot ((py-dot ((py-dot $x replace) "(" "" ) replace) ")" "") split) " ")
(let ($R $a $b)
(((py-dot $L __getitem__) 0)
((py-dot $L __getitem__) 1)
((py-dot $L __getitem__) 2))
(EXTRACTED: (R = $R) (a = $a) (b = $b)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment