This commit is contained in:
seb
2026-10-10 18:17:14 +02:00
parent 004e0de869
commit a20668cd61
31 changed files with 572 additions and 76 deletions

View File

@@ -6,18 +6,22 @@ export const modelconversation = {
* Lists the user's model conversations in the selected company.
* → 200 { conversations: [{ id, companyuser_id, provider, model, created_at, updated_at, state }] }
*/
// #region GET /api/modelconversation — list
list() {
return http('/api/modelconversation');
},
// #endregion
/**
* GET /api/modelconversation/:id
* Fetch conversation details by ID.
* @param {number|string} id
*/
// #region GET /api/modelconversation/:id — get
get(id) {
return http(`/api/modelconversation/${encodeURIComponent(id)}`);
},
// #endregion
/**
* POST /api/modelconversation
@@ -25,27 +29,35 @@ export const modelconversation = {
* Body: { provider, model }
* → 201 { conversation: { id, companyuser_id, provider, model, created_at, updated_at, state } }
*/
// #region POST /api/modelconversation — create
create(body) {
return http('/api/modelconversation', { method: 'POST', body });
},
// #endregion
/**
* GET /api/modelconversation/:id/message
* Lists conversation messages, oldest first.
* → 200 { messages: [{ id, conversation_id, created_at, role, message }] }
*/
// #region GET /api/modelconversation/:id/message — listMessages
listMessages(id) {
return http(`/api/modelconversation/${encodeURIComponent(id)}/message`);
},
// #endregion
// #region POST /api/modelconversation/:id/message — addMessage
addMessage(id, body) {
return http(`/api/modelconversation/${encodeURIComponent(id)}/message`, { method: 'POST', body });
},
// #endregion
/**
* DELETE /api/modelconversation/:id
*/
// #region DELETE /api/modelconversation/:id — delete
delete(id) {
return http(`/api/modelconversation/${encodeURIComponent(id)}`, { method: 'DELETE' });
},
// #endregion
};