1.8 KiB
1.8 KiB
API Documentation
Base URL
http://localhost:8000
Endpoints
Generate Marketing Copy
POST /generate
Generate marketing copy based on prompt and brand guidelines.
Request Body
{
"prompt": "string",
"content_type": "general",
"tone": "string"
}
Response
"Generated marketing copy text"
Add Campaign
POST /add-campaign
Add a marketing campaign to the vector store for future reference.
Request Body
{
"content": "string",
"content_type": "string",
"metadata": {}
}
Search Campaigns
GET /search
Search for similar campaigns using vector similarity.
Query Parameters
query(string): Search querycontent_type(string, optional): Filter by content typek(int, optional): Number of results to return (default: 3)
Response
[
{
"content": "string",
"content_type": "string",
"metadata": {},
"_search_distance": 0.0
}
]
Health Check
GET /health
Check API health status.
Response
{
"status": "healthy"
}
Root
GET /
API root endpoint with basic information.
Content Types
general- General marketing contentemail- Email campaignssocial- Social media postsad- Advertisement copyblog- Blog content
Error Responses
All endpoints may return:
- 422 Validation Error - Invalid request format
- 500 Internal Server Error - Server error
{
"detail": [
{
"loc": ["field_name"],
"msg": "Error message",
"type": "error_type"
}
]
}
Vector Store Features
- Uses
all-MiniLM-L6-v2model for embeddings (384 dimensions) - FAISS index for fast similarity search
- Persistent storage of campaigns
- Automatic index rebuilding on startup