-
Notifications
You must be signed in to change notification settings - Fork 3
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
feat(routes): add moderation route support #61
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.
Thanks for contributing. Everything looks great 👍
For builders (or anything under /helpers
) it's really just random utils to help with common patterns I found myself repeating over and over so adding anything there is super low priority but always encouraged especially if it will help you out.
The only change I'd request is let's make the model_dict
and model_parse
utils more flexible and add args/kwargs to the function signature and pass those into the proxied method instead of explicitly marking by_alias
as true.
Here's an example that I had in another project where I needed to support Pydantic V1 and V2
https://github.com/mharrisb1/cube-http-client/blob/main/src/cube_http/_utils/serde.py
When you make that quick change I'll merge this in and release everything as v0.10
src/openai_responses/_utils/serde.py
Outdated
@@ -15,7 +15,7 @@ def json_loads(b: bytes) -> Any: | |||
|
|||
def model_dict(m: BaseModel) -> dict[str, Any]: |
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.
Just update these function signatures and where you used model_dict
in moderations and we're good 👍
a3cbdbf
to
d44e7d3
Compare
I'll fix CI when I'm able to get to my laptop. Should be able to checkout forks and test |
Thanks for sorting the CI + reviewing this PR! |
Resolves #23
Firstly, thanks for putting this package together - It's really useful!
I am utilizing the Moderation API as part of some of my projects so I thought I would add support for it here.
I've attempted to follow the same structure / approach as the rest of the routes but please let me know if there is anything else I need to add.
I wasn't quite sure what the
builders
section was for, so I have just copied another example.