Skip to content

fix: accept list structured monitor run content (#208) - #234

Open
Abhishek21g wants to merge 1 commit into
exa-labs:masterfrom
Abhishek21g:fix/monitor-structured-content-208
Open

Abhishek21g wants to merge 1 commit into
exa-labs:masterfrom
Abhishek21g:fix/monitor-structured-content-208

Conversation

@Abhishek21g

Copy link
Copy Markdown

Problem

SearchMonitorRunOutput.content was typed as str | dict. When a monitor uses a structured outputSchema that returns a list of objects, SearchMonitorRunsClient.list / get fail pydantic validation.

Fixes #208

Note on existing PR

#209 covers the same issue but is merge-conflicting and also bumps package version. This PR is a minimal rebase on current master: type union + tests only (no version bump). Happy to close this if #209 is preferred after a rebase.

Fix

content: Optional[Union[str, Dict[str, Any], List[Any]]] = None

Verify

python -m pytest tests/unit/test_search_monitors.py::TestSearchMonitorRunOutputContent -q

…bs#208)

outputSchema monitors can return content as a list of objects. Typing
was str|dict only, which still fails pydantic validation for list
payloads. Extend the union and cover get/list with fixture tests.

This branch has not been deployed

No deployments
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.

SearchMonitorRunOutput has incorrect types for content

2 participants