Skip to content

nar-oah/sloth_api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sloth AI Agent API

Python FastAPI service for the three Gemini agent actions from ai-agent.ts.

Setting

sudo cp sloth-api.service /etc/systemd/system/sloth-api.service
sudo systemctl daemon-reload
sudo systemctl enable --now sloth-api.service
sudo systemctl status sloth-api.service

Run

python3 -m pip install -r requirements.txt
export GEMINI_API_KEY="your-api-key"
python3 main.py

The service starts on http://localhost:8000.

CORS

The API enables CORS for browser and mini app calls by default. Current config allows any origin and does not enable credentialed cookie requests. If the frontend needs cookies or login sessions, replace allow_origins=["*"] in main.py with the exact production domains.

Endpoints

All POST endpoints accept:

{
  "contents": "user goals or task text"
}

For older callers, the same JSON body can use req instead of contents.

  • GET /health returns {"status": "ok"}
  • POST /suggest returns string[]
  • POST /writ returns string[7]; /writ is kept as a compatibility alias
  • POST /todo returns { "name": string, "value": number, "todos": string[] }[]

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages