feat: Allow application/yaml as mime_type#2575
Conversation
|
Hi @onmete! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
|
I understand it might not be the best solution, because it opens up a can of worms on what and how many types of documents should be supported. :) Our application (build on top of llama-stack), supports these types |
|
|
||
| async def get_raw_document_text(document: Document) -> str: | ||
| if not document.mime_type.startswith("text/"): | ||
| if not (document.mime_type.startswith("text/") or document.mime_type == "application/yaml"): |
There was a problem hiding this comment.
text/yaml is considered deprecated
Deprecated alias names for this type: ...
text/yaml...
Therefore application/yaml is the only official MIME Type for YAML documents.
There was a problem hiding this comment.
I believe the current code does not address @manstis comment. Should we fail if mime_type="text/yaml"?
There was a problem hiding this comment.
I believe that is another issue, how to handle the deprecated mime type.
Would you have any preference if I should include/allow more types (json/xml) in this PR?
There was a problem hiding this comment.
^ @leseb @ashwinb @yanxi0830 (sorry, pinging random people here :))
There was a problem hiding this comment.
yes we can followup on this.
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
|
@leseb I've added the deprecation warning for |
|
@leseb @ashwinb @yanxi0830 can someone review this please? |
|
@leseb @ashwinb @yanxi0830 |
Was waiting to see if others wanted to chime in :) |
|
Thank you! |
What does this PR do?
Allow application/yaml as mime_type for documents.
Test Plan
Added unit tests.