-
Notifications
You must be signed in to change notification settings - Fork 122
Include main classes in canopy's main __init__ #141
Conversation
I've imported the major classes and data models directly under `canopy`. Changed the README, notebook, and docstring examples accordingly
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
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.
I'm not sure we want to import so many things in Canopy highest level because it means that you can't take small parts of it without importing many many stuff (that right now takes more than 4 seconds to import). I'm leaving it to you decision but just noting that putting it in highest level is one way door. Adding some of it later is always possible so you can consider putting non data models stuff outside the canopy init file
@@ -1,4 +1,4 @@ | |||
# Canopy Library | |||
z# Canopy Library |
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.
z# Canopy Library | |
# Canopy Library |
from .knowledge_base import KnowledgeBase | ||
from .context_engine import ContextEngine | ||
from .chat_engine import ChatEngine |
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.
I'm not sure if we want this things to be imported in highest level. It means that even if I just want the chunker from Canopy, I'm going to import many other stuff. Is there anyway around that?
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.
- I still think we should implement the Chunkers themselves in
pinecone-text
, and wrap incanopy
. You need to distinct between the chunker logic, which operates on simple data types (List[str]
) and theChunker
class, which is a sub-component ofKnowledgeBase
.
As I see it, people should usecanopy
if they want the functionality ofKnowledgeBase
orContextEngine
. If someone just needs a Chunker \ Ranker \ Encoder etc - they should take it directly frompinecone-text
. Even if we'll decide to merge them into a mono repo - they would still be two separate packages, with their own dependencies etc. - Regardless of all of the above, the
import
itself should be super light and dependency free. Even if someone wants to use only theKnowledgeBase
without any LLM orChatEngine
- importing theChatEngine
should be quick and hassle free. Any special dependencies should happen on__init__()
, not onimport
. So it should be ok toimport
everything at the root level.
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.
I agree in long term. Right now for both points this is not what we have and we can't tell if ever we will have either. So I wonder if we should not do that until both points or at least the second are true
I am unable to do |
Closing for now, will come back to this in the future |
Problem
The
import
path for some of our classes was too convoluted, making our examples complicated.Solution
canopy
's main__init__.py
Type of Change
Test Plan
None