-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add owner_id to extractors #44
Conversation
backend/server/api/extractors.py
Outdated
@@ -22,6 +22,10 @@ class CreateExtractor(BaseModel): | |||
|
|||
name: str = Field(default="", description="The name of the extractor.") | |||
|
|||
owner_id: UUID = Field( |
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 want this information to come from the request header
@@ -188,7 +188,7 @@ async def extract_entire_document( | |||
text_splitter = TokenTextSplitter( | |||
chunk_size=get_chunk_size(model_name), | |||
chunk_overlap=20, | |||
model_name=model_name, | |||
model_name=DEFAULT_MODEL, |
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.
unrelated bug. for now we'll use gpt 3.5 tokenizer everywhere.
) -> Extractor: | ||
"""Validate the extractor id.""" | ||
extractor = ( | ||
session.query(Extractor).filter_by(uuid=extractor_id, owner_id=owner_id).first() |
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.
.first() -> should usually be .scalar() or .one() if there are unique constraints
) -> List[Any]: | ||
"""Endpoint to get all examples.""" | ||
if not validate_extractor_owner(session, extractor_id, owner_id): |
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 works
Looks great! Merge whenever |
#43
Here we just add the column.