Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Copilot] AOAI Token not returning tokens #727

Merged
merged 1 commit into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;

}
Loading