Skip to content

Conversation

@TomeHirata
Copy link
Collaborator

Closes #9099

… fields

- Added import of inspect to facilitate type checking.
- Updated the condition for handling custom streamable types to include a check for class type using inspect.isclass.
- Introduced a new test for StreamListener to validate behavior with generic type annotations in output fields.

Signed-off-by: TomuHirata <tomu.hirata@gmail.com>
Copy link
Collaborator

@chenmoneygithub chenmoneygithub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix LGTM, one comment on the test case. Feel free to merge after addressing it!

)

with dspy.context(adapter=dspy.JSONAdapter()):
result = listener.receive(mock_chunk)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do get what the test case is testing, but our future maintainers could be confused. Maybe add a few more chunks + flush to make the test easier to follow?

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.

[Bug] StreamListener crashes when _output_type is a Generic

2 participants