Skip to content

Conversation

@ianlancetaylor
Copy link
Contributor

Change the pinecone and localvec plugins to use a New function that
returns an ai.Retriever, and an Init function that registers one with genkit.

This makes the pinecone and localvec plugins consistent with each other,
and with other plugins such as googleai.

This will permit code to get a Retriever without looking up an action.
This is how the googleai package works.
@ianlancetaylor ianlancetaylor requested review from jba and ssbushi May 29, 2024 16:46
@ssbushi
Copy link
Contributor

ssbushi commented May 29, 2024

Thanks Ian.

AFAIU, we should use New if we want to use the retriever immediately (without lookup) and Init if we want to make it available within Genkit (eg for other plugins to lookup etc.)

Is that correct?

@ianlancetaylor
Copy link
Contributor Author

@ssbushi Yes, that's correct. We can change that if something else seems better, but let's at least be consistent for now.

// New returns an [ai.Retriever] that uses Pinecone.
//
// apiKey is the API key to use to access Pinecone.
// If it is the empty string, it is read from the PINECONE_API_INDEX
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// If it is the empty string, it is read from the PINECONE_API_INDEX
// If it is the empty string, it is read from the PINECONE_API_KEY

randall77 and others added 3 commits May 29, 2024 10:21
* Clean up doc strings, make them more clickable.

* fix EmbedOptions type
* [Go] Simple RAG sample, using localvec
---------

Co-authored-by: Ian Lance Taylor <iant@golang.org>
@ianlancetaylor
Copy link
Contributor Author

I've somehow broken this pull request by trying to merge other changes. Will start again.

@ianlancetaylor
Copy link
Contributor Author

Replaced by #276. Sorry for the hassle.

@ianlancetaylor ianlancetaylor deleted the iant branch May 29, 2024 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants