Doriandarko / BabyAGIChatGPT

A ChatGPT plugin to run BabyAI directly in the chat interface
364 stars 56 forks source link

Trying to run on local machine I think I have it running, but localhost:5001 not working #12

Open sprinteroz opened 1 year ago

sprinteroz commented 1 year ago

Hi everyone also @Doriandarko I'm Trying to run on local machine, I think I have it running but localhost:5001 not working. Am I missing something? I believe this code below is meant to be in python, or do I have to save it as a python .py file... If so what do I name it? I have tried this with python 3.10 Microsoft version and 3.11 global both within VS code

I would be grateful for any help, thanks

PS D:\BabyAGI\BabyAGIChatGPT-main plugin with search\BabyAGIChatGPT-main> h search\BabyAGIChatGPT-main'; & 'C:\Users\Darryl\AppData\Local\Microsoft\WindowsApps\python3.10.exe' 'c:\Users\Darryl.vscode\extensions\ms-python.python-2023.12.0\pythonFiles\lib\python\debugpy\adapter/../..\debugpy\launcher' '61609' '--' '-m' 'uvicorn' 'main:app' '--reload'

help import requests

base_url = "http://localhost:5001" # Replace with the Repl URL if running on Replit

Set the objective

objective = "Solve world hunger." response = requests.post(f"{base_url}/set_objective", json={"objective": objective}) print(response.json())

Add a task

task_name = "Develop a task list." response = requests.post(f"{base_url}/add_task", json={"task_name": task_name}) print(response.json())

Execute the next task

response = requests.post(f"{base_url}/execute_next_task") print(response.json())

sprinteroz commented 1 year ago

Ok I think I have worked out how to run the code, I think its D:\BabyAGI\BabyAGIChatGPT-main plugin with search\BabyAGIChatGPT-main>python main.py to run the file. Edit: (Windows Powershell) might be the best for this. I will try it when I have time later today then I just have to see where the other code goes now.

Any ideas would be great thanks.

sprinteroz commented 1 year ago

ok that worked now to test it out.

PS D:\BabyAGI\BabyAGIChatGPT-main plugin with search\BabyAGIChatGPT-main> python main.py