Skip to content

Declarative CustomerSupport: how should a host uniformly render UserMessage from output? #8346

Description

@likebean

Question

In the declarative Customer Support sample, escalate_agent uses structured output (IsComplete + UserMessage) together with externalLoop and autoSend: true. We want the end user to see UserMessage (natural language), not the raw JSON.

Our host must render user-facing text uniformly from the action output. It cannot special-case individual agents or field names (UserMessage vs Reply vs ClarificationQuestion, etc.).

What is the intended way to do that in this sample?

Sample

declarative-agents/workflow-samples/CustomerSupport.yaml (escalate_agent):

- kind: InvokeAzureAgent
  id: escalate_agent
  conversationId: =Local.EscalationConversationId
  agent:
    name: TicketEscalationAgent
  input:
    arguments:
      TicketId: =Local.TicketParameters.TicketId
      IssueDescription: =Local.ServiceParameters.IssueDescription
      ResolutionSummary: =Local.ResolutionSteps
    externalLoop:
      when: =Not(Local.EscalationParameters.IsComplete)
  output:
    autoSend: true
    responseObject: Local.EscalationParameters

The agent is constrained to a JSON schema like:

class EscalationResponse(BaseModel):
    IsComplete: bool
    UserMessage: str

(See the matching Python / .NET Customer Support samples.)

What we observe

  • responseObject: Local.EscalationParameters correctly parses the JSON for workflow state / when.
  • autoSend: true yields the agent's raw text, which is the whole JSON object when response_format is set.
  • output appears to only support autoSend (bool), responseObject, and messages. There is no output property that identifies which field is the user-visible message.

We would like to hear from maintainers how a host is supposed to surface UserMessage in this pattern, given the constraint above. Thanks.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    .NETUsage: [Issues, PRs], Target: .NetpythonUsage: [Issues, PRs], Target: PythontriageUsage: [Issues], Target: All issues that still need to be triaged

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions