llmed 0.3.11 → 0.3.12

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: 0a76594513224861d625b7f9bccec631ce781a119dd940eb3136a035054c4bd5
4
- data.tar.gz: d308c71076898ec61f0a20453c762983a841955875cc1f181f6dd809b650538b
3
+ metadata.gz: 0cd0f86146f0b5d3123e0bffdd50f66017b5961c94f3e589236a579157a8db3e
4
+ data.tar.gz: 82f083351481d1e14e5cdcf1640027dd032f242c7390e0421f075e1214a2bd95
5
5
  SHA512:
6
- metadata.gz: f8946ce2b8ba9bf2a7e34065c62e3c911441cbda1f9770f04f47550ad654abbfd2d59e3a3c174c9a449712e6374a2b23aa387f30783c2cb32e2b02787169dac0
7
- data.tar.gz: c9d99c0f4f6e2af6d304051608fa5dfbba3063023c5aa3c44c13ae07d74f276f7fe9bb8695d614296b8a26addb0efab8ca48cb41642b7964512ce567a0139ffd
6
+ metadata.gz: 825b0583fe3f59190eef5dd2cd618d38e5b244409d91ca7ce5fe1baef60f19cb9a6acb967aa3b260439fec0d321da552a65b4fc280fb10d537a138eca6315791
7
+ data.tar.gz: 44744f6d6c0b24ea109e191461aae86e6a9fa63347e7a90143f41672986befb82809c274441514efcc79323c714abeb5bb154b5f6a274fdb6a6b86d439f6650c
data/lib/llm.rb CHANGED
@@ -19,6 +19,9 @@ class LLMed
19
19
  Response = Struct.new(:provider, :model, :source_code, :duration_seconds, :total_tokens, keyword_init: true)
20
20
 
21
21
  class OpenAI
22
+
23
+ DEFAULT_URI_BASE = "https://api.openai.com/".freeze
24
+
22
25
  def initialize(**args)
23
26
  @llm = Langchain::LLM::OpenAI.new(**llm_arguments(args))
24
27
  end
@@ -45,10 +48,6 @@ class LLMed
45
48
 
46
49
  private
47
50
 
48
- def llm_arguments(args)
49
- args
50
- end
51
-
52
51
  def provider
53
52
  :openai
54
53
  end
@@ -70,6 +69,18 @@ class LLMed
70
69
  end
71
70
  end
72
71
 
72
+ class LikeOpenAI < OpenAI
73
+ private
74
+
75
+ def llm_arguments(args)
76
+ args
77
+ end
78
+
79
+ def provider
80
+ :like_openai
81
+ end
82
+ end
83
+
73
84
  class Test
74
85
  def initialize
75
86
  @output = ''
@@ -52,10 +52,11 @@ Wrap with comment every code that belongs to the indicated context, example in {
52
52
  @language = language
53
53
  end
54
54
 
55
- def set_llm(provider:, api_key:, model:)
55
+ def set_llm(provider:, api_key:, model:, options: {})
56
56
  @provider = provider
57
57
  @provider_api_key = api_key
58
58
  @provider_model = model
59
+ @provider_options = options
59
60
  end
60
61
 
61
62
  def language(main)
@@ -77,6 +78,12 @@ Wrap with comment every code that belongs to the indicated context, example in {
77
78
  api_key: @provider_api_key,
78
79
  default_options: { temperature: 0.7, chat_model: @provider_model }
79
80
  )
81
+ when :like_openai
82
+ LLMed::LLM::LikeOpenAI.new(
83
+ api_key: @provider_api_key,
84
+ default_options: { temperature: 0.7, chat_model: @provider_model },
85
+ llm_options: @provider_options
86
+ )
80
87
  when :test
81
88
  LLMed::LLM::Test.new
82
89
  when nil
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: llmed
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.11
4
+ version: 0.3.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jovany Leandro G.C
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-06-12 00:00:00.000000000 Z
11
+ date: 2025-06-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: langchainrb