assertElicitation checks that the host supports elicitation and returns an error if not.
()
| 1107 | |
| 1108 | // assertElicitation checks that the host supports elicitation and returns an error if not. |
| 1109 | func (s *Session) assertElicitation() error { |
| 1110 | caps := s.Capabilities() |
| 1111 | if caps.UI == nil || !caps.UI.Elicitation { |
| 1112 | return fmt.Errorf("elicitation is not supported by the host; check session.Capabilities().UI.Elicitation before calling UI methods") |
| 1113 | } |
| 1114 | return nil |
| 1115 | } |
| 1116 | |
| 1117 | // Elicitation shows a generic elicitation dialog with a custom schema. |
| 1118 | func (ui *SessionUI) Elicitation(ctx context.Context, message string, requestedSchema ElicitationSchema) (*ElicitationResult, error) { |