timkley / weaviate-php
A PHP HTTP Client for the Weaviate REST API
Installs: 17 060
Dependents: 2
Suggesters: 0
Security: 0
Stars: 27
Watchers: 3
Forks: 9
Open Issues: 0
Requires
- php: ^8.2|^8.3
- guzzlehttp/guzzle: ^7.0
- illuminate/http: ^11.0
Requires (Dev)
- pestphp/pest: ^2.0
- phpstan/phpstan: ^1.8
README
This is a wrapper around the Weaviate REST API.
Installation
Requirements
PHP 8.2 or PHP 8.3
With composer
composer require timkley/weaviate-php
Usage
This package supports API key authentication (available in Weaviate 1.18 and higher) or anonymous access. Please refer to the official documentation for more information.
<?php use Weaviate\Weaviate; $weaviate = new Weaviate('http://localhost:8080', 'your-token'); // using the GraphQL API $weaviate->graphql()->get('{ Get { Things { Article { title } } } }'); // using the `batch` REST API $weaviate->batch()->create($objects); // adding query parameters $weaviate->dataObject()->withQueryParameters(['limit' => 10])->get();
Testing
composer test
Credits
I took a lot of inspiration from existing packages like mailgun/mailgun-php or lepikhinb/fathom-api.
And of course Weaviate for providing this great project.
Thanks for contributing to open source!
License
The MIT License (MIT). Please see License File for more information.