extractBaseSafeOutputConfig returns the embedded BaseSafeOutputConfig of the non-nil safe-output config at SafeOutputsConfig. , or nil if the field is unset or the struct does not embed BaseSafeOutputConfig.
(config *SafeOutputsConfig, fieldName string)
| 128 | // non-nil safe-output config at SafeOutputsConfig.<fieldName>, or nil if the |
| 129 | // field is unset or the struct does not embed BaseSafeOutputConfig. |
| 130 | func extractBaseSafeOutputConfig(config *SafeOutputsConfig, fieldName string) *BaseSafeOutputConfig { |
| 131 | field, ok := safeOutputPointerFieldValue(config, fieldName) |
| 132 | if !ok || field.IsNil() { |
| 133 | return nil |
| 134 | } |
| 135 | elem := field.Elem() |
| 136 | if elem.Kind() != reflect.Struct { |
| 137 | return nil |
| 138 | } |
| 139 | baseField := elem.FieldByName("BaseSafeOutputConfig") |
| 140 | if !baseField.IsValid() || !baseField.CanAddr() { |
| 141 | return nil |
| 142 | } |
| 143 | if base, ok := baseField.Addr().Interface().(*BaseSafeOutputConfig); ok { |
| 144 | return base |
| 145 | } |
| 146 | return nil |
| 147 | } |
| 148 | |
| 149 | // validateSamplesForTool validates each sample against the named MCP tool's |
| 150 | // inputSchema after stripping recognized sidecar fields. |
no test coverage detected