---
id: object/codeunit/7758
type: object
title: Codeunit 7758 "AOAI Function Response"
summary: Codeunit 7758 "AOAI Function Response" in System Application (System.AI). 11 public procedures. Introduced in BC24, still in BC30, changed in BC25.
tier: official
language: en
tags:
  - codeunit
  - system application
versions:
  introduced: "24"
  last_changed: "25"
  deprecated: null
review:
  state: derived
  by: null
  at: null
  flags: []
generated:
  at: "2026-10-11T00:31:51.816Z"
  pipeline: 0.2.0
  prompts: {}
  input_hash: a2e57a9d3edc8088f1dbafe53235f5d6823817188e2c0f19039b7ed4a234d22d
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/System%20Application/App/AI/src/Azure%20OpenAI/Operation%20Response/AOAIFunctionResponse.Codeunit.al
    title: src/System Application/App/AI/src/Azure OpenAI/Operation Response/AOAIFunctionResponse.Codeunit.al (releases/29.x)
    date: null
    commit: ea08af5ef2d6a9b5c5af4a029288abbe2c883220
    t: null
    quote: null
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
object_type: codeunit
object_id: 7758
name: AOAI Function Response
namespace: System.AI
app: System Application
extends: null
first_version: "24"
last_version: "30"
present_in:
  - "24"
  - "25"
  - "26"
  - "27"
  - "28"
  - "29"
  - "30"
changed_in:
  - "25"
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 11
  events: 0
  subscribers: 0
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 0
  calls: 1
  called_by: 10
  implements: 0
---

# Codeunit 7758 "AOAI Function Response"

> Codeunit 7758 "AOAI Function Response" in System Application (System.AI). 11 public procedures. Introduced in BC24, still in BC30, changed in BC25.

System Application · System.AI · BC24-30 · [source at ea08af5e](https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/System%20Application/App/AI/src/Azure%20OpenAI/Operation%20Response/AOAIFunctionResponse.Codeunit.al) · facts from BC29

## Properties

| Property | Value |
|---|---|
| Access | Public |

## Procedures

- `IsSuccess(): Boolean`: Get whether the function call was successful.
- `GetStatus(): Enum "AOAI Function Response Status"`: Gets the function response status.
- `GetResult(): Variant`: Get the return value of the function that was called.
- `GetArguments(): JsonObject`: Get the arguments for the function call.
- `GetError(): Text`: Get the error message from the function that was called.
- `GetFunctionName(): Text`: Get the name of the function that was called.
- `GetFunctionId(): Text`: Get the id of the function that was called.
- `GetErrorCallstack(): Text`: Get the error call stack from the function that was called.
- `AppendResultToChatMessages(var AOAIChatMessages: Codeunit "AOAI Chat Messages")` (internal): Appends the function result to the provided AOAIChatMessages instance.
- `IsFunctionCall(): Boolean` (internal)
- `SetFunctionCallingResponse(NewIsFunctionCall: Boolean; NewAOAIFunctionResponseStatus: Enum "AOAI Function Response Status"; NewFunctionCalled: Text; NewFunctionId: Text; NewArguments: JsonObject; NewFunctionResult: Variant; NewFunctionError: Text; NewFunctionErrorCallStack: Text)` (internal)

## 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 7763 "AOAI Chat Messages"](../codeunit/7763.md) (1 call: `AppendResultToChatMessages → AddToolMessage`)

## Called by

- [Codeunit 324 "No. Series Copilot Impl."](../codeunit/324.md) (7 calls: `GenerateAndReviewToolCompletionWithRetry → GetError`, `GenerateAndReviewToolCompletionWithRetry → GetFunctionName`, `GenerateAndReviewToolCompletionWithRetry → GetResult`, …)
- [Codeunit 6331 "Sustainability Chat Completion"](../codeunit/6331.md) (6 calls: `CopyAOAIFunctionResponseToFormulaBreakdownTempSourceCO2EmissionBuffer → GetResult`, `GenerateFormulaBreakdownChatCompletion → GetFunctionName`, `GenerateMatchCategoryToInputChatCompletion → GetFunctionName`, …)
- [Codeunit 7770 "AOAI Operation Response"](../codeunit/7770.md) (6 calls: `AppendFunctionResponsesToChatMessages → AppendResultToChatMessages`, `AppendFunctionResponsesToChatMessages → GetFunctionId`, `AppendFunctionResponsesToChatMessages → GetFunctionName`, …)
- [Codeunit 7772 "Azure OpenAI Impl"](../codeunit/7772.md) (6 calls: `ProcessChatCompletionResponse → GetError`, `ProcessChatCompletionResponse → GetErrorCallstack`, `ProcessChatCompletionResponse → GetFunctionName`, …)
- [Codeunit 2012 "Entity Text Impl."](../codeunit/2012.md) (3 calls: `GenerateCompletion → GetFunctionName`, `GenerateCompletion → GetResult`, `GenerateCompletion → IsSuccess`)
- [Codeunit 7275 "Sales Lines Suggestions Impl."](../codeunit/7275.md) (3 calls: `AICall → GetFunctionName`, `AICall → GetResult`, `AICall → IsSuccess`)
- [Codeunit 7330 "Item Subst. Suggestion Impl."](../codeunit/7330.md) (3 calls: `AICall → GetFunctionName`, `AICall → GetResult`, `AICall → IsSuccess`)
- [Codeunit 4402 "SOA Output Message Setup"](../codeunit/4402.md) (2 calls: `AddSignatureToMessageBody → GetArguments`, `CheckMailTemplate → GetArguments`)
- [Codeunit 4417 "SOA Item Selector"](../codeunit/4417.md) (1 call: `TrySelectBestMatchingItems → GetArguments`)
- [Codeunit 4596 "SOA Broader Item Search"](../codeunit/4596.md) (1 call: `AICall → GetArguments`)

## Across versions

- Present in: BC24-30
- Changed (declaration) in: BC25

Source: AL metadata extracted from the code (names, ids, signatures, properties); no code bodies (D10).

## 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 Function Response")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
