lammy 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9225fc482f95ed862d6e12bc4541731c8854127900e0bfe369075ef1092fae8e
4
- data.tar.gz: 720ce8849858edb0832c34b0b10ef736c6353b12daa1e5cecf68c137de94a91d
3
+ metadata.gz: bab0a835c9ce12e44b4c5f0d4252eb3040e0d5cb3336aeefe24856f59a74a2a9
4
+ data.tar.gz: a627a3d18b19a86785a1c70d95304b5bc8ab820766faf15f7893a79d563aeb44
5
5
  SHA512:
6
- metadata.gz: 83be8412698ad307dba650aaa54e230cf9b47ee9e140e9dac1d26c2927f28b43649ac9b2e6196154a09b8b608a04b8fb72e7c0792e2a6bd799a2ff1edd339494
7
- data.tar.gz: 9add86016f31a13416848ff64a7b9eeea03808b9220b239b029049c1ffc04796a9253f71dfac623928b8eddacbd8ffa182a243fd1a7c50c5a5ade6bdc8a68b50
6
+ metadata.gz: 0cd66977d719fb4bf752b96c9d5fcaeb1d776fda9d3f929366b4ac41a9913f2e16de6cb1454f0116214f1a7b404b815506f3e0375ac781f5ef2304aa01e54b6c
7
+ data.tar.gz: 8c39fea57e23ce2c39a926b039c01e132482237a5c9e6af4fd1bd9de20b884845f05930be747a202f5a3982fe22bbf2f3e308f9f605d934c9897b57b095c72c0
data/lib/lammy/chat.rb CHANGED
@@ -26,13 +26,16 @@ module L
26
26
  # Call the original method to get the user message
27
27
  user_message = original_method.bind(self).call(*args, &block)
28
28
 
29
- case settings[:model]
30
- when *OpenAI::MODELS
31
- client = OpenAI.new(settings)
32
- client.chat(user_message, @system_message)
33
- else
34
- raise "Unsupported model: #{settings[:model]}"
35
- end
29
+ client = case settings[:model]
30
+ when *OpenAI::MODELS
31
+ OpenAI.new(settings)
32
+ when *Claude::MODELS
33
+ Claude.new(settings)
34
+ else
35
+ raise "Unsupported model: #{settings[:model]}"
36
+ end
37
+
38
+ client.chat(user_message, @system_message)
36
39
  end
37
40
  end
38
41
  end
data/lib/lammy/openai.rb CHANGED
@@ -4,7 +4,7 @@ require 'openai'
4
4
  require 'hashie'
5
5
 
6
6
  module L
7
- # Use the OpenAI API's official Ruby library
7
+ # Use the OpenAI API's Ruby library
8
8
  class OpenAI
9
9
  MODELS = %w[
10
10
  gpt-4o-mini gpt-4o gpt-4-turbo gpt-4 gpt-3.5-turbo gpt-4o-mini-2024-07-18 gpt-4o-2024-08-06
data/lib/lammy.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'lammy/embeddings'
4
+ require 'lammy/claude'
4
5
  require 'lammy/openai'
5
6
  require 'lammy/schema'
6
7
  require 'lammy/chat'
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lammy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kamil Nicieja
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-10-01 00:00:00.000000000 Z
11
+ date: 2024-10-03 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: anthropic
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0.3'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '0.3'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: hashie
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -61,7 +75,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
61
75
  requirements:
62
76
  - - ">="
63
77
  - !ruby/object:Gem::Version
64
- version: '0'
78
+ version: 2.6.0
65
79
  required_rubygems_version: !ruby/object:Gem::Requirement
66
80
  requirements:
67
81
  - - ">="