Class: LLM::DeepSeek::Format::CompletionFormat
- Inherits:
-
Object
- Object
- LLM::DeepSeek::Format::CompletionFormat
- Defined in:
- lib/llm/shell/internal/llm.rb/lib/llm/providers/deepseek/format/completion_format.rb
Instance Method Summary collapse
-
#format ⇒ Hash
Formats the message for the DeepSeek chat completions API.
-
#initialize(message) ⇒ CompletionFormat
constructor
A new instance of CompletionFormat.
Constructor Details
#initialize(message) ⇒ CompletionFormat
Returns a new instance of CompletionFormat.
10 11 12 |
# File 'lib/llm/shell/internal/llm.rb/lib/llm/providers/deepseek/format/completion_format.rb', line 10 def initialize() = end |
Instance Method Details
#format ⇒ Hash
Formats the message for the DeepSeek chat completions API
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/llm/shell/internal/llm.rb/lib/llm/providers/deepseek/format/completion_format.rb', line 17 def format catch(:abort) do if Hash === {role: [:role], content: format_content([:content])} elsif .tool_call? {role: .role, content: nil, tool_calls: .extra[:original_tool_calls]} else end end end |