Skip to content

feat: classify_satisfaction — semantic user satisfaction detection v1.11.1#166

Merged
devonakelley merged 1 commit intomainfrom
feat/classify-satisfaction
Apr 24, 2026
Merged

feat: classify_satisfaction — semantic user satisfaction detection v1.11.1#166
devonakelley merged 1 commit intomainfrom
feat/classify-satisfaction

Conversation

@devonakelley
Copy link
Copy Markdown
Contributor

Adds semantic satisfaction classification — no keyword matching.

from kalibr import classify_satisfaction, user_rejected, user_accepted

result = classify_satisfaction(
    user_message=user_follow_up,
    prior_output=last_kalibr_output,
)
if result == 'negative':
    user_rejected()
elif result == 'positive':
    user_accepted()

Uses a cheap LLM (DeepSeek first, then GPT-4o-mini, then Claude Haiku) to semantically interpret user intent. Fails open to 'neutral' when no provider key available — never blocks.

….11.1

Adds classify_satisfaction(user_message, prior_output) -> 'negative'|'positive'|'neutral'

Uses a cheap LLM (DeepSeek → GPT-4o-mini → Claude Haiku) to semantically interpret
whether the user's follow-up message indicates satisfaction with the prior output.
No keyword matching. Fails open (returns 'neutral') when no provider key available.

Also adds classify_satisfaction_async() for fire-and-forget usage in agent loops.

Exported from kalibr top-level: from kalibr import classify_satisfaction

Usage:
  result = classify_satisfaction(user_message, prior_output)
  if result == 'negative':
      user_rejected()
  elif result == 'positive':
      user_accepted()
@devonakelley devonakelley merged commit 05d9c06 into main Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant