An AI-powered coding assistant for the Sugar Learning Platform
Sugar-AI is a specialized coding assistant designed to help children learn programming with the Sugar Learning Platform. It uses advanced AI to provide child-friendly explanations and code examples.
Sugar-AI helps students and teachers learn coding with Sugar Labs tools:
Integrate Sugar-AI with your applications using our simple API:
Manage Sugar-AI and monitor usage through the admin panel:
The Sugar-AI Dashboard is your personal control center, accessible after signing in with OAuth or an API key. Here's what you can do:
Ask questions directly to the AI and receive instant responses about Sugar development
Switch between knowledge-enhanced responses and direct language model responses
Track your API usage, remaining quota.
Integrate Sugar-AI's capabilities into your own applications with our straightforward API:
import requests
# Make a request to the Sugar-AI API
api_key = "YOUR_API_KEY"
url = "https://sugar-ai.sugarlabs.org/ask"
params = {"question": "How do I create a Pygame window?"}
headers = {"X-API-Key": api_key}
response = requests.post(url, params=params, headers=headers)
result = response.json()
print(result["answer"])
Ask a coding question using Retrieval-Augmented Generation for enhanced context and precision.
X-API-Key: your_api_key
curl -X POST "http://localhost:8000/ask?question=How%20do%20I%20create%20a%20Python%20class?" \ -H "X-API-Key: your_api_key"
{ "answer": "Detailed explanation about Python classes...", "user": "Your Username", "quota": {"remaining": 95, "total": 100} }
Ask a question directly to the LLM without RAG enhancement.
X-API-Key: your_api_key
curl -X POST "http://localhost:8000/ask-llm?question=What%20is%20the%20difference%20between%20lists%20and%20tuples?" \ -H "X-API-Key: your_api_key"
Change the LLM model being used for responses. Requires admin API key and password.
curl -X POST "http://localhost:8000/change-model?model=Qwen/Qwen2-1.5B-Instruct&api_key=admin_key&password=admin_password"