fix: Add missing Inference.ts module for hook LLM calls#419
Closed
b1ackmartian wants to merge 1 commit intodanielmiessler:mainfrom
Closed
fix: Add missing Inference.ts module for hook LLM calls#419b1ackmartian wants to merge 1 commit intodanielmiessler:mainfrom
b1ackmartian wants to merge 1 commit intodanielmiessler:mainfrom
Conversation
Adds Skills/CORE/Tools/Inference.ts that provides a lightweight wrapper for making LLM inference calls from hooks using the Anthropic Messages API. Features: - Uses native fetch (no external dependencies) - Supports three inference levels: fast (Haiku), standard (Sonnet), complex (Opus) - Handles JSON parsing when expectJson: true - Includes timeout support via AbortController Required by UserPromptSubmit hooks that need LLM-based classification: - AutoWorkCreation.hook.ts - ImplicitSentimentCapture.hook.ts - UpdateTabTitle.hook.ts Fixes danielmiessler#418 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Collaborator
|
Thank you for the Inference.ts module, @b1ackmartian! Clean implementation with the three-tier model approach (fast/standard/complex). v3.0 already includes an Inference.ts utility and the target path ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Inference.tsmodule that several UserPromptSubmit hooks depend onFixes #418
Changes
Packs/pai-core-install/src/skills/CORE/Tools/Inference.tsAPI Signature
Model Mapping
fast: claude-3-5-haiku-latest (cheap, fast, good for classification)standard: claude-sonnet-4-20250514 (balanced)complex: claude-opus-4-5-20251101 (complex reasoning)Test Plan
🤖 Generated with Claude Code