OutputItems - Go SDK

OutputItems type definition

The Go SDK and docs are currently in beta. Report issues on GitHub.

An output item from the response

Supported Types

OutputApplyPatchCallItem

1outputItems := components.CreateOutputItemsApplyPatchCall(components.OutputApplyPatchCallItem{/* values here */})

OutputCodeInterpreterCallItem

1outputItems := components.CreateOutputItemsCodeInterpreterCall(components.OutputCodeInterpreterCallItem{/* values here */})

OutputComputerCallItem

1outputItems := components.CreateOutputItemsComputerCall(components.OutputComputerCallItem{/* values here */})

OutputCustomToolCallItem

1outputItems := components.CreateOutputItemsCustomToolCall(components.OutputCustomToolCallItem{/* values here */})

OutputFileSearchCallItem

1outputItems := components.CreateOutputItemsFileSearchCall(components.OutputFileSearchCallItem{/* values here */})

OutputFunctionCallItem

1outputItems := components.CreateOutputItemsFunctionCall(components.OutputFunctionCallItem{/* values here */})

OutputImageGenerationCallItem

1outputItems := components.CreateOutputItemsImageGenerationCall(components.OutputImageGenerationCallItem{/* values here */})

OutputMessageItem

1outputItems := components.CreateOutputItemsMessage(components.OutputMessageItem{/* values here */})

OutputAdvisorServerToolItem

1outputItems := components.CreateOutputItemsOpenrouterAdvisor(components.OutputAdvisorServerToolItem{/* values here */})

OutputApplyPatchServerToolItem

1outputItems := components.CreateOutputItemsOpenrouterApplyPatch(components.OutputApplyPatchServerToolItem{/* values here */})

OutputBashServerToolItem

1outputItems := components.CreateOutputItemsOpenrouterBash(components.OutputBashServerToolItem{/* values here */})

OutputBrowserUseServerToolItem

1outputItems := components.CreateOutputItemsOpenrouterBrowserUse(components.OutputBrowserUseServerToolItem{/* values here */})

OutputCodeInterpreterServerToolItem

1outputItems := components.CreateOutputItemsOpenrouterCodeInterpreter(components.OutputCodeInterpreterServerToolItem{/* values here */})

OutputDatetimeItem

1outputItems := components.CreateOutputItemsOpenrouterDatetime(components.OutputDatetimeItem{/* values here */})

OutputSearchModelsServerToolItem

1outputItems := components.CreateOutputItemsOpenrouterExperimentalSearchModels(components.OutputSearchModelsServerToolItem{/* values here */})

OutputFileSearchServerToolItem

1outputItems := components.CreateOutputItemsOpenrouterFileSearch(components.OutputFileSearchServerToolItem{/* values here */})

OutputFusionServerToolItem

1outputItems := components.CreateOutputItemsOpenrouterFusion(components.OutputFusionServerToolItem{/* values here */})

OutputImageGenerationServerToolItem

1outputItems := components.CreateOutputItemsOpenrouterImageGeneration(components.OutputImageGenerationServerToolItem{/* values here */})

OutputMcpServerToolItem

1outputItems := components.CreateOutputItemsOpenrouterMcp(components.OutputMcpServerToolItem{/* values here */})

OutputMemoryServerToolItem

1outputItems := components.CreateOutputItemsOpenrouterMemory(components.OutputMemoryServerToolItem{/* values here */})

OutputTextEditorServerToolItem

1outputItems := components.CreateOutputItemsOpenrouterTextEditor(components.OutputTextEditorServerToolItem{/* values here */})

OutputToolSearchServerToolItem

1outputItems := components.CreateOutputItemsOpenrouterToolSearch(components.OutputToolSearchServerToolItem{/* values here */})

OutputWebFetchServerToolItem

1outputItems := components.CreateOutputItemsOpenrouterWebFetch(components.OutputWebFetchServerToolItem{/* values here */})

OutputWebSearchServerToolItem

1outputItems := components.CreateOutputItemsOpenrouterWebSearch(components.OutputWebSearchServerToolItem{/* values here */})

OutputReasoningItem

1outputItems := components.CreateOutputItemsReasoning(components.OutputReasoningItem{/* values here */})

OutputShellCallItem

1outputItems := components.CreateOutputItemsShellCall(components.OutputShellCallItem{/* values here */})

OutputShellCallOutputItem

1outputItems := components.CreateOutputItemsShellCallOutput(components.OutputShellCallOutputItem{/* values here */})

OutputWebSearchCallItem

1outputItems := components.CreateOutputItemsWebSearchCall(components.OutputWebSearchCallItem{/* values here */})

Union Discrimination

Use the Type field to determine which variant is active, then access the corresponding field:

1switch outputItems.Type {
2 case components.OutputItemsTypeApplyPatchCall:
3 // outputItems.OutputApplyPatchCallItem is populated
4 case components.OutputItemsTypeCodeInterpreterCall:
5 // outputItems.OutputCodeInterpreterCallItem is populated
6 case components.OutputItemsTypeComputerCall:
7 // outputItems.OutputComputerCallItem is populated
8 case components.OutputItemsTypeCustomToolCall:
9 // outputItems.OutputCustomToolCallItem is populated
10 case components.OutputItemsTypeFileSearchCall:
11 // outputItems.OutputFileSearchCallItem is populated
12 case components.OutputItemsTypeFunctionCall:
13 // outputItems.OutputFunctionCallItem is populated
14 case components.OutputItemsTypeImageGenerationCall:
15 // outputItems.OutputImageGenerationCallItem is populated
16 case components.OutputItemsTypeMessage:
17 // outputItems.OutputMessageItem is populated
18 case components.OutputItemsTypeOpenrouterAdvisor:
19 // outputItems.OutputAdvisorServerToolItem is populated
20 case components.OutputItemsTypeOpenrouterApplyPatch:
21 // outputItems.OutputApplyPatchServerToolItem is populated
22 case components.OutputItemsTypeOpenrouterBash:
23 // outputItems.OutputBashServerToolItem is populated
24 case components.OutputItemsTypeOpenrouterBrowserUse:
25 // outputItems.OutputBrowserUseServerToolItem is populated
26 case components.OutputItemsTypeOpenrouterCodeInterpreter:
27 // outputItems.OutputCodeInterpreterServerToolItem is populated
28 case components.OutputItemsTypeOpenrouterDatetime:
29 // outputItems.OutputDatetimeItem is populated
30 case components.OutputItemsTypeOpenrouterExperimentalSearchModels:
31 // outputItems.OutputSearchModelsServerToolItem is populated
32 case components.OutputItemsTypeOpenrouterFileSearch:
33 // outputItems.OutputFileSearchServerToolItem is populated
34 case components.OutputItemsTypeOpenrouterFusion:
35 // outputItems.OutputFusionServerToolItem is populated
36 case components.OutputItemsTypeOpenrouterImageGeneration:
37 // outputItems.OutputImageGenerationServerToolItem is populated
38 case components.OutputItemsTypeOpenrouterMcp:
39 // outputItems.OutputMcpServerToolItem is populated
40 case components.OutputItemsTypeOpenrouterMemory:
41 // outputItems.OutputMemoryServerToolItem is populated
42 case components.OutputItemsTypeOpenrouterTextEditor:
43 // outputItems.OutputTextEditorServerToolItem is populated
44 case components.OutputItemsTypeOpenrouterToolSearch:
45 // outputItems.OutputToolSearchServerToolItem is populated
46 case components.OutputItemsTypeOpenrouterWebFetch:
47 // outputItems.OutputWebFetchServerToolItem is populated
48 case components.OutputItemsTypeOpenrouterWebSearch:
49 // outputItems.OutputWebSearchServerToolItem is populated
50 case components.OutputItemsTypeReasoning:
51 // outputItems.OutputReasoningItem is populated
52 case components.OutputItemsTypeShellCall:
53 // outputItems.OutputShellCallItem is populated
54 case components.OutputItemsTypeShellCallOutput:
55 // outputItems.OutputShellCallOutputItem is populated
56 case components.OutputItemsTypeWebSearchCall:
57 // outputItems.OutputWebSearchCallItem is populated
58 default:
59 // Unknown type - use outputItems.GetUnknownRaw() for raw JSON
60}