This commit is contained in:
seb
2026-10-04 02:13:50 +02:00
parent 0d0c5dfdfb
commit f2fce9097b
19 changed files with 3087 additions and 9 deletions

View File

@@ -1841,6 +1841,56 @@ export const globalHistory = {
},
};
export const modelconversation = {
/**
* GET /api/modelconversation
* Lists the user's model conversations in the selected company.
* → 200 { conversations: [{ id, companyuser_id, provider, model, created_at, updated_at, state }] }
*/
list() {
return http('/api/modelconversation');
},
/**
* GET /api/modelconversation/:id
* Fetch conversation details by ID.
* @param {number|string} id
*/
get(id) {
return http(`/api/modelconversation/${encodeURIComponent(id)}`);
},
/**
* POST /api/modelconversation
* Creates a new conversation in state 'idle'.
* Body: { provider, model }
* → 201 { conversation: { id, companyuser_id, provider, model, created_at, updated_at, state } }
*/
create(body) {
return http('/api/modelconversation', { method: 'POST', body });
},
/**
* GET /api/modelconversation/:id/message
* Lists conversation messages, oldest first.
* → 200 { messages: [{ id, conversation_id, created_at, role, message }] }
*/
listMessages(id) {
return http(`/api/modelconversation/${encodeURIComponent(id)}/message`);
},
addMessage(id, body) {
return http(`/api/modelconversation/${encodeURIComponent(id)}/message`, { method: 'POST', body });
},
/**
* DELETE /api/modelconversation/:id
*/
delete(id) {
return http(`/api/modelconversation/${encodeURIComponent(id)}`, { method: 'DELETE' });
},
};
export default {
auth,
article,
@@ -1855,6 +1905,7 @@ export default {
entity,
labeltemplate,
ledger,
modelconversation,
number,
order,
posterminal,
@@ -1868,3 +1919,4 @@ export default {
stock,
globalHistory,
};