-
Notifications
You must be signed in to change notification settings - Fork 122
Conversation
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.
There some things that need to be changed, namely:
- The mechanism for generating docs (won't work in a PyPI package).
- The new
ContextContentResponse
type - Incorrect documentation of some of the API parameters which are in fact not supported
src/canopy_cli/__init__.py
Outdated
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.
This file definitely doesn't belong in the canopy_cli
directory (package).
Usually, I would put this file somewhere under the repo's root (not inside src
) and use it only in CI. But I get it that you want users to be able to build the documentation locally.
In that case - I'm not even sure this file will be included in the .whl
without explicitly being included in the pyproject.toml
.
Please check what is the best practice for allowing user's to get documentation locally.
src/canopy_cli/cli.py
Outdated
""" | ||
) | ||
) | ||
def docs(): |
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.
Again - I'm not sure that's a conventional practice...
Can't you just do something like:
check_service_health()
webbrowser.open('http://localhost:8000/rdocs')
It's so much simpler and more elegant...
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.
Few small changes
src/canopy_server/__init__.py
Outdated
## Prerequisites | ||
|
||
### Pinecone API key | ||
To get Pinecone free trial API key and environment register or log into your Pinecone account in the console (https://app.pinecone.io/). You can access your API key from the "API Keys" section in the sidebar of your dashboard, and find the environment name next to it. |
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.
We should say 'free' rather than 'free trial' for Pinecone. Trial implies it ends, which our free tier does not
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.
Made various suggestions for usage, correctness, and concision.
src/canopy/models/data_models.py
Outdated
) | ||
metadata: Metadata = Field( | ||
default_factory=dict, | ||
description="The document metadata, to learn more about metadata, see https://docs.pinecone.io/docs/manage-data", # noqa: E501 |
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.
description="The document metadata, to learn more about metadata, see https://docs.pinecone.io/docs/manage-data", # noqa: E501 | |
description="The document metadata. To learn more about metadata, see https://docs.pinecone.io/docs/manage-data", # noqa: E501 |
src/canopy/models/data_models.py
Outdated
@@ -69,12 +88,12 @@ class Role(Enum): | |||
|
|||
|
|||
class MessageBase(BaseModel): | |||
role: Role | |||
content: str | |||
role: Role = Field(description="The role of the messages author.") |
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.
role: Role = Field(description="The role of the messages author.") | |
role: Role = Field(description="The role of the message author.") |
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.
role: Role = Field(description="The role of the messages author.") | |
role: Role = Field(description="The role of the message's author.") |
Co-authored-by: byronnlandry <[email protected]>
Instead of using process._parent_id which is not garuranteed, use `os.getppid()`
This is the official method by the mp module, which should work across all OSes (hopefully..)
It shouldn't theotically happen, but who knows...
This was a horrible name that doesn't represent the true meaning of this class
Per Nathan and Byron's feedback
Co-authored-by: byronnlandry <[email protected]>
This way they are only generated if the user want to generate them locally
Much more readable
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.
Fixed all issues. Ready for merge
This way, running 'canopy --help' prints the errors in the order matching the quick start
This conforms with the naming we use in the documentation
In order to support our current StuffingContextBuilder, I added a new StuffingConxtextContent which inherits from ContextContent and implement to_text() correctly. The app's `/query` path returns a `str`, which is the only guaranteed format of Context. It can be any strucured on unstrucutured data - depending on the ContextBuilder
- Made StuffingContextContent always a List - Slightly improved readability of `StuffingContextBuilder`
I changed the tests to use explicit json.loads()
Minor CLI improvements
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Makes the code more readable and explicit
KISS solution - simply return a different model than the actual internal `Context`
Context must contain a ContextContent that implements to_text()
Problem
FastAPI server needs to be documented
Solution
canopy api-docs
Type of Change
Test Plan
Documentation linting and regression