Skip to content

Conversation

@AlePouroullis
Copy link
Contributor

@AlePouroullis AlePouroullis commented May 15, 2025

This PR fixes the type annotations in the client overloading mechanism to preserve method return types. When users call methods like client.prompts.call(), the type system now correctly identifies the return type as PromptCallResponse instead of Any.
The implementation uses getattr/setattr to avoid type errors while maintaining identical runtime behavior.

@AlePouroullis AlePouroullis requested a review from andreibratu May 15, 2025 12:36
@AlePouroullis AlePouroullis changed the title Fix type annotations in overload_client to preserve method return types Improve type annotations for overloaded client methods May 15, 2025
@peadaroh peadaroh requested a review from harry-humanloop May 16, 2025 12:33
Replace getattr/setattr with direct attribute assignment in overload_client function. Add type ignore comments to handle type checking. This change improves code readability while maintaining the same functionality.
…humanloop/humanloop-python into fix/specify-overload-client-return-type
@AlePouroullis AlePouroullis merged commit 21f3e2f into master May 16, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants