Conversations (AI Chat)

Manage AI chat conversations for trip planning assistance.

List Conversations

Get all conversations for a trip.

Endpoint: GET /api/trips/{tripId}/conversations

Response:

[
  {
    "id": 1,
    "tripId": 1,
    "title": "Planning Paris itinerary",
    "createdAt": "2024-01-15T10:00:00Z",
    "updatedAt": "2024-01-15T12:30:00Z",
    "messageCount": 24
  }
]

Get Conversation

Get a conversation with all messages.

Endpoint: GET /api/trips/{tripId}/conversations/{conversationId}

Response:

{
  "id": 1,
  "tripId": 1,
  "messages": [
    {
      "id": 1,
      "role": "user",
      "content": "What are the best museums in Paris?",
      "createdAt": "2024-01-15T10:00:00Z"
    },
    {
      "id": 2,
      "role": "assistant",
      "content": "Paris has many world-renowned museums...",
      "createdAt": "2024-01-15T10:00:05Z"
    }
  ]
}

Create Conversation

Start a new conversation.

Endpoint: POST /api/trips/{tripId}/conversations

Request Body

{
  "title": "Day 1 activities"
}

Send Message

Send a message to the AI agent.

Endpoint: POST /api/trips/{tripId}/conversations/{conversationId}/messages

Request Body

{
  "content": "Find me a good restaurant near the Louvre"
}

Response (streaming): Server-Sent Events with real-time response chunks.

For non-streaming:

{
  "id": 3,
  "role": "assistant",
  "content": "Here are some great restaurants near the Louvre...",
  "createdAt": "2024-01-15T10:05:00Z"
}

Delete Conversation

Endpoint: DELETE /api/trips/{tripId}/conversations/{conversationId}


Message Roles

RoleDescription
userMessage from the user
assistantResponse from AI agent
systemSystem notifications