-
Notifications
You must be signed in to change notification settings - Fork 24
Conversation
Two things I struggle here with:
|
9d0476a
to
862d3ae
Compare
any comments @chr-hertel ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only minor stuff :) 👍
Implements integration with Fabric patterns from danielmiessler/fabric, providing a collection of pre-built, tested system prompts for common AI tasks. Key features: - Message::fabric() factory method for easy pattern usage - FabricInputProcessor for dynamic pattern loading via chain options - FabricRepository for pattern management with caching - Support for custom pattern locations - Comprehensive test coverage Usage: 1. Install the patterns: composer require php-llm/fabric-pattern 2. Use via factory: Message::fabric('create_summary') 3. Or via processor: $chain->call($messages, ['fabric_pattern' => 'analyze_code']) The implementation requires the separate php-llm/fabric-pattern package to be installed, keeping the main library lightweight while allowing users to opt-in to Fabric patterns functionality. Closes #31 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Remove try/catch blocks for cleaner code - Use simple directory existence check - Update composer.json to only allow fabric-pattern ^0.1
- Repository is now always initialized (either provided or created) - Simplified code by removing null coalescing in processInput
- FabricPromptInterface::getPattern() now returns non-empty-string - FabricPrompt constructor expects non-empty-string for pattern - Improves type safety and PHPStan analysis
- Remove FabricRepository, FabricPrompt, FabricPromptInterface - Remove PatternNotFoundException - Remove support for custom pattern paths - Use php-llm/fabric-pattern's Pattern class directly - Update tests to match new implementation - Update README to remove custom pattern location docs
8b356f9
to
7da2538
Compare
lets release a 1.0? 🤷 |
Oooooh, no, if course ... my trick to install that python thingy doesn't work for transitive dependencies. okay, we need a different approach anyways |
Let's first bring in a new approach to fabric into symfony/ai and then rebuild this please |
Summary
This PR implements support for Fabric patterns in LLM Chain, providing access to a comprehensive collection of pre-built, tested system prompts for common AI tasks.
Implementation Details
Core Components
Message::fabric()
Factory MethodMessage::fabric('create_summary')
php-llm/fabric-pattern
packageFabricInputProcessor
$chain->call($messages, ['fabric_pattern' => 'analyze_code'])
FabricRepository
php-llm/fabric-pattern
package installationException Handling
PatternNotFoundException
for missing patternsDesign Decisions
Separate Package Requirement
php-llm/fabric-pattern
packageMultiple Usage Patterns
Immutable Design
Usage Examples
Via Factory Method
Via Input Processor
Custom Pattern Location
Documentation
examples/fabric/
Testing
final
from FabricRepository)Available Patterns
Some popular patterns include:
create_summary
- Create comprehensive summariesanalyze_claims
- Fact-check and analyze claimsextract_wisdom
- Extract key insightsimprove_writing
- Enhance writing qualityanalyze_code
- Security and quality analysisCloses #31
🤖 Generated with Claude Code