Karn (Karn v1.0.0)

A client interface for interacting with the main AI service

This module provides convenient functions for querying the AI, explaining code or modules, viewing/managing the conversation context,viewing usage and stopping the service.

Usage Example

# Query the AI
Karn.q("What is the difference between Elixir and Erlang?")

# Explain a module with specific references
Karn.e(MyModule, [MyModule.A, DependentModule], "How does function xyz work?")

# View the current conversation context
Karn.view_context()

# Reset the conversation context
Karn.reset_context()

# View usage()
Karn.usage()

# switch model
Karn.switch_model("google:gemini-2.0")

# reset model
Karn.reset_model

Summary

Functions

e(mod)

See Karn.AI.e/1.

e(mod, q_or_refs)

See Karn.AI.e/2.

e(mod, refs, q)

See Karn.AI.e/3.

q(cmd)

See Karn.AI.q/1.

reset_context(sys \\ nil)

See Karn.AI.reset_context/1.

reset_model()

See Karn.AI.reset_model/0.

start()

See Karn.AI.start/0.

start(opts)

See Karn.AI.start/1.

stop()

See Karn.AI.stop/0.

switch_model(model)

See Karn.AI.switch_model/1.

usage()

See Karn.AI.usage/0.

view_context()

See Karn.AI.view_context/0.

view_state()

See Karn.AI.view_state/0.