Environment Variables
artcurator is configured entirely through environment variables. Set these before loading the package.
Required (Provider-Specific)
For Gemini: - ART_GEMINI_KEY - Your Gemini API key. Get one at https://aistudio.google.com/apikey r Sys.setenv(ART_GEMINI_KEY = "your-key-here")
For OpenAI: - ART_OPENAI_KEY - Your OpenAI API key. Get one at https://platform.openai.com/api-keys r Sys.setenv(ART_OPENAI_KEY = "your-key-here")
Optional (with defaults)
-
ARTCURATOR_PROVIDER(default:"gemini") - Default AI provider for artwork analysis. Options:"gemini","openai".Sys.setenv(ARTCURATOR_PROVIDER = "openai") ART_GEMINI_MODEL(default:"gemini-2.5-flash") - Default Gemini model.ART_OPENAI_MODEL(default:"gpt-5.1") - Default OpenAI model.
For additional provider configuration, see artgemini and artopenai documentation.
Overview
artcurator provides a unified AI interface for artwork analysis that works with both Google Gemini and OpenAI. Switch between providers with a single parameter instead of changing packages.
Key capabilities: - Provider-agnostic artwork analysis (5 core functions) - Interactive curator chat with streaming support - Curator context API for AI agents (hot-cached artist/artwork data) - Automatic provider switching via parameter or environment variable - Centralized prompt management with version tracking - Benchmark data utilities (percentile metrics, style analysis)
Quick Example
library(artcurator)
# Auto-detect provider (uses Gemini by default)
styles <- art_style_ai("artwork.png")
# Switch to OpenAI with one parameter
styles <- art_style_ai("artwork.png", provider = "openai")
# Generate complete artwork analysis
description <- art_about_ai("artwork.png")
profile <- art_profile_ai(
art_title = "Portrait",
artist_name = "Artist Name",
drawing_hours = 12,
brush_strokes = 5000,
img_path = "artwork.png"
)Interactive Curator Chat
Create multi-turn chat sessions with artist context for gallery and profile UIs:
# Create chat session with artist context pre-loaded
chat <- curator_chat_new("artist-uuid-here")
# Send messages (conversation state maintained)
chat$chat("What are this artist's most notable works?")
chat$chat("How would you describe their artistic style?")
# Stream responses for real-time UI display
stream <- chat$stream("Tell me about their career progression.")The chat object is an ellmer Chat with full streaming support for integration with shinychat.
Installation
# Requires GITHUB_PAT
pak::pkg_install("artalytics/artcurator")Both artgemini and artopenai are installed automatically as dependencies.
Documentation
-
Get Started -
vignette("artcurator")- Comprehensive tutorial for all core functions -
Agent Evaluations -
vignette("agent-evaluations")- Formal provider comparison and evaluation workflows - Function Reference - Complete API documentation
- PLANS.md - Implementation details and architecture
- NEWS.md - Release notes and changelog
