Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New api #12

Open
wants to merge 135 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
135 commits
Select commit Hold shift + click to select a range
d3cfe3d
Update: a much better reasoning capability than GPT can provide
patham9 Apr 21, 2023
a2fd033
Update: use ONA for reasoning properly
patham9 Apr 22, 2023
1b097d8
Update: allow to use Narsese if Narsese input comes, connects to sens…
patham9 Apr 22, 2023
b53b10a
Update: minor adjustments to support NAL file contents being streamed…
patham9 Apr 23, 2023
53ff5eb
Update: function is already declared, removal of redundancy
patham9 Apr 23, 2023
82352aa
Update: other commands should be at the end
patham9 Apr 23, 2023
f3c4c1c
Update: allow to print answers to questions in Narsese
patham9 Apr 23, 2023
309dd75
Update: hasproperty relation explicit in memory view
patham9 Apr 23, 2023
4e3d4b7
Update: check improved
patham9 Apr 23, 2023
2a3ea56
Update: word count should be the same as in first case
patham9 Apr 23, 2023
9f82769
Update: ONA version also persistency
patham9 Apr 24, 2023
fd884e9
Update: allow querying LTM for Q&A purposes
patham9 Apr 24, 2023
f71159b
Update: allow querying LTM for Q&A purposes
patham9 Apr 24, 2023
2bf8d4d
Update: querying from Narsese also possible as in persistentNAR.py
patham9 Apr 24, 2023
45fefff
Update: index-based question priming for ONA
patham9 Apr 24, 2023
7250f0b
Update: unnecessary field removal
patham9 Apr 24, 2023
f465ace
Update: addition of negation protection as GPT often leads to output …
patham9 Apr 24, 2023
f99f53d
Update: negation does not need to be prevented like that, better opti…
patham9 Apr 24, 2023
c637a50
Update: time handling supported
patham9 Apr 24, 2023
f4554a8
Update: input sanity check needs to be fully present else unrelated n…
patham9 Apr 24, 2023
4e15103
Update: time handling disabled so far until it is mature
patham9 Apr 25, 2023
68212aa
Update: keep time synched with ONA properly, and allow event handling…
patham9 Apr 25, 2023
546f48b
Update: some further improvements for time handling
patham9 Apr 25, 2023
1b34e2a
Update: fix for time conversion
patham9 Apr 25, 2023
c649e8c
Update: recursion issue fix
patham9 Apr 25, 2023
bab0452
Update: additional checks for saner inputs
patham9 Apr 25, 2023
b29278a
first example of using language in sensorimotor
patham9 Apr 25, 2023
21e72c3
Update: explain by ONA learned causal hypotheses
patham9 Apr 25, 2023
d82244b
Update: better view on procedural hypothesis involving products
patham9 Apr 25, 2023
ce1778b
Update: better view on procedural hypothesis involving products
patham9 Apr 25, 2023
e13b31b
Update: this line should be a comment
patham9 Apr 25, 2023
4464006
Update: no product compounds in the GPT memory view of ONA memory for…
patham9 Apr 26, 2023
5fc2233
Update: no space in argument restriction removal in command parsing
patham9 Apr 26, 2023
efc5c1f
Update: proper compound noun lemmatization
patham9 Apr 26, 2023
0fd20a5
Update: further relations expressing inheritance
patham9 Apr 26, 2023
fa450c6
Update: remove encode appendix
patham9 Apr 26, 2023
b9543ae
Update input check at wrong place fixed
patham9 Apr 26, 2023
1a2ca5f
Update README.md
patham9 Apr 27, 2023
fbfdfcf
Update README.md
patham9 Apr 27, 2023
921ad1f
Update README.md
patham9 Apr 27, 2023
195bc07
Update README.md
patham9 Apr 27, 2023
69ba050
Update README.md
patham9 Apr 27, 2023
98e1501
Update README.md
patham9 Apr 27, 2023
dfae191
Update README.md
patham9 Apr 27, 2023
616f903
Update README.md
patham9 Apr 27, 2023
4fcaf23
Update README.md
patham9 Apr 27, 2023
00926b3
Update README.md
patham9 Apr 27, 2023
7616aff
Update README.md
patham9 Apr 27, 2023
3d6787c
Update README.md
patham9 Apr 27, 2023
9702c37
Update README.md
patham9 Apr 27, 2023
3693c47
Update: minor timing fix for input when information is queried plus s…
patham9 Apr 27, 2023
ca5ded0
Update README.md
patham9 Apr 28, 2023
9064b4f
Update: test suite, TODO cleanup and put into gptONA
patham9 Apr 28, 2023
7aa30ca
Update: restriction removal, 40% score now
patham9 Apr 28, 2023
43d30ca
Update: restriction removal, 40% score now
patham9 Apr 28, 2023
1e5f8b7
Update: Sentence (relation) embeddings
patham9 Apr 29, 2023
4ad89a4
Update: sentence embedding support, 52%!
patham9 Apr 29, 2023
9ecc90f
Merge pull request #5 from patham9/Evaluation
patham9 Apr 29, 2023
bf4240f
Command updates and cleanups
patham9 Apr 29, 2023
b7d3736
Command updates and cleanups
patham9 Apr 29, 2023
0b5e1e7
Command updates and cleanups
patham9 Apr 29, 2023
d37355e
Update: minor improvements regarding memory updating and querying
patham9 Apr 29, 2023
6dd27d4
Update: stuff moved into Evaluation folder, TODO update paths
patham9 Apr 29, 2023
67f6e5f
Update folder cleanup and making it easier to start the system at fir…
patham9 Apr 29, 2023
e8c1050
Update: further improvement, prompting recent items was good
patham9 Apr 29, 2023
ccde72d
Update: kitchen Q&A example added
patham9 Apr 29, 2023
248c174
Update: script complete
patham9 Apr 29, 2023
842f0b2
Update: ability to compare with previous runs pointing out difference…
patham9 Apr 29, 2023
342875f
Update: answer-based priming and LTM retrieval to ONA memory improvement
patham9 Apr 30, 2023
7b272fd
Update: removal of unneeded truth function
patham9 Apr 30, 2023
939a78e
Update: use existing embedding if a memory item of same term already …
patham9 May 1, 2023
13aaee4
Update: stamp import working
patham9 May 2, 2023
665071e
Update: removal of impossible code paths in query, since events can't…
patham9 May 2, 2023
f270dad
Update: update to newest ONA
patham9 May 2, 2023
ec309d2
Update README.md
patham9 May 3, 2023
65326f5
Update: proper update of lastUsed and useCount after eternalization
patham9 May 3, 2023
c7caf4f
Update: proper update of lastUsed and useCount after eternalization
patham9 May 3, 2023
063d6dc
Update: proper update of lastUsed and useCount after eternalization
patham9 May 3, 2023
38a5c42
Update: allow commands to be used without =question? extension as in …
patham9 May 3, 2023
91da08c
Update: removal of unnecessary TimeHandling parameter in prompt gener…
patham9 May 3, 2023
150cb4f
Update: reasoning examples
patham9 May 5, 2023
7b1afb8
Update: further examples:
patham9 May 6, 2023
2be40eb
Update: sensorimotor grounding functionality
patham9 May 9, 2023
bec161b
Update: sensorimotor grounding functionality
patham9 May 9, 2023
ca47336
Update: sensorimotor grounding functionality
patham9 May 9, 2023
4020e69
Update: better prompt for IncludeGPTKnowledge=true flag
patham9 May 9, 2023
3d80c97
Update: better prompt for IncludeGPTKnowledge=true flag
patham9 May 9, 2023
9de220e
Update: better prompt for IncludeGPTKnowledge=true flag
patham9 May 9, 2023
e4c8687
Update README.md
patham9 May 11, 2023
5ec2ef8
Update: new truth representation for prompt which is less confusing f…
patham9 May 16, 2023
925a96a
Update: prompt representation improvement
patham9 May 16, 2023
02d356f
Update: reset command added
patham9 May 21, 2023
643b502
Update: babI16 scripts
patham9 May 21, 2023
dbcdc3f
Update: install python dependencies script as in ONA for more conveni…
patham9 May 22, 2023
738ebe6
Update README.md
patham9 May 24, 2023
a372a26
Update: additional flag to allow importing GPT knowledge as Narsese s…
patham9 May 24, 2023
9ff8b67
Merge branch 'gptONA' of https://github.com/patham9/NarsGPT into gptONA
patham9 May 24, 2023
a81988f
Update: unified interface functionality
patham9 Jun 1, 2023
e7b8515
Update: also pass flags to be as before
patham9 Jun 1, 2023
8e7c4de
Update: you/i handling and example of an agent that keeps asking the …
patham9 Jun 3, 2023
10cc4d3
Update: feeed question back to next input so that short inputs become…
patham9 Jun 3, 2023
09f05b4
Update: put information sponge learning goal up
patham9 Jun 3, 2023
1e48fe6
Update: put information sponge learning goal up
patham9 Jun 3, 2023
cce8aab
Update: additional improvement
patham9 Jun 3, 2023
1dc65bb
Merge pull request #11 from patham9/UnifiedInterface
patham9 Jun 3, 2023
74da794
Update: Demo1: rename to RaiseQuestion:
patham9 Jun 3, 2023
0347d9b
Update: printing fix, TODO clean up flags handling for print variants
patham9 Jun 6, 2023
2cc9624
Update README.md
patham9 Jun 13, 2023
5447870
Update README.md
patham9 Jun 13, 2023
aa4abf9
Update README.md
patham9 Jun 13, 2023
b4155a0
Update README.md
patham9 Jun 13, 2023
54b9d51
Update: I/You print out fix
patham9 Jul 10, 2023
c0b6ea1
Update: I/You print out fix
patham9 Jul 10, 2023
8f822cd
Update: example of using LLM for decision making and NARS-GPT as memory
patham9 Jul 17, 2023
305453d
Update: interface extension for goal resolving
patham9 Jul 19, 2023
c19f9c6
Update: show comparative relations to GPT in simplified form
patham9 Jul 30, 2023
a1fdf24
Update: support atom creation threshold as in ANSNA for concepts whic…
patham9 Jul 30, 2023
70acda8
Update: comment removal
patham9 Jul 30, 2023
31cfa57
Update: Narsese atoms serve as reference atoms when existing
patham9 Jul 31, 2023
2a9e44c
Update: automated goal grounding is now the default
patham9 Jul 31, 2023
467dec8
Update: improved input printing
patham9 Jul 31, 2023
a160661
Update: improvements complete
patham9 Jul 31, 2023
ea292a1
Update: improvements complete and cleanup
patham9 Jul 31, 2023
18d5341
Update: allow model selection
patham9 Jul 31, 2023
4d53fe7
Update: further automated grounding features
patham9 Jul 31, 2023
b438ddb
Update: support for *concurrent command of ONA v0.9.2
patham9 Jul 31, 2023
ffe7fa3
Update: Evaluate with GPT-4 too
PtrMan Aug 15, 2023
55ba5e5
Update: paths corrected, less tolerance for term replacement
patham9 Aug 23, 2023
fc218c4
Update README.md
patham9 Aug 23, 2023
8e27ba7
Update: test output file
patham9 Aug 23, 2023
ca16f44
Update: also install nltk
patham9 Sep 11, 2023
66dfeb9
Update: use new ONA version and use the OpenAI before they removed es…
patham9 Nov 24, 2023
8cac236
Update: initial changes
patham9 Feb 1, 2024
d0e14de
addressing the API obfuscation OpenAI has enforced
patham9 Feb 1, 2024
bb765ba
Merge branch 'master' into NewAPI
patham9 Feb 1, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update: negation does not need to be prevented like that, better opti…
…ons are available
  • Loading branch information
