EasyAgent/demo/lib/state.js
2026-02-28 03:00:08 +08:00

23 lines
454 B
JavaScript

'use strict';
const crypto = require('crypto');
function createState() {
return {
conversationId: crypto.randomUUID(),
allow: 'full_access',
model: 'kimi',
thinking: 'thinking',
tokenUsage: 0,
baseUrl: 'https://api.example.com/v1',
apiKey: 'sk-xxxxxxw2y',
};
}
function newConversation(state) {
state.conversationId = crypto.randomUUID();
state.tokenUsage = 0;
}
module.exports = { createState, newConversation };