-
Notifications
You must be signed in to change notification settings - Fork 17
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
Jj/klaijan/csv #200
base: main
Are you sure you want to change the base?
Jj/klaijan/csv #200
Conversation
@@ -106,6 +107,7 @@ examples: | |||
responses: | |||
"200": | |||
application/json: [{"type": "Title", "element_id": "6aa0ff22f91bbe7e26e8e25ca8052acd", "text": "LayoutParser: A Unified Toolkit for Deep Learning Based Document Image Analysis", "metadata": {"languages": ["eng"], "page_number": 1, "filename": "layout-parser-paper.pdf", "filetype": "application/pdf"}}] | |||
text/csv: "<value>" |
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.
TODO: Figure out how to get the example from the openapi spec in here
@@ -8,4 +8,5 @@ | |||
| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | |||
| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | |||
| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | |||
| `csv_elements` | *Optional[str]* | :heavy_minus_sign: | Successful Response | | |||
| `elements` | List[Dict[str, *Any*]] | :heavy_minus_sign: | Successful Response | |
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.
Q: elements
isn't displayed as optional, but response.elements
is None
when csv_elements
is returned.
@@ -74,6 +74,8 @@ class PartitionResponseTypedDict(TypedDict): | |||
r"""HTTP response status code for this operation""" | |||
raw_response: httpx.Response | |||
r"""Raw HTTP response; suitable for custom response parsing""" | |||
csv_elements: NotRequired[str] | |||
r"""Successful Response""" | |||
elements: NotRequired[List[Dict[str, Any]]] | |||
r"""Successful Response""" | |||
|
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.
NTS: elements
is listed as NotRequired
/Optional
99a4172
to
033bf6c
Compare
Return text/csv when
output_format=OutputFormat.TEXT_CSV