Skip to main content

SAGE Libs Intent (L3) - Keyword-based and LLM-based intent classification for conversational AI

Project description

sage-libs-intent

L3 intent recognition package for SAGE agentic workflows.

  • PyPI: isage-libs-intent
  • Import path: sage_libs.sage_agentic.intent

Scope

This package only provides intent recognition logic and data structures.

  • KeywordIntentRecognizer: keyword and heuristic intent classification
  • LLMIntentRecognizer: LLM-based intent classification
  • selector mode: explicit integration with isage-agentic KeywordSelector
  • IntentClassifier: chain wrapper over recognizers
  • Intent catalog and typed intent/domain results

Boundary

  • Intent package does not depend on tool-selection internals.
  • Recognizer build path is explicit and deterministic.
  • Package exports are explicit and fail-fast.

Recognizer Modes

  • keyword: built-in keyword and heuristic recognizer
  • llm: LLM recognizer via OpenAI-compatible gateway
  • selector: explicit bridge to isage-agentic KeywordSelector

selector mode has no fallback behavior. If isage-agentic tool-selection modules are not available, construction fails immediately with ModuleNotFoundError.

Installation

pip install isage-libs-intent

Quick Start

import asyncio

from sage_libs.sage_agentic.intent import IntentClassifier


async def main() -> None:
    classifier = IntentClassifier(mode="keyword")
    result = await classifier.classify("请帮我找一下 SAGE 的安装文档")
    print(result.intent.value, result.confidence)


asyncio.run(main())

LLM Recognizer Example

import asyncio

from sage_libs.sage_agentic.intent import LLMIntentRecognizer, IntentRecognitionContext


async def main() -> None:
    recognizer = LLMIntentRecognizer(control_plane_url="http://localhost:8080/v1")
    result = await recognizer.classify(IntentRecognitionContext(message="Explain SAGE pipeline API"))
    print(result.intent.value, result.confidence)


asyncio.run(main())

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

isage_libs_intent-0.1.0.8.tar.gz (14.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

isage_libs_intent-0.1.0.8-py2.py3-none-any.whl (18.0 kB view details)

Uploaded Python 2Python 3

File details

Details for the file isage_libs_intent-0.1.0.8.tar.gz.

File metadata

  • Download URL: isage_libs_intent-0.1.0.8.tar.gz
  • Upload date:
  • Size: 14.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for isage_libs_intent-0.1.0.8.tar.gz
Algorithm Hash digest
SHA256 2604424f12df53c34ebaa0cc438c9cf16bd8233f260f170bb51dd916a5e4f9c2
MD5 7152fc71acc82a4335647e57a10d4396
BLAKE2b-256 dafd9f0dfac1ef7b40171d63ba06865829295932482a14f1fd41969910a96480

See more details on using hashes here.

File details

Details for the file isage_libs_intent-0.1.0.8-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for isage_libs_intent-0.1.0.8-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 7a75c43f2a9539ed0a675fbdcd5001c4932407524dc2d297645ec3e3e01a0564
MD5 2a0477df37b610d65ad7bd114ee63582
BLAKE2b-256 9981fc8294da3ceb62856ba652291af438536c4bb6b3d9a6d9420fe2688d593a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page