timkley / weaviate-php
用于 Weaviate REST API 的 PHP HTTP 客户端
0.8.0
2024-07-11 09:55 UTC
Requires
- php: ^8.2|^8.3
- guzzlehttp/guzzle: ^7.0
- illuminate/http: ^11.0
Requires (Dev)
- pestphp/pest: ^2.0
- phpstan/phpstan: ^1.8
This package is auto-updated.
Last update: 2024-09-20 11:07:38 UTC
README
这是一个围绕 Weaviate REST API 的包装器。
安装
需求
PHP 8.2 或 PHP 8.3
使用 composer
composer require timkley/weaviate-php
用法
此包支持 API 密钥身份验证(可在 Weaviate 1.18 及更高版本中使用)或匿名访问。请参阅 官方文档 获取更多信息。
<?php use Weaviate\Weaviate; $weaviate = new Weaviate('https://: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();
测试
composer test
致谢
我从现有的包中获得了许多灵感,例如 mailgun/mailgun-php 或 lepikhinb/fathom-api。
当然还有 Weaviate 为提供这个伟大的项目。
感谢您为开源做出贡献!
许可
MIT 许可证(MIT)。请参阅 许可文件 获取更多信息。