# frozen_string_literal: true module Sermo # The conversational core of SERMO-DOS. # # Anything typed at the C:\> prompt that is not a built-in DOS command is # routed here (via the FakeOS `on_unknown` hook). For now it returns canned, # in-character replies so the machine feels alive. # # THIS IS THE LLM INTEGRATION POINT: to make SERMO actually think, replace # the body of `answer` with a call to your model (e.g. the Claude API) and # return its text. Nothing else in the project needs to change. module Oracle def self.answer(question, _ctx = {}) text = question.to_s.strip case text.downcase when /\b(hello|hi|hey|szia|hell[oó])\b/ 'Greetings, caller. SERMO-DOS is listening.' when /\bwho are you\b/, /\bmi vagy\b/ 'I am SERMO-DOS — a conversational disk operating system.' when /\b(thanks|thank you|k[oö]sz)\b/ 'You are welcome.' else [ 'My conversational core is not yet connected to a brain.', %(You said: "#{text}"), '(Wire Sermo::Oracle.answer to an LLM to make me think.)' ].join("\n") end end end end