Download the PHP package takaaki-mizuno/llm-json-adapter without Composer
On this page you can find all versions of the php package takaaki-mizuno/llm-json-adapter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package llm-json-adapter
LLM JSON Adapter
What is it ?
When using LLMs from the system, you often expect to get output results in JSON: OpenAPI's GPT API has a mechanism called Function Calling, which can return JSON, but Google's Gemini does not seem to have that functionality.
Therefore, I have created a wrapper library to switch LLMs and get results in JSON. What this library can do is as follows.
- Allows you to define the results you want to get in JSON Schema
- Switch between LLMs (currently supports OpenAI's GPT and Google's Gemini).
- Retry a specified number of times if the JSON retrieval fails
Installation
How to use
Use the following code to get the results in JSON.
OpenAI
Google Gemini
BedRock
Ollama
All versions of llm-json-adapter with dependencies
PHP Build Version
Package Version
Requires
php Version
^8.2
guzzlehttp/guzzle Version ^7.8
orhanerday/open-ai Version ^5.1
swaggest/json-schema Version ^0.12.42
aws/aws-sdk-php Version ^3.305
guzzlehttp/guzzle Version ^7.8
orhanerday/open-ai Version ^5.1
swaggest/json-schema Version ^0.12.42
aws/aws-sdk-php Version ^3.305
The package takaaki-mizuno/llm-json-adapter contains the following files
Loading the files please wait ....