Codeunit 7759 "AOAI Token"
System Application · System.AI
Across versions
- BC23not present
- BC24added
- BC25unchanged
- BC261 procedures added
- BC27-30unchanged
Neighbourhood 4 connected objects and pages
System Application · System.AI · BC24-30 · source at ea08af5e · facts from BC29
Properties
| Property | Value |
|---|---|
| Access | Public |
Procedures
GetGPT35TokenCount(Input: SecretText): Integer: Gets the token count for the input according to GPT3.5 models.GetGPT4TokenCount(Input: SecretText): Integer: Gets the token count for the input according to GPT4 models.GetAdaTokenCount(Input: SecretText): Integer: Gets the token count for the input according to embedding Ada models.GetDavinciTokenCount(Input: SecretText): Integer: Gets the token count for the input according to text Davinci models.GetTotalServerSessionTokensConsumed(): Integer+ BC26: Gets the total tokens used till now for the server session. The total tokens used is aggregated for all the models. Note: this method is expected to change in future.
Calls
From the extracted call graph of BC29 (graphify-al on the snapshot checkout): calls whose target is known from a declared type or an Object::"Name" argument. Interface dispatch and calls through events are not counted, so the list is not complete.
- Codeunit 7772 “Azure OpenAI Impl” (5 calls:
GetAdaTokenCount → GetTokenCount,GetDavinciTokenCount → GetTokenCount,GetGPT35TokenCount → GetTokenCount, …)
Called by
- Codeunit 7250 “Bank Rec. AI Matching Impl.” (2 calls:
FindDateFilterOnLedgerEntryBuffer → GetGPT4TokenCount,GenerateMatchProposals → GetGPT4TokenCount) - Codeunit 324 “No. Series Copilot Impl.” (1 call:
Generate → GetGPT35TokenCount) - Codeunit 7764 “AOAI Chat Messages Impl” (1 call:
PrepareHistory → GetGPT4TokenCount) - Codeunit 7772 “Azure OpenAI Impl” (1 call:
GenerateEmbeddings → GetAdaTokenCount)
Ask your agent
Procedure bodies are not stored here (D10). The call sections above are our own, per object, from the BC29 call graph. For a procedure body or the calls of one procedure, ask bc-code-atlas (external, by Stefan Maron, MIT; default corpus w1-28), which the bc-observatory plugin connects: bcatlas_resolve_node(object_type: "codeunit", object_name: "AOAI Token"), then bcatlas_get_procedure_body or bcatlas_get_neighbors on the returned id.