patham9 committed Apr 24, 2023
commit f99f53dc2c3547ea226b58b0d7e64868ea681e8c
4 changes: 1 addition & 3 deletions Control.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

from Memory import *

def Control_cycle(inp, buf, currentTime, memory, cmd, userQuestion, PrintMemoryUpdates, PrintTruthValues, QuestionPriming, NegationProtection):
def Control_cycle(inp, buf, currentTime, memory, cmd, userQuestion, PrintMemoryUpdates, PrintTruthValues, QuestionPriming):
AlreadyExecuted = set([])
for x in cmd:
if len(x) < 3:
Expand All @@ -46,8 +46,6 @@ def Control_cycle(inp, buf, currentTime, memory, cmd, userQuestion, PrintMemoryU
isNegated = True
x = x[7:].replace(",", " ").replace(" ", " ") #.replace('"', "").replace("'", "")
truth = (0.0, 0.9)
if NegationProtection and "not" not in inp and "n't" not in inp and "except" not in inp and "dis" not in inp: #avoid RLHF bs bias
truth = (1.0, 0.9)
if x.startswith("RelationClaim") or x.startswith("PropertyClaim"):
x = x.replace(",", " ").replace(" ", " ") #.replace('"', "").replace("'", "")
isInput = x.startswith("RelationClaim(") or x.startswith("PropertyClaim(")
Expand Down
3 changes: 1 addition & 2 deletions NarsGPT.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
PrintGPTPrompt = False or "PrintGPTPrompt" in sys.argv
NarseseByONA = True and "NarseseByGPT" not in sys.argv
QuestionPriming = True and "NoQuestionPriming" not in sys.argv
NegationProtection = True and "NoNegationProtection" not in sys.argv

for x in sys.argv:
if x.startswith("API_KEY="):
Expand All @@ -49,7 +48,7 @@ def PromptProcess(inp, buf, send_prompt, isQuestion):
if PrintGPTPrompt: print("vvvvSTART PROMPT", send_prompt, "\n^^^^END PROMPT")
response = openai.ChatCompletion.create(model='gpt-3.5-turbo', messages=[ {"role": "user", "content": send_prompt}], max_tokens=200, temperature=0)
commands = response['choices'][0]['message']['content'].split("\n")
Control_cycle(inp, buf, currentTime, memory, commands, isQuestion, PrintMemoryUpdates, PrintTruthValues, QuestionPriming, NegationProtection)
Control_cycle(inp, buf, currentTime, memory, commands, isQuestion, PrintMemoryUpdates, PrintTruthValues, QuestionPriming)

while True:
try:
Expand Down