feat(assist): сбор usage-токенов и отдача в meta (время этапов уже было)
This commit is contained in:
@@ -109,6 +109,7 @@ function parseResourceType(content) {
|
||||
* @param {string} [opts.model]
|
||||
* @param {number} [opts.timeoutMs]
|
||||
* @param {AbortController} [opts.controller]
|
||||
* @param {object} [opts.usageRef]
|
||||
* @returns {Promise<{ok:boolean, resourceType?:string|null, error?:string}>}
|
||||
*/
|
||||
async function stage1ExtractResourceType(question, {
|
||||
@@ -118,6 +119,7 @@ async function stage1ExtractResourceType(question, {
|
||||
model = process.env.LLM_MODEL || DEFAULT_MODEL,
|
||||
timeoutMs,
|
||||
controller,
|
||||
usageRef,
|
||||
}) {
|
||||
const types = new Set(
|
||||
[...new Set(resourceTypesSet || [])].map((t) => String(t).toLowerCase().trim())
|
||||
@@ -139,6 +141,7 @@ async function stage1ExtractResourceType(question, {
|
||||
baseUrl,
|
||||
apiKey,
|
||||
model,
|
||||
usageRef,
|
||||
};
|
||||
let timer = null;
|
||||
let ctrl = controller;
|
||||
|
||||
Reference in New Issue
Block a user