Skip to content

Example #18

Description

@IonicaBizau

Hi there,

First of all, thank you very much for the amazing library!

I am having trouble setting this up. I tried to follow the examples from the README file, but it does not seem to work.

<?php
ini_set('display_errors', '1');
ini_set('display_startup_errors', '1');
error_reporting(E_ALL);

require 'vendor/autoload.php';
require 'config.php';
require 'embeddings.php';

use \Probots\Pinecone\Client as Pinecone;

$pineconeApiKey = PINECONE_API_KEY;
$pineconeIndex = 'my-index';

// Initialize clients
$pinecone = new Pinecone($pineconeApiKey);

$respons = $pinecone->index()->list();
if($response->successful()) {
    var_dump($response);
}

I am getting:

_Fatal error: Uncaught ArgumentCountError: Too few arguments to function Probots\Pinecone\Client::_construct(), 1 passed in /home/.../pinecone.php on line 16 and exactly 2 expected in /home/.../probots-io/pinecone-php/src/Client.php:24


Then, I tried to pass the environment, because I saw that in the code: new Pinecone($key, "my-index"); and I had to change to remove control() from the call ($response = $pinecone->control()->index()->list()).

And now I am getting:

Fatal error: Uncaught GuzzleHttp\Exception\ConnectException: cURL error 6: Could not resolve host: controller.my-index.pinecone.io (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://controller.wtm-chat.pinecone.io/databases


I am a little bit lost on how am I supposed to use the library. 😄

Thank you very much.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions