examples/bird-checker-with-express/README.md
An Express.js server that has an API that can get a random image from Unsplash that matches a selected query and another API that uses Mastra AI Agent to determine if an image is a bird or not. It also has braintrust eval to use evaluate the llm prompt
git clone <repository-url>
cd bird-checker-with-express
pnpm install
cp .env.example .env.local
# Required for getting image
UNSPLASH_ACCESS_KEY=your_unsplash_access_key
# Required for AI processing
ANTHROPIC_API_KEY=your_anthropic_key
# The port you want your server to run on (optional)
PORT=your_preferred_port
pnpm start
Open Postman or your preferred platofrom for testing APIs
Enter http://localhost:${PORT}/api/get-unsplash-image?query=bird in the url to get image from unsplash. This is a get request.
The query can be edited to any of the following - wildlife | bird | feathers | flying
Enter http://localhost:${PORT}/api/image-metadata in the url to get information about an image. This is a post request.
The payload for this request:
{
imageUrl: "" //the image url
}
Contributions are welcome! Please feel free to submit a Pull Request.