Skip to content

Support Case Agent API Compatibility #342

Open

Description

@asamal4

Problem

The Support Case Management Agent cannot be evaluated in the framework because its API format is incompatible:

What the agent has:

  • SSE-based streaming endpoint (POST /chat)
  • Conversation ID in the final SSE event, not response headers
  • Custom event types (assistant_message, tool_calls, done)

What the framework expects:

  • Standard REST endpoint or generic HTTP streaming
  • Conversation ID in headers or top-level JSON field
  • Generic chunk-based streaming

Impact: Without conversation_id from the response, trace capture (#338) cannot work — the LangFuse adapter needs conversation_id to query traces.

Solution

Add support for SSE streaming with custom event types. Allow agents to specify endpoint_type: "chat_stream" to indicate SSE format with typed events.

How it works:

  1. Framework sends POST /chat with JSON body {"query": "...", "conversation_id": "..."}
  2. Agent streams SSE events: assistant_message, tool_calls, done
  3. Framework extracts conversation_id from final event (done or last assistant_message)
  4. Framework populates TurnData: response content, tool_calls, tokens, conversation_id

Success Criteria

  • New config option: endpoint_type: "chat_stream"

  • SSE parser handles event: <type> and data: <json> format

  • Conversation ID extracted from final event

  • Tool calls aggregated from tool_calls events

  • Token usage extracted from done event

  • Errors from error events captured

  • Existing endpoint_type: "chat" behavior unchanged

  • Support Case Agent can run full evaluations with trace capture

    Dependencies

    Blocks: Issue Trace Ingestion from Observability Platforms #338 trace capture — LangFuse adapter needs conversation_id correlation

    Example Configuration

    agents:
      support_case:
        type: http_api
        api_base: http://support-api:8000
        endpoint: /chat
        endpoint_type: chat_stream   # Handles SSE format
        trace_source: langfuse_traces
    
    Out of Scope
    
    - Changes to Support Case Agent API (use existing format)
    - Generic SSE support for all agents (agent-specific event types)

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions