Skip to content

Commit f84cb72

Browse files
committed
AOAI Token not returning tokens
1 parent e73ebde commit f84cb72

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/System Application/App/AI/src/Azure OpenAI/AOAIToken.Codeunit.al

+4-4
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ codeunit 7759 "AOAI Token"
2121
/// <returns>The token count.</returns>
2222
procedure GetGPT35TokenCount(Input: SecretText): Integer
2323
begin
24-
AzureOpenAIImpl.GetTokenCount(Input, Encodingcl100kbaseLbl);
24+
exit(AzureOpenAIImpl.GetTokenCount(Input, Encodingcl100kbaseLbl));
2525
end;
2626

2727
/// <summary>
@@ -31,7 +31,7 @@ codeunit 7759 "AOAI Token"
3131
/// <returns>The token count.</returns>
3232
procedure GetGPT4TokenCount(Input: SecretText): Integer
3333
begin
34-
AzureOpenAIImpl.GetTokenCount(Input, Encodingcl100kbaseLbl);
34+
exit(AzureOpenAIImpl.GetTokenCount(Input, Encodingcl100kbaseLbl));
3535
end;
3636

3737
/// <summary>
@@ -41,7 +41,7 @@ codeunit 7759 "AOAI Token"
4141
/// <returns>The token count.</returns>
4242
procedure GetAdaTokenCount(Input: SecretText): Integer
4343
begin
44-
AzureOpenAIImpl.GetTokenCount(Input, Encodingcl100kbaseLbl);
44+
exit(AzureOpenAIImpl.GetTokenCount(Input, Encodingcl100kbaseLbl));
4545
end;
4646

4747
/// <summary>
@@ -51,6 +51,6 @@ codeunit 7759 "AOAI Token"
5151
/// <returns>The token count.</returns>
5252
procedure GetDavinciTokenCount(Input: SecretText): Integer
5353
begin
54-
AzureOpenAIImpl.GetTokenCount(Input, Encodingp50kbaseLbl);
54+
exit(AzureOpenAIImpl.GetTokenCount(Input, Encodingp50kbaseLbl));
5555
end;
5656
}

src/System Application/App/AI/src/Azure OpenAI/AzureOpenAIImpl.Codeunit.al

+1-2
Original file line numberDiff line numberDiff line change
@@ -531,12 +531,11 @@ codeunit 7772 "Azure OpenAI Impl"
531531
end;
532532
#endif
533533

534-
[NonDebuggable]
535534
procedure GetTokenCount(Input: SecretText; Encoding: Text) TokenCount: Integer
536535
var
537536
ALCopilotFunctions: DotNet ALCopilotFunctions;
538537
begin
539-
TokenCount := ALCopilotFunctions.GptTokenCount(Input.Unwrap(), Encoding);
538+
TokenCount := ALCopilotFunctions.GptTokenCount(Input, Encoding);
540539
end;
541540

542541
}

0 commit comments

Comments
 (0)