generator-begcode
Version:
Spring Boot + Angular/React/Vue in one handy generator
27 lines (26 loc) • 734 B
JavaScript
import { Timer } from './Timer.js';
export class DebugLlmApi {
debugLog;
llm;
constructor(debugLog, llm) {
this.debugLog = debugLog;
this.llm = llm;
}
getMaxContextTokens() {
return this.llm.getMaxContextTokens();
}
getMaxResponseTokens() {
return this.llm.getMaxResponseTokens();
}
getModel() {
return this.llm.getModel();
}
async getResponse(chatLogs, functionDefinitions, options) {
const time = new Timer();
time.start();
const resp = await this.llm.getResponse(chatLogs, functionDefinitions, options);
time.end();
await this.debugLog.stepLlmReq(time, chatLogs.clone(), resp);
return resp;
}
}