To get started with tdd-agents, follow these steps:
- The Poetry package manager is required for installation. Poetry Installation Depending on your environment, this might work:
pip install poetry- if you want to use the openai API, you need an API_KEY; once you have the API_KEY, put it in .env.openai and rename it to .env.
- You can also use Ollama locally. In this case, rename .env.ollama to .env.
- Ensure that you have the environment of the specified development language in your environment, such as the nodejs environment of typescript, the cargo environment of rust, etc.
poetry install
poetry shell # activates virtual environment
python bin/tdd_develop.pyYou need to let the AI know what you want to do. Define the requirements in agent.toml. The format for defining the requirements is as follows
[project]
requirement = "requirements" # the definition of the requirements, the more detailed the better
language = "rust 1.79.0" # development language, it is recommended to specify the version number
libraries = ["wrap", "tokio", "serde_json"] # middleware and library specification
comment_language = "中文" # language used for comments
readme_language = "中文" # language used for README
base_path = "my_project" # project base pathinstall ollama from here
then download the model and run it as follows:
ollama pull llama3:8b
ollama run llama3:8bthen ollama will host a restful API at http://localhost:11434
once the ollama is runing, check if it working as follows:
curl http://localhost:11434/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "llama3:8b",
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Hello!"
}
]
}'This project was inspired by Dr. Andrew Ng's translation-agent project, and I am very grateful to Dr. Andrew Ng for sharing his knowledge.
