forked from openmindx/agi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
agi.py
28 lines (23 loc) · 848 Bytes
/
agi.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# openmind (c) Gregory L. Magnusson 2024 MIT license
import openai
openai.api_key = ''
def get_solution_from_agi(agi_prompt):
prompt = f"Autonomous general intelligence return solution: {agi_prompt}."
response = openai.chat.completions.create(
model="gpt-4o",
messages=[
{"role": "system", "content": "You are openmind the easy action event AGI solution creator."},
{"role": "user", "content": prompt}
]
)
solution = response.choices[0].message.content
return solution
def main():
while True:
agi_prompt = input("Enter the problem to solve (or type 'exit' to quit): ")
if agi_prompt.lower() == 'exit':
break
solution = get_solution_from_agi(agi_prompt)
print(f"\nSolution:\n{solution}\n")
if __name__ == "__main__":
main()