diff --git a/go/plugins/pinecone/genkit.go b/go/plugins/pinecone/genkit.go index ea610aff2..8dd72347d 100644 --- a/go/plugins/pinecone/genkit.go +++ b/go/plugins/pinecone/genkit.go @@ -77,8 +77,7 @@ func Init(ctx context.Context, cfg Config) (err error) { if err != nil { return err } - host := indexData.Host - index, err := client.index(ctx, host) + index, err := client.index(ctx, indexData.Host) if err != nil { return err } @@ -91,8 +90,8 @@ func Init(ctx context.Context, cfg Config) (err error) { embedderOptions: cfg.EmbedderOptions, textKey: cfg.TextKey, } - ai.DefineIndexer(provider, host, r.Index) - ai.DefineRetriever(provider, host, r.Retrieve) + ai.DefineIndexer(provider, cfg.IndexID, r.Index) + ai.DefineRetriever(provider, cfg.IndexID, r.Retrieve) return nil } diff --git a/go/plugins/pinecone/genkit_test.go b/go/plugins/pinecone/genkit_test.go index 5ce167af0..00977ecc4 100644 --- a/go/plugins/pinecone/genkit_test.go +++ b/go/plugins/pinecone/genkit_test.go @@ -90,7 +90,7 @@ func TestGenkit(t *testing.T) { Options: indexerOptions, } t.Logf("index flag = %q, indexData.Host = %q", *testIndex, indexData.Host) - err = ai.Index(ctx, Indexer(indexData.Host), indexerReq) + err = ai.Index(ctx, Indexer(*testIndex), indexerReq) if err != nil { t.Fatalf("Index operation failed: %v", err) } @@ -127,7 +127,7 @@ func TestGenkit(t *testing.T) { Document: d1, Options: retrieverOptions, } - retrieverResp, err := ai.Retrieve(ctx, Retriever(indexData.Host), retrieverReq) + retrieverResp, err := ai.Retrieve(ctx, Retriever(*testIndex), retrieverReq) if err != nil { t.Fatalf("Retrieve operation failed: %v", err) }