-
Notifications
You must be signed in to change notification settings - Fork 2
Release v1.9.1 #31
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
Release v1.9.1 #31
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -175,6 +175,29 @@ def post( | |
| ) | ||
| return self._parse_response(content, status_code, headers) | ||
|
|
||
| def post_raw( | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P3: The new public Prompt for AI agents |
||
| self, | ||
| path: str, | ||
| json_data: dict[str, Any] | None = None, | ||
| params: dict[str, Any] | None = None, | ||
| ) -> dict[str, Any]: | ||
| """Make a POST request and return the full response including ``meta``. | ||
|
|
||
| Unlike :meth:`post`, which extracts just the ``data`` field, this keeps | ||
| ``meta`` — which is where pagination lives. A paginated POST endpoint | ||
| served through :meth:`post` leaves the caller unable to tell whether | ||
| another page exists. | ||
| """ | ||
| url = self._build_url(path) | ||
| content, status_code, headers = self._http_client.request( | ||
| "POST", | ||
| url, | ||
| headers=self._get_auth_headers(), | ||
| params=params, | ||
| json=json_data, | ||
| ) | ||
| return self._parse_response_raw(content, status_code, headers) | ||
|
|
||
|
|
||
| class AsyncRequest(Generic[T]): | ||
| """Handles async API request execution and response parsing.""" | ||
|
|
@@ -273,3 +296,23 @@ async def post( | |
| json=json_data, | ||
| ) | ||
| return self._parse_response(content, status_code, headers) | ||
|
|
||
| async def post_raw( | ||
| self, | ||
| path: str, | ||
| json_data: dict[str, Any] | None = None, | ||
| params: dict[str, Any] | None = None, | ||
| ) -> dict[str, Any]: | ||
| """Make an async POST request returning the full response with ``meta``. | ||
|
|
||
| See :meth:`Request.post_raw`. | ||
| """ | ||
| url = self._build_url(path) | ||
| content, status_code, headers = await self._http_client.request( | ||
| "POST", | ||
| url, | ||
| headers=self._get_auth_headers(), | ||
| params=params, | ||
| json=json_data, | ||
| ) | ||
| return self._parse_response_raw(content, status_code, headers) | ||
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.
P3: The README example indexes
mapped["summary"], but the repo's own example for the sameclient.mappings.map()method (examples/map_between_vocabularies.py) readsresult.get("mapping_summary", {}).map()returns the raw APIdataunmodified, so only one key name is correct; if the API field ismapping_summary, the README'smapped["summary"]raises a KeyError. Align the README with the actual response key (or confirm which is right and fix the other).Prompt for AI agents