Skip to content

Commit

Permalink
[releases/24.x] [Copilot] AOAI Token not returning tokens (#728)
Browse files Browse the repository at this point in the history
  • Loading branch information
darjoo authored Mar 12, 2024
1 parent 5f64a07 commit 0849119
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ codeunit 7759 "AOAI Token"
/// <returns>The token count.</returns>
procedure GetGPT35TokenCount(Input: SecretText): Integer
begin
AzureOpenAIImpl.GetTokenCount(Input, Encodingcl100kbaseLbl);
exit(AzureOpenAIImpl.GetTokenCount(Input, Encodingcl100kbaseLbl));
end;

/// <summary>
Expand All @@ -31,7 +31,7 @@ codeunit 7759 "AOAI Token"
/// <returns>The token count.</returns>
procedure GetGPT4TokenCount(Input: SecretText): Integer
begin
AzureOpenAIImpl.GetTokenCount(Input, Encodingcl100kbaseLbl);
exit(AzureOpenAIImpl.GetTokenCount(Input, Encodingcl100kbaseLbl));
end;

/// <summary>
Expand All @@ -41,7 +41,7 @@ codeunit 7759 "AOAI Token"
/// <returns>The token count.</returns>
procedure GetAdaTokenCount(Input: SecretText): Integer
begin
AzureOpenAIImpl.GetTokenCount(Input, Encodingcl100kbaseLbl);
exit(AzureOpenAIImpl.GetTokenCount(Input, Encodingcl100kbaseLbl));
end;

/// <summary>
Expand All @@ -51,6 +51,6 @@ codeunit 7759 "AOAI Token"
/// <returns>The token count.</returns>
procedure GetDavinciTokenCount(Input: SecretText): Integer
begin
AzureOpenAIImpl.GetTokenCount(Input, Encodingp50kbaseLbl);
exit(AzureOpenAIImpl.GetTokenCount(Input, Encodingp50kbaseLbl));
end;
}
Original file line number Diff line number Diff line change
Expand Up @@ -531,12 +531,11 @@ codeunit 7772 "Azure OpenAI Impl"
end;
#endif

[NonDebuggable]
procedure GetTokenCount(Input: SecretText; Encoding: Text) TokenCount: Integer
var
ALCopilotFunctions: DotNet ALCopilotFunctions;
begin
TokenCount := ALCopilotFunctions.GptTokenCount(Input.Unwrap(), Encoding);
TokenCount := ALCopilotFunctions.GptTokenCount(Input, Encoding);
end;

}

0 comments on commit 0849119

Please sign in to comment.