Skip to content

Commit 383a9cf

Browse files
authored
Add missing getMetrics call in AxBalancer and test mock (#83)
1 parent fe96241 commit 383a9cf

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/ax/ai/balance.test.ts

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import type {
55
AxAIPromptConfig,
66
AxAIService,
77
AxAIServiceActionOptions,
8+
AxAIServiceMetrics,
89
AxChatRequest,
910
AxChatResponse,
1011
AxEmbedResponse
@@ -32,6 +33,7 @@ class MockService implements AxAIService {
3233
getModelConfig = () => ({});
3334
getFeatures = () => ({ functions: false, streaming: false });
3435
getModelMap = () => undefined;
36+
getMetrics = () => ({}) as AxAIServiceMetrics;
3537

3638
embed = async () => ({}) as AxEmbedResponse;
3739
setOptions = () => {};

src/ax/ai/balance.ts

+5
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import type {
55
AxAIPromptConfig,
66
AxAIService,
77
AxAIServiceActionOptions,
8+
AxAIServiceMetrics,
89
AxAIServiceOptions,
910
AxChatRequest,
1011
AxChatResponse,
@@ -105,6 +106,10 @@ export class AxBalancer implements AxAIService {
105106
return this.currentService.getFeatures(model);
106107
}
107108

109+
getMetrics(): AxAIServiceMetrics {
110+
return this.currentService.getMetrics();
111+
}
112+
108113
async chat(
109114
req: Readonly<AxChatRequest>,
110115
options?: Readonly<AxAIPromptConfig & AxAIServiceActionOptions> | undefined

0 commit comments

Comments
 (0)