timkley / weaviate-php Goto Github PK
View Code? Open in Web Editor NEWA PHP client to communicate with a Weaviate instance
License: MIT License
A PHP client to communicate with a Weaviate instance
License: MIT License
Hello everyone,
I had set up the weaviate with no authentication, and here's my docker-compose setting for weavaiate:
weaviate: command: - --host - 0.0.0.0 - --port - '8080' - --scheme - http image: semitechnologies/weaviate:1.20.1 ports: - "8080:8080" restart: on-failure volumes: - /var/weaviate:/var/lib/weaviate environment: QUERY_DEFAULTS_LIMIT: 25 AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED: 'true' PERSISTENCE_DATA_PATH: '/var/lib/weaviate' DEFAULT_VECTORIZER_MODULE: 'none' ENABLE_MODULES: '' CLUSTER_HOSTNAME: 'node1'
My first problem is when using this package, the way it is developed, it required the API token as a required parameter.
$weaviate = new Weaviate('http://0.0.0.0:8080/v1','api-token');
,
Now if I don't have any API token then how can I provide it here because it cannot be empty?
can anyone help me here:
Also, the weaviate is running I can access this URL on the browser but when i call its other function like:
dd($weaviate->dataObject()->get());
it gives me connection refused error.
is there anything I am missing here or do we need to work on that API token parameter?
Hi,
I'm trying to test weaviate-php with Weaviate version 1.22.0 and I get this error:
C:\WORKAREA\Projects\cloudconversa\weaviate-php>php weaviate.php
PHP Fatal error: Uncaught Weaviate\Exceptions\NotFoundException: The requested ressource http://localhost:7070/objects could not be found. in C:\WORKAREA\Projects\cloudconversa\weaviate-php\vendor\timkley\weaviate-php\src\Api.php:130
Stack trace:
#0 C:\WORKAREA\Projects\cloudconversa\weaviate-php\vendor\timkley\weaviate-php\src\Api.php(46): Weaviate\Api->response()
#1 C:\WORKAREA\Projects\cloudconversa\weaviate-php\vendor\timkley\weaviate-php\src\Api\DataObject.php(16): Weaviate\Api->get()
#2 C:\WORKAREA\Projects\cloudconversa\weaviate-php\weaviate.php(8): Weaviate\Api\DataObject->get()
#3 {main}
thrown in C:\WORKAREA\Projects\cloudconversa\weaviate-php\vendor\timkley\weaviate-php\src\Api.php on line 130
The code I'm trying to run is the following:
<?php
include 'vendor/autoload.php';
use Weaviate\Weaviate;
$weaviate = new Weaviate('http://localhost:8080', 'password');
$objects = $weaviate->dataObject()->get();
var_dump($objects);
Seems that actually Weaviate API's changed the base url prepending "/v1" to all endpoints API.
Infact changing the configuration to $weaviate = new Weaviate('http://localhost:8080/v1', 'password');
solve the problem.
I don't know if the oldest versions of Weaviate was without "/v1", but with the newest version is mandatory.
https://weaviate.io/developers/weaviate/api#references---restful-api
If you need help, please ask me. I'll be happy to help you!
Thank you,
Denis
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.