{"record":{"id":"0a5322a737133f51","repo":"microsoft/autogen","slug":"expected-content-to-have-one-output","errorCode":null,"errorMessage":"Expected Content to have one output","messagePattern":"Expected Content to have one output","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"error","filePath":"dotnet/src/AutoGen.Anthropic/Middleware/AnthropicMessageConnector.cs","lineNumber":125,"sourceCode":"        if (response.Content is null)\n        {\n            throw new ArgumentNullException(nameof(response.Content));\n        }\n\n        // When expecting a tool call, sometimes the response will contain two messages, one chat and one tool.\n        // The first message is typically a TextContent, of the LLM explaining what it is trying to do.\n        // The second message contains the tool call.\n        if (response.Content.Count > 1)\n        {\n            if (response.Content.Count == 2 && response.Content[0] is TextContent &&\n                response.Content[1] is ToolUseContent toolUseContent)\n            {\n                return new ToolCallMessage(toolUseContent.Name ?? string.Empty,\n                    toolUseContent.Input?.ToJsonString() ?? string.Empty,\n                    from: from.Name);\n            }\n\n            throw new NotSupportedException($\"Expected {nameof(response.Content)} to have one output\");\n        }\n\n        var content = response.Content[0];\n        switch (content)\n        {\n            case TextContent textContent:\n                return new TextMessage(Role.Assistant, textContent.Text ?? string.Empty, from: from.Name);\n\n            case ToolUseContent toolUseContent:\n                return new ToolCallMessage(toolUseContent.Name ?? string.Empty,\n                    toolUseContent.Input?.ToJsonString() ?? string.Empty,\n                    from: from.Name);\n\n            case ImageContent:\n                throw new InvalidOperationException(\n                    \"Claude is an image understanding model only. It can interpret and analyze images, but it cannot generate, produce, edit, manipulate or create images\");\n            default:\n                throw new ArgumentOutOfRangeException(nameof(content));","sourceCodeStart":107,"sourceCodeEnd":143,"githubUrl":"https://github.com/microsoft/autogen/blob/027ecf0a379bcc1d09956d46d12d44a3ad9cee14/dotnet/src/AutoGen.Anthropic/Middleware/AnthropicMessageConnector.cs#L107-L143","documentation":"Error \"Expected Content to have one output\" thrown in microsoft/autogen.","triggerScenarios":"Thrown at dotnet/src/AutoGen.Anthropic/Middleware/AnthropicMessageConnector.cs:125 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Return a single output item per tool result; merge or select one result if multiple exist"],"exampleFix":"Collapse tool results to one output before constructing the ToolResultMessage","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"027ecf0a379bcc1d09956d46d12d44a3ad9cee14","analyzedAt":"2026-08-15T03:38:00.719Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}