Skip to content

Commit 71d5174

Browse files
committed
Add deepseek support with crmne#131
1 parent f498f61 commit 71d5174

File tree

1 file changed

+17
-0
lines changed
  • lib/ruby_llm/providers/deepseek

1 file changed

+17
-0
lines changed

lib/ruby_llm/providers/deepseek/chat.rb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,23 @@ def format_role(role)
1111
# DeepSeek doesn't use the new OpenAI convention for system prompts
1212
role.to_s
1313
end
14+
15+
def render_payload(messages, tools:, temperature:, model:, stream: false)
16+
{
17+
model: model,
18+
messages: format_messages(messages),
19+
temperature: temperature,
20+
stream: stream
21+
}.tap do |payload|
22+
add_response_schema_to_payload(payload) if response_schema.present?
23+
end
24+
end
25+
26+
private
27+
28+
def add_response_schema_to_payload(payload)
29+
payload[:response_format] = { type: 'json_object' }
30+
end
1431
end
1532
end
1633
end

0 commit comments

Comments
 (0)