Use the Type field to determine which variant is active, then access the corresponding field:
switch fileResponse.Type { case components.FileResponseTypeAnthropic: // fileResponse.AnthropicFile is populated case components.FileResponseTypeOpenai: // fileResponse.OpenAIFile is populated case components.FileResponseTypeOpenrouter: // fileResponse.OpenRouterFile is populated default: // Unknown type - use fileResponse.GetUnknownRaw() for raw JSON}
⌘I
Assistant
Responses are generated using AI and may contain mistakes.