Download the PHP package dayemsiddiqui/langfuse-sdk without Composer
On this page you can find all versions of the php package dayemsiddiqui/langfuse-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download dayemsiddiqui/langfuse-sdk
More information about dayemsiddiqui/langfuse-sdk
Files in dayemsiddiqui/langfuse-sdk
Download dayemsiddiqui/langfuse-sdk
More information about dayemsiddiqui/langfuse-sdk
Files in dayemsiddiqui/langfuse-sdk
Vendor dayemsiddiqui
Package langfuse-sdk
Short Description Laravel Langfuse SDK
License MIT
Homepage https://github.com/dayemsiddiqui/langfuse-sdk
Package langfuse-sdk
Short Description Laravel Langfuse SDK
License MIT
Homepage https://github.com/dayemsiddiqui/langfuse-sdk
Please rate this library. Is it a good library?
Informations about the package langfuse-sdk
Laravel Langfuse SDK
A simple Laravel package for working with Langfuse prompts. Fetch, compile, and test AI prompts with ease.
๐ Quick Start
-
Install:
-
Add your API keys to `.env:
- Use in your code:
โจ Features
- Fetch prompts from Langfuse by name
- Compile prompts with variables (e.g.
{{name}}) - Detailed error messages for missing variables
- Elegant testing with
LangfuseFake::fake()(see below)
๐งโ๐ป Usage
Get a Prompt
Compile a Prompt
Handle Missing Variables
If you try to compile a prompt and dont provide all the required variables in a prompt you will get a MissingPromptVariablesException
๐งช Testing (Just like Queue::fake())
Testing your code is easy and elegant!
1. Fake Langfuse in your tests
2. Make assertions
3. Chainable API
4. Use the trait for auto-setup
๐ API Reference (Short)
getPrompt($name)โ returns a PromptBuilderPromptBuilder->raw()โ get raw promptPromptBuilder->compile($vars)โ compile with variablesLangfuseFake::fake([...])โ fake prompts in testsLangfuseFake::getFake()->assertPromptRequested($name)โ assert prompt was used
๐ Advanced
- Dependency Injection: Works with Laravel's container, so you can type-hint
Langfusein your services. - Custom Exception: Get missing variables, provided variables, prompt name/content from the exception.
- Supports both
{{name}}and{{ name }}syntax.
๐ ๏ธ Development
- Run tests:
composer run test - Format code:
composer format - Static analysis:
composer analyse
๐ค Contributing & License
- PRs welcome! See CONTRIBUTING.
- MIT License. See LICENSE.md.
๐ Credits
- Dayem Siddiqui
- All Contributors
All versions of langfuse-sdk with dependencies
PHP Build Version
Package Version
Requires
php Version
^8.2
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^10.0||^11.0||^12.0
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^10.0||^11.0||^12.0
The package dayemsiddiqui/langfuse-sdk contains the following files
Loading the files please wait ...