Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
170 commits
Select commit Hold shift + click to select a range
0b03a7e
feat(replicate): add complete Replicate provider with all core features
cemarta7 Nov 22, 2025
ded1505
feat: Add an interface for the ability to process speech-to-text asyn…
Dec 2, 2025
4444025
add azure to prism
Matildevoldsen Jan 16, 2026
d81de06
Add Vertex support
machour Feb 5, 2026
3fb1bad
feat: add Qwen (Alibaba Cloud DashScope) provider
leslieeilsel Feb 10, 2026
b98d832
fix(streaming): add null usage fallback to all providers
aimbit-ni Feb 11, 2026
59d0875
feat(openai): add chat/completions api_format config option
aimbit-ni Feb 11, 2026
2edd784
fix(openai): return null from ChatCompletionsToolMap when no tools co…
aimbit-ni Feb 12, 2026
1a14ebe
feat(openai): support citations in chat/completions streaming
aimbit-ni Feb 12, 2026
ec19732
fix azure streaming
Matildevoldsen Mar 1, 2026
d29c47f
track cost in usage for providers like openrouter who return cost in …
vinitkadam03 Feb 22, 2026
654d906
Merge branch 'main' into feat/add-qwen-provider
leslieeilsel Mar 5, 2026
d87faea
feat(zai): add streaming support
delabon Mar 13, 2026
7cd969c
chore: fix Zai stream tests
delabon Mar 13, 2026
724cdaf
chore: remove Zai stream tests that take too much time
delabon Mar 13, 2026
de0717d
refactor: improvements to Zai Stream handler
delabon Mar 14, 2026
adfef17
refactor: add PHPDoc throws
delabon Mar 14, 2026
8c3b47a
feat(batch): implement batch processing for Anthropic provider with j…
joao-salomao Mar 14, 2026
b9256d8
feat(batch): add batch processing capabilities to OpenAI provider wit…
joao-salomao Mar 14, 2026
90a5a9d
Merge remote-tracking branch 'origin/main' into feature/batch-api-for…
joao-salomao Mar 14, 2026
9c4b69c
test(batch): split handlers and test them
joao-salomao Mar 14, 2026
f9a87d0
feat(provider): enhance providerOptions method to accept a default va…
joao-salomao Mar 14, 2026
4f30a6c
feat(batch): introduce new batch request classes and enhance existing…
joao-salomao Mar 14, 2026
a652d85
fix(anthropic): preserve server tool content blocks during multi-step…
lorisleiva Mar 13, 2026
6efb5bd
feat(files): add file management capabilities with upload, download, …
joao-salomao Mar 15, 2026
d64aacb
feat(batch): add Batch Processing and Files API documentation, enhanc…
joao-salomao Mar 15, 2026
27d1ead
fix(phpstan): resolve static analysis errors in Create handler and Te…
joao-salomao Mar 15, 2026
37f7291
test: update response assertions to decode JSON structure
joao-salomao Mar 15, 2026
8f02f2b
feat(batch): enhance BatchJob to include error handling and map error…
joao-salomao Mar 16, 2026
6d902aa
feat(batch): improve error handling in OpenAI results processing and …
joao-salomao Mar 16, 2026
916c9bc
feat(xai): Add XAI image generation handler and tests
timothymarois Mar 17, 2026
4fba5c9
feat(gemini): add topK generation parameter support
Mar 18, 2026
979528e
feat(openai): support fine-tuned models in StructuredModeResolver
danielsimkus Mar 17, 2026
dc9f364
Merge branch 'main' into vertex-support
machour Mar 18, 2026
8656ba7
Fix xAI driver compatibility with OpenAI-compatible endpoints
meirdick Mar 18, 2026
d2ca9bd
Add tool call support to Mistral structured handler
CamilleScholtz Mar 18, 2026
b743e8b
Rework the assistant message mapping for OpenAI provider, so reasonin…
Cbrad24 Mar 23, 2026
5dff1ec
fix(gemini): switch structured output from response_schema to respons…
cainydev Mar 23, 2026
32b2951
feat(gemini): support mixing provider tools with custom function tools
cainydev Mar 23, 2026
2561669
Cast empty tool properties to object in xAI ToolMap
Cbrad24 Mar 24, 2026
e63bace
Initial plan
Copilot Mar 24, 2026
1a69f73
Fix global region hostname in Vertex buildBaseUrl
Copilot Mar 24, 2026
5dd3c3d
Merge pull request #2 from machour/copilot/sub-pr-1
machour Mar 24, 2026
b1c398b
feat(mistral): add reasoning_effort provider option
Mar 24, 2026
34e05da
fix: ToolCall::arguments() returns null for valid JSON null string
obalaweb Mar 26, 2026
086418e
fix(groq): handle Llama models embedding arguments in function name
obalaweb Mar 26, 2026
a946103
fix(groq): accept string values for boolean/number tool parameters
obalaweb Mar 26, 2026
123be2b
feat(anthropic): add fine-grained tool streaming support
alexlampdeveloper Mar 26, 2026
906eef0
fix: correct typo in Prism exception message
burigooth Mar 27, 2026
ff00f86
fix: OpenAI StructuredModeResolver should match versioned model names
ipalaus Mar 28, 2026
a85d46f
fix(openrouter): populate cache and reasoning usage tokens from API r…
kargnas Mar 28, 2026
e59c6c5
feat(openrouter): support cacheTtl provider option for extended cache…
kargnas Mar 28, 2026
83b1dd7
feat(audio): Allow diarization with Mistral
NoelDeMartin Mar 29, 2026
24c4faf
fix: handle unknown finish reasons gracefully across all providers
cainydev Mar 30, 2026
aff210f
fix(gemini): normalize array-type nullable notation in SchemaMap prop…
yondifon Mar 30, 2026
fa31fbf
Anthropic adaptive thinking
GrahamCampbell Mar 30, 2026
120c473
Fix arch tests
GrahamCampbell Mar 30, 2026
913e24b
Add `Usage` to `StepFinishEvent`
Plytas Apr 2, 2026
5d823ac
Add `usage` to `toArray()` and add tests
Plytas Apr 2, 2026
b2fcdf4
Normalize mimeType for audio.wav
barryvdh Apr 2, 2026
b819dc6
Fix mime type from 'audio/x-wav' to 'audio/wav'
barryvdh Apr 2, 2026
dc20d12
Refactor mimeType matching to remove strtolower
barryvdh Apr 2, 2026
026bf90
feat(gemini): add service_tier support for Flex Inference
Apr 3, 2026
a68d4db
feat(anthropic): handle pause_turn and refusal stop reasons
adamthehutt Apr 6, 2026
cf4cc6e
fix(ToolMap): remove static duplicate parameters handling in mapping
Aldiwildan77 Apr 8, 2026
638c9b0
feat(gemini): implement rate limit processing and retry handling
cutlope Apr 10, 2026
f854714
refactor(gemini): rename and replace ProcessRateLimits trait with Pro…
cutlope Apr 11, 2026
a207a10
stash changes: refactor(Tool): improve handler resolution and prevent…
vinitkadam03 Apr 12, 2026
f065b07
feat(openrouter): extract reasoning tokens and reasoning_details from…
pocketarc Mar 15, 2026
db734e1
feat(openrouter): retain raw response body and http status on PrismEx…
pocketarc Apr 14, 2026
442d923
fix: cast empty tool properties to object for Mistral API compatibility
Apr 14, 2026
d4fb098
feat(openrouter): extract upstream provider error messages from metad…
pocketarc Apr 14, 2026
dbf7651
fix(ollama): exclude dimensions and keep_alive from nested options in…
sv-LayZ Apr 15, 2026
2f4968a
style: remove unused imports in embeddings tests
sv-LayZ Apr 15, 2026
4162e61
feat(fim): add FIM request and response handling for Mistral AI
mssayari Apr 15, 2026
e9ec698
feat: add image generation support to Azure provider
Matildevoldsen Apr 19, 2026
7049568
feat: add provider-agnostic withReasoning() request method
ChrisThompsonTLDR May 2, 2026
c6b9134
fix(deepseek): preserve reasoning_content in thinking mode for tool c…
tlotli May 16, 2026
c907dc6
fix(deepseek): extract prompt_cache_hit_tokens and reasoning_tokens f…
Lintume May 22, 2026
5b745cb
fix: add nullable value in enum options
yiedpozi Jun 15, 2026
2a41544
Add Requesty as a provider
Thibaultjaigu Jul 4, 2026
1f5c903
chore: rename package to particle-academy/prism (fork takeover)
wishborn Jul 6, 2026
349461f
Merge prism-php/prism#989 — fix: correct typo in Prism exception message
wishborn Jul 6, 2026
2595220
test: update exception message assertion for typo fix (prism-php/pris…
wishborn Jul 6, 2026
979ba05
Merge prism-php/prism#985 — fix: ToolCall::arguments() returns null f…
wishborn Jul 6, 2026
e87162b
Merge prism-php/prism#977 — fix(xai): cast empty tool properties to o…
wishborn Jul 6, 2026
3cb9f4d
fix: serialize empty tool parameters as JSON object across providers
wishborn Jul 6, 2026
238514b
Merge prism-php/prism#1012 — fix(mistral): cast empty tool properties…
wishborn Jul 6, 2026
ddc083f
refactor(mistral): align empty tool parameters handling with provider…
wishborn Jul 6, 2026
346edd4
Merge prism-php/prism#987 — fix(groq): handle Llama models embedding …
wishborn Jul 6, 2026
e9dddbb
Merge prism-php/prism#1001 — fix(media): normalize wav mimeType varia…
wishborn Jul 6, 2026
7db3482
Merge prism-php/prism#1013 — fix(ollama): exclude top-level keys from…
wishborn Jul 6, 2026
88ae3f3
Merge prism-php/prism#986 — fix(groq): accept string values for boole…
wishborn Jul 6, 2026
7043e5b
fix: escape raw control characters in tool call arguments before deco…
wishborn Jul 6, 2026
3916216
Merge prism-php/prism#996 — fix: handle unknown finish reasons gracef…
wishborn Jul 6, 2026
9798f41
fix(gemini): restore PrismException import dropped by stale prism-php…
wishborn Jul 6, 2026
1a78475
Merge prism-php/prism#991 — fix(openai): StructuredModeResolver match…
wishborn Jul 6, 2026
c93162e
Merge prism-php/prism#1024 — fix(schema): include null in enum option…
wishborn Jul 6, 2026
88a8b50
fix(gemini): exclude null enum entries in SchemaMap; update stale ass…
wishborn Jul 6, 2026
ea5556c
Merge prism-php/prism#1009 — refactor(tool): prevent circular referen…
wishborn Jul 6, 2026
ff073d1
Merge prism-php/prism#1004 — fix(openrouter): remove duplicate parame…
wishborn Jul 6, 2026
5c08d92
test(openrouter): drop unrunnable streaming test from prism-php/prism…
wishborn Jul 6, 2026
02d86b7
Merge prism-php/prism#958 — feat(openai): support fine-tuned models i…
wishborn Jul 6, 2026
655f21e
Merge prism-php/prism#952 — fix(anthropic): preserve server tool cont…
wishborn Jul 6, 2026
5902930
Merge prism-php/prism#971 — fix(openai): interleave reasoning blocks …
wishborn Jul 6, 2026
a9eb9b0
Merge prism-php/prism#964 — fix(xai): compatibility with OpenAI-compa…
wishborn Jul 6, 2026
de2aa70
style: run pint + rector over merged Batch 1 changes
wishborn Jul 6, 2026
6f7f189
fix: resolve PHPStan errors from merged PRs
wishborn Jul 6, 2026
8d4046e
fix(security): resolve all 25 open security alerts
wishborn Jul 6, 2026
bb7d22c
Merge prism-php/prism#975 — fix(gemini): switch structured output to …
wishborn Jul 6, 2026
834c15f
Merge prism-php/prism#997 — fix(gemini): normalize array-type nullabl…
wishborn Jul 6, 2026
dfde61c
Merge prism-php/prism#1000 — fix(gemini): add Usage to StepFinishEvent
wishborn Jul 6, 2026
34f06c0
fix(gemini): pass native JSON Schema to response_json_schema
wishborn Jul 6, 2026
e3c5a9a
Merge prism-php/prism#961 — feat(gemini): add topK generation paramet…
wishborn Jul 6, 2026
d30caeb
Merge prism-php/prism#1002 — feat(gemini): add service_tier support f…
wishborn Jul 6, 2026
611fb90
Merge prism-php/prism#976 — feat(gemini): support mixing provider too…
wishborn Jul 6, 2026
1f2bda2
Merge prism-php/prism#1008 — feat(gemini): extract rate limit violati…
wishborn Jul 6, 2026
478303d
Merge prism-php/prism#1021 — fix(deepseek): extract prompt_cache_hit_…
wishborn Jul 6, 2026
1f5eb7d
Merge prism-php/prism#1020 — fix(deepseek): preserve reasoning_conten…
wishborn Jul 6, 2026
7cbb1cb
Merge prism-php/prism#992 — fix(openrouter): populate cache and reaso…
wishborn Jul 6, 2026
3a50bb8
Merge prism-php/prism#993 — feat(openrouter): support cacheTtl provid…
wishborn Jul 6, 2026
e0dc5d6
Merge prism-php/prism#954 — feat(openrouter): extract reasoning token…
wishborn Jul 6, 2026
20e5b10
Merge prism-php/prism#965 — fix(mistral): support tool calls in struc…
wishborn Jul 6, 2026
f65fdce
Merge prism-php/prism#980 — feat(mistral): add reasoning_effort provi…
wishborn Jul 6, 2026
7364ddf
Merge prism-php/prism#995 — feat(mistral): allow audio diarization
wishborn Jul 6, 2026
c486b5b
Merge prism-php/prism#949 — feat(zai): add streaming support
wishborn Jul 6, 2026
b8ba324
style: run pint + rector over merged Batch 2 changes
wishborn Jul 6, 2026
11800c9
Merge prism-php/prism#1003 — feat(anthropic): handle pause_turn and r…
wishborn Jul 6, 2026
e2951ae
Merge prism-php/prism#988 — feat(anthropic): add fine-grained tool st…
wishborn Jul 6, 2026
e396541
Merge prism-php/prism#998 — feat(anthropic): adaptive thinking and ou…
wishborn Jul 6, 2026
9defb79
Merge prism-php/prism#1018 — feat: add provider-agnostic withReasonin…
wishborn Jul 6, 2026
397a7b3
fix(anthropic): honor withReasoning(false) in resolveThinking
wishborn Jul 6, 2026
b9a82d4
Merge prism-php/prism#1014 — feat(mistral): add FIM (fill-in-the-midd…
wishborn Jul 6, 2026
dfbaf8e
Merge prism-php/prism#960 — feat(xai): add image generation handler
wishborn Jul 6, 2026
4b37140
Merge prism-php/prism#978 — feat(vertex): add Google Vertex AI provider
wishborn Jul 6, 2026
b20cefc
Merge prism-php/prism#1026 — feat(requesty): add Requesty provider
wishborn Jul 6, 2026
fee9572
fix(requesty): align new provider with fork conventions + backfill tests
wishborn Jul 6, 2026
fa3a886
fix(vertex): repair ADC credentials fallback and type safety
wishborn Jul 6, 2026
8f2003b
Merge prism-php/prism#951 — feat: batching and files APIs for Anthrop…
wishborn Jul 6, 2026
7cfe23c
fix(batch): repair merge fallout and make Anthropic payload guard tes…
wishborn Jul 6, 2026
c86c440
style: run pint + rector over merged Batch 3 changes
wishborn Jul 6, 2026
23b204a
Merge prism-php/prism#810 — feat(audio): add async speech-to-text int…
wishborn Jul 6, 2026
13a3dff
Merge prism-php/prism#920 — feat: track cost in Usage for providers t…
wishborn Jul 6, 2026
371dcd7
Merge prism-php/prism#907 — feat(openai): chat/completions api_format…
wishborn Jul 6, 2026
a091039
Merge prism-php/prism#835 — feat(azure): add Azure OpenAI provider wi…
wishborn Jul 6, 2026
cf46838
fix(azure): use protected visibility per arch rules (prism-php/prism#…
wishborn Jul 6, 2026
5b77f72
Merge prism-php/prism#898 — feat(qwen): add Qwen (Alibaba Cloud DashS…
wishborn Jul 6, 2026
dc92c10
Merge prism-php/prism#757 — feat(replicate): add Replicate provider
wishborn Jul 6, 2026
7b24105
fix(replicate): pass providerToolCalls to Step (prism-php/prism#757 f…
wishborn Jul 6, 2026
1d0d2c0
fix: resolve PHPStan errors in Azure, Qwen and Replicate providers
wishborn Jul 6, 2026
6c1c6c0
feat(tool): coerce string arguments to declared scalar and BackedEnum…
wishborn Jul 6, 2026
9cad60f
feat(anthropic): support per-request beta features via anthropic_beta…
wishborn Jul 6, 2026
d1ffd4a
test(groq): cover Llama function-name splitting end-to-end (issue #3 …
wishborn Jul 6, 2026
47f4720
style: run pint + rector over Batch 4 changes
wishborn Jul 6, 2026
c85da4b
feat: client-executed tools and human-in-the-loop approval flow
wishborn Jul 7, 2026
7b48fa6
fix(replicate): harden generated-image auto-download (closes #5)
wishborn Jul 7, 2026
7d9793a
style: pint + rector over Batch 5 changes
wishborn Jul 7, 2026
a50139a
feat: roll out client-executed tools + approval flow to all providers
wishborn Jul 7, 2026
a959531
feat: emit HITL events in Anthropic and OpenAI streams
wishborn Jul 7, 2026
b44a7c2
docs: human-in-the-loop guide (client tools + approval flow)
wishborn Jul 7, 2026
a9a3549
style: pint + rector over phase 2 changes
wishborn Jul 7, 2026
7fe66a7
feat: HITL streaming for all remaining provider streams
wishborn Jul 7, 2026
4d20868
test(mistral): backfill fixture tests for structured tool-call loop (…
wishborn Jul 7, 2026
9d595e9
test(openrouter): re-add streaming payload test for parameterless too…
wishborn Jul 7, 2026
5b6af16
Merge issue-3-followups — test backfills for Mistral structured tools…
wishborn Jul 7, 2026
805baab
fix: exclude cached tokens from promptTokens in OpenRouter, Vertex an…
wishborn Jul 7, 2026
5f0bd4f
fix: report cached tokens and stop double counting across seven provi…
wishborn Jul 7, 2026
929322a
chore: declare real dependencies and gate them with composer-require-…
wishborn Jul 7, 2026
dccfa9a
fix: streaming buffering (DeepSeek/Qwen), malformed tool-call JSON, O…
wishborn Jul 7, 2026
183fde5
docs: document Usage token semantics and the completionTokens inconsi…
wishborn Jul 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@
/Taskfile.yml export-ignore
/testbench.yaml export-ignore
/whisky.json export-ignore
/dev export-ignore
/composer-require-checker.json export-ignore
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- Please review our contributing guidelines https://github.com/prism-php/prism/blob/main/.github/CONTRIBUTING.md -->
<!-- Please review our contributing guidelines https://github.com/Particle-Academy/prism/blob/main/.github/CONTRIBUTING.md -->
## Description

## Breaking Changes
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/formatting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
- "*.x"
pull_request:

permissions:
contents: read

env:
phpv: 8.2

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
- "*.x"
pull_request:

permissions:
contents: read

env:
phpv: 8.2

Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/require-checker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Require Checker

on:
push:
branches:
- main
- "*.x"
pull_request:

permissions:
contents: read

env:
phpv: 8.2

jobs:
require-checker:
name: composer-require-checker
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ env.phpv }}
coverage: none
tools: composer-require-checker

- name: Install composer dependencies
uses: ramsey/composer-install@v3

- name: Check declared dependencies match used symbols
run: composer-require-checker check --config-file=composer-require-checker.json composer.json
8 changes: 4 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
- "*.x"
pull_request:

permissions:
contents: read

jobs:
test:
runs-on: ${{ matrix.os }}
Expand All @@ -16,12 +19,9 @@ jobs:
matrix:
os: [ubuntu-latest]
php: [8.2, 8.3, 8.4]
laravel: [11.*, 12.*, 13.*]
laravel: [12.*, 13.*]
stability: [prefer-lowest, prefer-stable]
include:
- laravel: 11.*
testbench: 9.*
carbon: ^2.63
- laravel: 12.*
testbench: 10.*
carbon: ^3.8.4
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ phpunit.xml
ray.php
CLAUDE.md
.phpunit.result.cache
AGENTS.md
.ddev/
.claude/
25 changes: 18 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,30 @@
</p>

<p align="center">
<a href="https://packagist.org/packages/prism-php/prism">
<img src="https://poser.pugx.org/prism-php/prism/d/total.svg" alt="Total Downloads">
<a href="https://packagist.org/packages/particle-academy/prism">
<img src="https://poser.pugx.org/particle-academy/prism/d/total.svg" alt="Total Downloads">
</a>
<a href="https://packagist.org/packages/prism-php/prism">
<img src="https://poser.pugx.org/prism-php/prism/v/stable.svg" alt="Latest Stable Version">
<a href="https://packagist.org/packages/particle-academy/prism">
<img src="https://poser.pugx.org/particle-academy/prism/v/stable.svg" alt="Latest Stable Version">
</a>
<a href="https://packagist.org/packages/prism-php/prism">
<img src="https://poser.pugx.org/prism-php/prism/license.svg" alt="License">
<a href="https://packagist.org/packages/particle-academy/prism">
<img src="https://poser.pugx.org/particle-academy/prism/license.svg" alt="License">
</a>
</p>

# Prism

> [!IMPORTANT]
> **This is the actively maintained [Particle Academy](https://github.com/Particle-Academy) fork of [`prism-php/prism`](https://github.com/prism-php/prism).**
> Upstream has been unmaintained since March 2026; this fork continues development,
> absorbing the community's outstanding fixes and features. The package is published
> as **`particle-academy/prism`** (the `Prism\Prism` namespace is unchanged, so it is
> a drop-in replacement):
>
> ```
> composer require particle-academy/prism
> ```

Prism is a powerful Laravel package for integrating Large Language Models (LLMs) into your applications. It provides a fluent interface for generating text, handling multi-step conversations, and utilizing tools with various AI providers. This way, you can focus on developing outstanding AI applications for your users without getting lost in the technical intricacies.

## Official Documentation
Expand All @@ -28,7 +39,7 @@ While we aren't affiliated with Laravel, we follow the Laravel [Code of Conduct]

## Authors

This library is created by [TJ Miller](https://tjmiller.me) with contributions from the [Open Source Community](https://github.com/prism-php/prism/graphs/contributors).
This library is created by [TJ Miller](https://tjmiller.me) with contributions from the [Open Source Community](https://github.com/Particle-Academy/prism/graphs/contributors).

## License

Expand Down
10 changes: 10 additions & 0 deletions composer-require-checker.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"symbol-whitelist": [
"Laravel\\Mcp\\Request",
"Laravel\\Mcp\\Response",
"Laravel\\Mcp\\ResponseFactory",
"Laravel\\Mcp\\Server\\Tool",
"Laravel\\Mcp\\Support\\ValidationMessages",
"PHPUnit\\Framework\\Assert"
]
}
16 changes: 12 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "prism-php/prism",
"description": "A powerful Laravel package for integrating Large Language Models (LLMs) into your applications.",
"name": "particle-academy/prism",
"description": "A powerful Laravel package for integrating Large Language Models (LLMs) into your applications. Actively maintained fork of prism-php/prism.",
"type": "library",
"license": "MIT",
"autoload": {
Expand All @@ -20,7 +20,14 @@
"require": {
"php": "^8.2",
"ext-fileinfo": "*",
"laravel/framework": "^11.0|^12.0|^13.0"
"ext-mbstring": "*",
"ext-openssl": "*",
"laravel/framework": "^12.61.1|^13.12.0",
"psr/http-message": "^1.1|^2.0",
"symfony/http-foundation": "^7.2|^8.0"
},
"suggest": {
"laravel/mcp": "Required to expose Prism tools through a Laravel MCP server (LaravelMcpTool)."
},
"config": {
"allow-plugins": {
Expand All @@ -40,7 +47,7 @@
"phpstan/phpstan-deprecation-rules": "^2.0",
"rector/rector": "2.3.3",
"projektgopher/whisky": "^0.7.0",
"orchestra/testbench": "^9|^10|^11",
"orchestra/testbench": "^10|^11",
"mockery/mockery": "^1.6",
"symplify/rule-doc-generator-contracts": "^11.2",
"phpstan/phpdoc-parser": "^2.0",
Expand All @@ -49,6 +56,7 @@
},
"autoload-dev": {
"psr-4": {
"Prism\\Dev\\": "dev/",
"Tests\\": "tests/",
"Workbench\\App\\": "workbench/app/",
"Workbench\\Database\\Factories\\": "workbench/database/factories/",
Expand Down
35 changes: 35 additions & 0 deletions config/prism.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
'api_key' => env('OPENAI_API_KEY', ''),
'organization' => env('OPENAI_ORGANIZATION', null),
'project' => env('OPENAI_PROJECT', null),
'api_format' => env('OPENAI_API_FORMAT', 'responses'),
],
'anthropic' => [
'api_key' => env('ANTHROPIC_API_KEY', ''),
Expand Down Expand Up @@ -61,10 +62,44 @@
'x_title' => env('OPENROUTER_SITE_X_TITLE', null),
],
],
'replicate' => [
'api_key' => env('REPLICATE_API_KEY', ''),
'url' => env('REPLICATE_URL', 'https://api.replicate.com/v1'),
'webhook_url' => env('REPLICATE_WEBHOOK_URL', null),
'use_sync_mode' => env('REPLICATE_USE_SYNC_MODE', true), // Use Prefer: wait header
'polling_interval' => env('REPLICATE_POLLING_INTERVAL', 1000),
'max_wait_time' => env('REPLICATE_MAX_WAIT_TIME', 60),
// Hosts generated images may be auto-downloaded from (https only).
'download_hosts' => ['replicate.delivery'],
],
'qwen' => [
'api_key' => env('QWEN_API_KEY', ''),
'url' => env('QWEN_URL', 'https://dashscope-intl.aliyuncs.com/api/v1'),
],
'azure' => [
'url' => env('AZURE_AI_URL', ''),
'api_key' => env('AZURE_AI_API_KEY', ''),
'api_version' => env('AZURE_AI_API_VERSION', '2024-10-21'),
'deployment_name' => env('AZURE_AI_DEPLOYMENT', ''),
],
'requesty' => [
'api_key' => env('REQUESTY_API_KEY', ''),
'url' => env('REQUESTY_URL', 'https://router.requesty.ai/v1'),
'site' => [
'http_referer' => env('REQUESTY_SITE_HTTP_REFERER', null),
'x_title' => env('REQUESTY_SITE_X_TITLE', null),
],
],
'perplexity' => [
'api_key' => env('PERPLEXITY_API_KEY', ''),
'url' => env('PERPLEXITY_URL', 'https://api.perplexity.ai'),
],
'vertex' => [
'project_id' => env('VERTEX_PROJECT_ID', ''),
'region' => env('VERTEX_REGION', 'us-central1'),
'access_token' => env('VERTEX_ACCESS_TOKEN', null),
'credentials_path' => env('VERTEX_CREDENTIALS_PATH', null),
],
'z' => [
'url' => env('Z_URL', 'https://api.z.ai/api/paas/v4'),
'api_key' => env('Z_API_KEY', ''),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Prism\Prism\Rectors;
namespace Prism\Dev\Rectors;

use PhpParser\Node;
use PhpParser\Node\Stmt;
Expand Down
20 changes: 20 additions & 0 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ export default defineConfig({
text: "Tool & Function Calling",
link: "/core-concepts/tools-function-calling",
},
{
text: "Human-in-the-Loop",
link: "/core-concepts/human-in-the-loop",
},
{
text: "Structured Output",
link: "/core-concepts/structured-output",
Expand All @@ -133,6 +137,14 @@ export default defineConfig({
text: "Audio",
link: "/core-concepts/audio",
},
{
text: "Batch Processing",
link: "/core-concepts/batch",
},
{
text: "Files",
link: "/core-concepts/files",
},
{
text: "Schemas",
link: "/core-concepts/schemas",
Expand Down Expand Up @@ -211,6 +223,14 @@ export default defineConfig({
text: "OpenRouter",
link: "/providers/openrouter",
},
{
text: "Replicate",
link: "/providers/replicate",
text: "Qwen",
link: "/providers/qwen",
text: "Requesty",
link: "/providers/requesty",
},
{
text: "Voyage AI",
link: "/providers/voyageai",
Expand Down
38 changes: 38 additions & 0 deletions docs/components/ProviderSupport.vue
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,19 @@ export default {
documents: Supported,
moderation: Unsupported,
},
{
name: "Requesty",
text: Supported,
streaming: Supported,
structured: Supported,
embeddings: Unsupported,
image: Supported,
"speech-to-text": Unsupported,
"text-to-speech": Unsupported,
tools: Supported,
documents: Supported,
moderation: Unsupported,
},
{
name: "OpenAI",
text: Supported,
Expand All @@ -341,6 +354,31 @@ export default {
documents: Supported,
moderation: Supported,
},
{
name: "Qwen",
text: Supported,
streaming: Supported,
structured: Supported,
embeddings: Supported,
image: Supported,
"speech-to-text": Unsupported,
"text-to-speech": Unsupported,
tools: Supported,
documents: Unsupported,
moderation: Unsupported,
},
{
name: "Replicate",
text: Supported,
streaming: Supported,
structured: Supported,
embeddings: Supported,
image: Supported,
"speech-to-text": Supported,
"text-to-speech": Supported,
tools: Unsupported,
documents: Unsupported,
},
{
name: "VoyageAI",
text: Unsupported,
Expand Down
Loading