An AI-powered code generator for the AElf ecosystem, built with Next.js, CopilotKit, and Langgraph.
- AI-powered code generation for smart contracts and dApps
- Real-time code suggestions and completions
- Built-in examples and templates for common use cases
- Modern, responsive UI with Tailwind CSS
- Node.js 18+ and npm
- OpenAI API key
- Gemini API key
-
Clone the repository
-
Install dependencies:
npm install
-
Copy
.env.local.exampleto.env.localand add your API keys:# UI Environment Variables NEXT_PUBLIC_RUNTIME_URL=http://localhost:3000/api/copilotkit AGENT_URL=http://localhost:3001/copilotkit/generate GROQ_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxx NEXT_PUBLIC_FAUCET_API_URL=https://faucet.aelf.dev NEXT_PUBLIC_GOOGLE_CAPTCHA_SITEKEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx # Agent Environment Variables OPENAI_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx TAVILY_API_KEY=tvly-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx GOOGLE_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx MODEL=azure_openai AZURE_OPENAI_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx GITHUB_TOKEN=ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx # LangSmith Tracing (optional) LANGSMITH_TRACING=true LANGSMITH_ENDPOINT="https://api.smith.langchain.com" LANGSMITH_API_KEY="lsv2_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" LANGSMITH_PROJECT="ai-code-generator"
-
Set up and run the agent:
# Navigate to the agent directory cd agent # Create virtual environment python3 -m venv venv source venv/bin/activate # Install dependencies pip install -e . # Run the agent python3 -m aelf_code_generator
-
Run the UI development server:
# Return to the root directory cd ../ui # Start the Next.js server npm run dev
-
Open http://localhost:3000 in your browser
- Next.js 14
- TypeScript
- Tailwind CSS
- CopilotKit
- Gemini embedding withOpenAI API
MIT