@orxataguy/tyr 1.0.36 → 1.0.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/lib/AIVendorManager.ts +10 -0
package/package.json
CHANGED
|
@@ -332,6 +332,14 @@ export class AIVendorManager {
|
|
|
332
332
|
};
|
|
333
333
|
}
|
|
334
334
|
|
|
335
|
+
/** Logged right before every outgoing request (complete() and stream()) — the one choke point
|
|
336
|
+
* all commands funnel through — so which model handled which call is always visible, without
|
|
337
|
+
* every caller having to remember to log it themselves. */
|
|
338
|
+
private logModelUsage(config: VendorConfig): void {
|
|
339
|
+
const thinkingSuffix = config.thinking && config.thinking !== 'none' ? `, thinking: ${config.thinking}` : '';
|
|
340
|
+
this.logger.info(`[AI] Using ${config.vendor}/${config.model}${thinkingSuffix}`);
|
|
341
|
+
}
|
|
342
|
+
|
|
335
343
|
/**
|
|
336
344
|
* @method resolvePriority
|
|
337
345
|
* @description Translates a TaskPriority into concrete AICompletionOptions (model + thinking
|
|
@@ -817,6 +825,7 @@ export class AIVendorManager {
|
|
|
817
825
|
*/
|
|
818
826
|
public async complete(messages: AIMessage[], options?: AICompletionOptions): Promise<AICompletionResult> {
|
|
819
827
|
const config = this.resolveConfig(options);
|
|
828
|
+
this.logModelUsage(config);
|
|
820
829
|
const { url, headers, body } = this.buildRequest(config, messages, false, options?.tools);
|
|
821
830
|
|
|
822
831
|
try {
|
|
@@ -867,6 +876,7 @@ export class AIVendorManager {
|
|
|
867
876
|
}
|
|
868
877
|
|
|
869
878
|
const config = this.resolveConfig(options);
|
|
879
|
+
this.logModelUsage(config);
|
|
870
880
|
const { url, headers, body } = this.buildRequest(config, messages, true);
|
|
871
881
|
|
|
872
882
|
let content = '';
|