llm_conductor 1.8.1 → 1.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 15ca3603df4d5bd68d92466c41db9d0f566553a59dc6dab0bc5c674da6c6a980
4
- data.tar.gz: 47e207aaf562b252fcc69c8cee0332a71ccabee0ac46b1ce9316460795b61fe2
3
+ metadata.gz: 8a13bccd45a0d886de6bc88a531724a2e929912d21564f5c50296c000c28476a
4
+ data.tar.gz: 1838b42538d448dc2373b1e7e9180b92b1f97fe87dfd8b50b18a164ac992ffae
5
5
  SHA512:
6
- metadata.gz: 031f71338832774e993b0ba1c1f6c63002299b82f52e2e11bb8d3b1d4e06d6c69f395cb6afdceea600432d8b6b3d658d198f8b4d8460885e813daab15761be5d
7
- data.tar.gz: f1a113133ccb7b6669902b112cb20cbd3a1a53cba30220f0a3906e3482389ff2749ecaf4d5b3d6eba3aeb5bae8203d3470d69d2043004cfcc9654bf3d8260aeb
6
+ metadata.gz: aeac7323ebde9d6327f9e536876d42f951d5e042f37888f6d0cb0dc64aaa50fd820c94cf4788a6ebde8b9e27423d67872f99a87c6ff6400f910cb07fbf37cfbc
7
+ data.tar.gz: 20dcb4c95317a32eaa033bbf0dadfdfa3aef5934818fbc491fd13b9e467edbe5a2b332d3234ee9f7b7181900a0a35294d356417c759c5cb736a476592ac670cf
@@ -2,20 +2,35 @@
2
2
 
3
3
  module LlmConductor
4
4
  module Clients
5
- # Groq client implementation for accessing Groq models via Groq API
5
+ # Groq client implementation for accessing Groq models via Groq API.
6
+ #
7
+ # The groq gem defaults to a 1024-token output cap and a 5s request timeout
8
+ # (Groq::Configuration::DEFAULT_MAX_TOKENS / DEFAULT_REQUEST_TIMEOUT), which
9
+ # silently truncate longer structured outputs mid-response. We raise both to
10
+ # sane defaults and honor per-call +params+ (e.g. max_tokens, temperature).
6
11
  class GroqClient < BaseClient
12
+ DEFAULT_MAX_TOKENS = 8192
13
+ DEFAULT_REQUEST_TIMEOUT = 120
14
+
7
15
  private
8
16
 
9
17
  def generate_content(prompt)
10
18
  # Groq::Client.chat expects messages as positional arg, not keyword arg
11
19
  messages = [{ role: 'user', content: prompt }]
12
- client.chat(messages, model_id: model)['content']
20
+ options = { model_id: model }
21
+ options[:max_tokens] = params[:max_tokens] if params[:max_tokens]
22
+ options[:temperature] = params[:temperature] if params.key?(:temperature)
23
+ client.chat(messages, **options)['content']
13
24
  end
14
25
 
15
26
  def client
16
27
  @client ||= begin
17
28
  config = LlmConductor.configuration.provider_config(:groq)
18
- Groq::Client.new(api_key: config[:api_key])
29
+ Groq::Client.new(
30
+ api_key: config[:api_key],
31
+ max_tokens: config[:max_tokens] || DEFAULT_MAX_TOKENS,
32
+ request_timeout: config[:request_timeout] || DEFAULT_REQUEST_TIMEOUT
33
+ )
19
34
  end
20
35
  end
21
36
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LlmConductor
4
- VERSION = '1.8.1'
4
+ VERSION = '1.8.2'
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: llm_conductor
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.1
4
+ version: 1.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Zheng
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2026-06-10 00:00:00.000000000 Z
10
+ date: 2026-06-11 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: activesupport