mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-19 05:09:38 +02:00
Add API v1 chat endpoints
- Add chats#index and chats#show endpoints to list and view AI conversations - Add messages#create endpoint to send messages to AI chats - Include API documentation for chat endpoints - Add controller tests for new endpoints 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
4d3c710291
commit
94202b2a6b
11 changed files with 698 additions and 0 deletions
|
@ -266,4 +266,11 @@ class Api::V1::BaseController < ApplicationController
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
# Check if AI features are enabled for the current user
|
||||
def require_ai_enabled
|
||||
unless current_resource_owner&.ai_enabled?
|
||||
render_json({ error: "feature_disabled", message: "AI features are not enabled for this user" }, status: :forbidden)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue