Class: Intelligence::TogetherAi::Adapter

Inherits:
Generic::Adapter show all
Defined in:
lib/intelligence/adapters/together_ai.rb

Constant Summary collapse

DEFAULT_BASE_URI =
"https://api.together.xyz/v1"

Instance Method Summary collapse

Methods included from ChatResponseMethods

#result

Methods included from ChatRequestMethods

#receive_result

Instance Method Details

#to_end_reason(end_result) ⇒ Object



47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/intelligence/adapters/together_ai.rb', line 47

def to_end_reason( end_result )
  case end_result
    when 'eos', 'stop'
      :ended
    # unfortunatelly eos seems to only work with certain models while others always return
    # stop so for now tomorrow ai will not support :end_sequence_encountered
    # when 'stop'
    #   :end_sequence_encountered
   when 'length'
      :token_limit_exceeded
    when 'tool_calls'
      :tool_called
    else
      nil
  end
end