SkillKit.LLM.Metadata (SkillKit v0.1.0)

Copy Markdown View Source

Extracts LLM backend configuration from skill metadata.

Skills declare LLM preferences via spec-compliant flat metadata keys prefixed with skill_kit:backend:*:

metadata:
  skill_kit:backend:provider: anthropic
  skill_kit:backend:model: claude-sonnet-4-20250514
  skill_kit:backend:max-tokens: "4096"

This module parses those keys into a {module, config} tuple suitable for SkillKit.LLM.stream/2.

Summary

Functions

Extracts backend configuration from a skill's metadata map.

Functions

extract_backend(metadata)

@spec extract_backend(map() | nil) ::
  {:ok, {module(), keyword()}} | :default | {:error, term()}

Extracts backend configuration from a skill's metadata map.

Returns:

  • {:ok, {module, opts}} — when a valid provider is found
  • :default — when no skill_kit:backend:* keys are present
  • {:error, {:unknown_provider, name}} — when provider is not recognized