-
Notifications
You must be signed in to change notification settings - Fork 122
Conversation
Init the knowledge base object. | ||
Note: The knowledge base is not connected to the index | ||
until connect() is called. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should probably include a minimal example of how to use a knowledgeBase, something like:
When creating a new Resin service, the user must first create the underlying Pinecone index.
This is a one-time setup process - the index will exist on Pinecone's managed service until it is deleted.>>> kb = KnowLedgeBase('my_index') >>> kb.create_resin_index()In any future interactions, the user simply needs to connect to the existing service:
>>> kb = KnowLedgeBase('my_index') >>> kb.connect() .... kb.upsert(my_documents) knowledge_base.query(queries=[Query(text="Who was the president in 1996?", top_k=10)])
index_params: A dictionary of parameters to pass to the index creation API. | ||
see https://docs.pinecone.io/docs/python-client#create_index |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(@acatav I agree, adding this param to the constructor is really ugly...
I'll try to find a way to remove it and still support from_config
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see my suggested fixes and additions.
And please take them as suggestions only - the final format is up to you.
Co-authored-by: igiloh-pinecone <118673156+igiloh-pinecone@users.noreply.github.com>
…ings-template # Conflicts: # resin/knoweldge_base/base.py
Co-authored-by: igiloh-pinecone <118673156+igiloh-pinecone@users.noreply.github.com>
Co-authored-by: igiloh-pinecone <118673156+igiloh-pinecone@users.noreply.github.com>
Co-authored-by: igiloh-pinecone <118673156+igiloh-pinecone@users.noreply.github.com>
Co-authored-by: igiloh-pinecone <118673156+igiloh-pinecone@users.noreply.github.com>
Co-authored-by: igiloh-pinecone <118673156+igiloh-pinecone@users.noreply.github.com>
Co-authored-by: igiloh-pinecone <118673156+igiloh-pinecone@users.noreply.github.com>
Co-authored-by: igiloh-pinecone <118673156+igiloh-pinecone@users.noreply.github.com>
Co-authored-by: igiloh-pinecone <118673156+igiloh-pinecone@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Let's just make sure we don't line break \ indent in places we shouldn't be (in the rendered docstring)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
# Conflicts: # src/resin/knoweldge_base/knowledge_base.py
Initial docstrings for KB
Type of Change
Test Plan
No need