ChatServer

marola.agent.ChatServer
object ChatServer

A minimal local HTTP server for marola's chat widget (MIP-0033 §5.2): wraps OceanQa.answer + SafetyFooter behind two endpoints, so the static site — reached through a Cloudflare Tunnel to this machine, MIP-0033's chosen path — gets a grounded, footer-carrying answer rather than talking to Ollama's own API directly (which would bypass the corpus and the safety footer entirely).

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
ChatServer.type

Members list

Value members

Concrete methods

def responseFor(question: String, store: KnowledgeStore, llm: Option[LlmClient]): JsonValue < Sync

The one effect is OceanQa.answer's own retrieval/LLM call — response builder, factored out of the HTTP plumbing (and out of AppConfig) so it's unit-testable with a fake LlmClient/ KnowledgeStore, no real config or server needed.

The one effect is OceanQa.answer's own retrieval/LLM call — response builder, factored out of the HTTP plumbing (and out of AppConfig) so it's unit-testable with a fake LlmClient/ KnowledgeStore, no real config or server needed.

Attributes

def start(config: AppConfig, port: Int = ...): HttpServer

Starts the server; the caller owns its lifecycle (.stop(0)).

Starts the server; the caller owns its lifecycle (.stop(0)).

Attributes

Concrete fields

val DefaultPort: Int