Skip to content

Commit fb156c8

Browse files
committed
Add Deepseek spec
1 parent 695f0a3 commit fb156c8

File tree

2 files changed

+90
-0
lines changed

2 files changed

+90
-0
lines changed

spec/fixtures/cassettes/deepseek_deepseek-chat_streamed_chat.yml

Lines changed: 62 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

spec/openai/client/chat_spec.rb

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,34 @@ def call(chunk)
185185
end
186186
end
187187

188+
context "with Deepseek + model: deepseek-chat" do
189+
let(:uri_base) { "https://api.deepseek.com/" }
190+
let(:provider) { "deepseek" }
191+
let(:model) { "deepseek-chat" }
192+
let(:response) do
193+
OpenAI::Client.new({ uri_base: uri_base }).chat(
194+
parameters: parameters
195+
)
196+
end
197+
let(:chunks) { [] }
198+
let(:stream) do
199+
proc do |chunk, _bytesize|
200+
chunks << chunk
201+
end
202+
end
203+
204+
it "succeeds" do
205+
VCR.use_cassette(cassette) do
206+
tap do
207+
response
208+
rescue Faraday::UnauthorizedError
209+
pending "This test needs the `OPENAI_ACCESS_TOKEN` to be a Groq API key"
210+
end
211+
expect(chunks.dig(0, "choices", 0, "index")).to eq(0)
212+
end
213+
end
214+
end
215+
188216
context "with Groq + model: llama3" do
189217
let(:uri_base) { "https://api.groq.com/openai" }
190218
let(:provider) { "groq" }

0 commit comments

Comments
 (0)