-
Notifications
You must be signed in to change notification settings - Fork 178
Add headers to HttpRequestResponse in OpenAI client. #1006
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
Add headers to HttpRequestResponse in OpenAI client. #1006
Conversation
fa1f84d to
83aa2f0
Compare
83aa2f0 to
2589662
Compare
2589662 to
fbbdcd2
Compare
fbbdcd2 to
9cb1b62
Compare
9cb1b62 to
baffa43
Compare
| res = self._api.do( | ||
| "POST", | ||
| "/api/2.0/external-function", | ||
| body={ | ||
| "connection_name": conn, | ||
| "method": method.value, | ||
| "path": path, | ||
| "headers": js.dumps(headers) if headers is not None else None, | ||
| "json": js.dumps(json) if json is not None else None, | ||
| "params": js.dumps(params) if params is not None else None, | ||
| }, | ||
| headers={"Accept": "text/plain", "Content-Type": "application/json"}, | ||
| raw=True, | ||
| response_headers=headers_to_capture, |
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.
@hectorcast-db, can you think of something better given the current libraries? Not using the underlying API method is really not ideal but I can't think of a better alternative with the code that we have right now.
baffa43 to
5df6134
Compare
Head branch was pushed to by a user without write access
7e516fe to
b7c44e3
Compare
|
If integration tests don't run automatically, an authorized user can run them manually by following the instructions below: Trigger: Inputs:
Checks will be approved automatically on success. |
What changes are proposed in this pull request?
Adding headers to HttpRequestResponse when making http_request
Why?
Basically we need the response headers that is used in the MCP spec: https://modelcontextprotocol.io/specification/2025-06-18/basic/transports#session-management
Specially Mcp-Session-Id header.
How is this tested?