Skip to content

Commit

Permalink
Fixing headers for http_request
Browse files Browse the repository at this point in the history
  • Loading branch information
sunishsheth2009 committed Jan 3, 2025
1 parent 966bb41 commit 9485351
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/databricks_ai_bridge/external_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ def http_request(
"method": method,
"path": path,
"json": js.dumps(json),
"header": headers,
"params": params,
"headers": js.dumps(headers),
"params": js.dumps(params),
}

return requests.post(url, headers=request_headers, json=payload)
10 changes: 4 additions & 6 deletions tests/databricks_ai_bridge/test_external_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,8 @@ def test_http_request_success(mock_post, mock_workspace_client):
"method": "POST",
"path": "/mock-path",
"json": '{"key": "value"}',
"header": {
"Custom-Header": "HeaderValue",
},
"params": {"query": "test"},
"headers": '{"Custom-Header": "HeaderValue"}',
"params": '{"query": "test"}',
},
)

Expand Down Expand Up @@ -83,7 +81,7 @@ def test_http_request_error_response(mock_post, mock_workspace_client):
"method": "POST",
"path": "/mock-path",
"json": '{"key": "value"}',
"header": None,
"params": None,
"headers": "null",
"params": "null",
},
)

0 comments on commit 9485351

Please sign in to comment.