Skip to content

Add headers to the response.#126

Merged
lzsweb merged 2 commits into
dashscope:mainfrom
mose-x:add_response_header
May 22, 2026
Merged

Add headers to the response.#126
lzsweb merged 2 commits into
dashscope:mainfrom
mose-x:add_response_header

Conversation

@mose-zm
Copy link
Copy Markdown
Contributor

@mose-zm mose-zm commented May 22, 2026

Add headers to the response.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds a headers field to DashScopeAPIResponse and its subclasses to capture HTTP response headers across various API calls. The changes include updates to response initialization, factory methods, and error handling in both synchronous and asynchronous request handlers. Feedback suggests including the headers field in the newly added repr and str methods for completeness and removing redundant type hints in subclasses where the field is already inherited from the base class.

Comment thread dashscope/api_entities/dashscope_response.py
Comment thread dashscope/api_entities/dashscope_response.py
Comment thread dashscope/api_entities/dashscope_response.py Outdated
message: str
output: Any
usage: Any
headers: dict
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

dict -> Dict

Copy link
Copy Markdown
Collaborator

@lzsweb lzsweb left a comment

Choose a reason for hiding this comment

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

version.py:version = "1.25.19"

@lzsweb lzsweb merged commit 2260421 into dashscope:main May 22, 2026
2 checks passed
@mose-zm mose-zm deleted the add_response_header branch May 22, 2026 06:26
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.

2 participants