File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change 3
3
before do
4
4
OpenAI . configure do |config |
5
5
config . organization_id = "organization_id0"
6
+ config . extra_headers = { "test" => "X-Default" }
6
7
end
7
8
end
8
9
44
45
expect ( c0 . send ( :headers ) . values ) . to include ( c0 . organization_id )
45
46
expect ( c0 . send ( :conn ) . options . timeout ) . to eq ( OpenAI ::Configuration ::DEFAULT_REQUEST_TIMEOUT )
46
47
expect ( c0 . send ( :uri , path : "" ) ) . to include ( OpenAI ::Configuration ::DEFAULT_URI_BASE )
48
+ expect ( c0 . send ( :headers ) . values ) . to include ( "X-Default" )
47
49
expect ( c0 . send ( :headers ) . values ) . not_to include ( "X-Test" )
48
50
49
51
expect ( c1 . azure? ) . to eq ( true )
54
56
expect ( c1 . send ( :headers ) . values ) . to include ( c1 . access_token )
55
57
expect ( c1 . send ( :conn ) . options . timeout ) . to eq ( 60 )
56
58
expect ( c1 . send ( :uri , path : "" ) ) . to include ( "https://oai.hconeai.com/" )
59
+ expect ( c1 . send ( :headers ) . values ) . not_to include ( "X-Default" )
57
60
expect ( c1 . send ( :headers ) . values ) . to include ( "X-Test" )
58
61
59
62
expect ( c2 . azure? ) . to eq ( false )
65
68
expect ( c2 . send ( :headers ) . values ) . to include ( c2 . organization_id )
66
69
expect ( c2 . send ( :conn ) . options . timeout ) . to eq ( 1 )
67
70
expect ( c2 . send ( :uri , path : "" ) ) . to include ( "https://example.com/" )
71
+ expect ( c2 . send ( :headers ) . values ) . to include ( "X-Default" )
68
72
expect ( c2 . send ( :headers ) . values ) . not_to include ( "X-Test" )
69
73
end
70
74
You can’t perform that action at this time.
0 commit comments