File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -88,6 +88,8 @@ def uri(path:)
8888 if azure?
8989 base = File . join ( @uri_base , path )
9090 "#{ base } ?api-version=#{ @api_version } "
91+ elsif @uri_base . include? ( @api_version )
92+ File . join ( @uri_base , path )
9193 else
9294 File . join ( @uri_base , @api_version , path )
9395 end
Original file line number Diff line number Diff line change 204204
205205 it { expect ( uri ) . to eq ( "https://api.openai.com/v1/chat" ) }
206206
207+ context "uri_base with version included" do
208+ before do
209+ OpenAI . configuration . uri_base = "https://api.openai.com/v1/"
210+ end
211+
212+ after do
213+ OpenAI . configuration . uri_base = "https://api.openai.com/"
214+ end
215+
216+ it { expect ( uri ) . to eq ( "https://api.openai.com/v1/chat" ) }
217+ end
218+
207219 context "uri_base without trailing slash" do
208220 before do
209221 OpenAI . configuration . uri_base = "https://api.openai.com"
You can’t perform that action at this time.
0 commit comments