Class: LlmGateway::Clients::Groq
- Inherits:
-
BaseClient
- Object
- BaseClient
- LlmGateway::Clients::Groq
- Defined in:
- lib/llm_gateway/clients/groq.rb
Instance Attribute Summary
Attributes inherited from BaseClient
#api_key, #base_endpoint, #model_key
Instance Method Summary collapse
- #chat(messages, tools: nil, system: [], **options) ⇒ Object
-
#initialize(model_key: "openai/gpt-oss-20b", api_key: ENV["GROQ_API_KEY"]) ⇒ Groq
constructor
A new instance of Groq.
Methods inherited from BaseClient
#get, #post, #post_file, #post_stream
Constructor Details
#initialize(model_key: "openai/gpt-oss-20b", api_key: ENV["GROQ_API_KEY"]) ⇒ Groq
Returns a new instance of Groq.
8 9 10 11 |
# File 'lib/llm_gateway/clients/groq.rb', line 8 def initialize(model_key: "openai/gpt-oss-20b", api_key: ENV["GROQ_API_KEY"]) @base_endpoint = "https://api.groq.com/openai/v1" super(model_key: model_key, api_key: api_key) end |
Instance Method Details
#chat(messages, tools: nil, system: [], **options) ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/llm_gateway/clients/groq.rb', line 13 def chat(, tools: nil, system: [], **) body = { model: model_key, messages: system + , tools: tools } body.merge!() post("chat/completions", body) end |