mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-06 05:55:21 +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
16
app/views/api/v1/messages/show.json.jbuilder
Normal file
16
app/views/api/v1/messages/show.json.jbuilder
Normal file
|
@ -0,0 +1,16 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
json.id @message.id
|
||||
json.chat_id @message.chat_id
|
||||
json.type @message.type.underscore
|
||||
json.role @message.role
|
||||
json.content @message.content
|
||||
json.model @message.ai_model if @message.type == "AssistantMessage"
|
||||
json.created_at @message.created_at.iso8601
|
||||
json.updated_at @message.updated_at.iso8601
|
||||
|
||||
# Note: AI response will be processed asynchronously
|
||||
if @message.type == "UserMessage"
|
||||
json.ai_response_status "pending"
|
||||
json.ai_response_message "AI response is being generated"
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue