gptinfo 0.1.0 → 0.1.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: 06b9227afadf3d612c5cc0ccd1eb40d4a777eb538dcff06fec400353c5fe2a43
4
- data.tar.gz: 11e6fc45759dc8040aa07f04e6d438905b7574730429f3c7917ab58b0a3a5ff9
3
+ metadata.gz: 2a5f644eefe06767d11b2689197fb4cd3d5342f450009e96dbb20c30f9e3855b
4
+ data.tar.gz: a28ae20a496e17d570ccf9e0da92dafd2a82069bd349a09f9e16746c7b423581
5
5
  SHA512:
6
- metadata.gz: 9179224846342d04a5eeeb09d25bd41c47c7535f150302ad806c3b3093cea78c2b945951b1965f41fe5930964f3997c5a3133745163b3822f280ab756c080545
7
- data.tar.gz: e8ff5e31d55a51ce2e2cc84d2d37971a6b0a69902dee28a81b1eed4d38dc6def70d1c62bc0007bbf6d68c9c2a6feb1a15ef7286e937f2a95fe1d5a91948abb40
6
+ metadata.gz: 7679cb1bc4a7c68968288bcf381f845d8f936a430de7261de72b3a751d3089cadc434e7111da527aeac308d8acc82d52be008e77788e4b8bf906b1e733ff401a
7
+ data.tar.gz: 792a1a2c13e90af7c48baf7f8015f952be39955af9110656196ad23925062daee542c3d4c01dbf0e20c9ce9f41ab05201bb1e545576de1bec04803e29b8a655c
@@ -1,3 +1,3 @@
1
1
  {
2
- "editor.inlineSuggest.showToolbar": "onHover"
2
+ "editor.inlineSuggest.showToolbar": "always"
3
3
  }
data/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ [![Gem Version](https://badge.fury.io/rb/gptinfo.svg)](https://badge.fury.io/rb/gptinfo)
2
+
1
3
  # Gptinfo
2
4
 
3
5
  Gpt Info Parse
@@ -11,12 +13,18 @@ gem install gptinfo
11
13
  ```
12
14
  ## Usage
13
15
 
16
+ [DEMO JSON](data/g-HDJ2Bhvt1.json)
17
+
14
18
  ```ruby
15
- info = "{...}"
16
- gpt = Gptinfo.parse(info)
19
+ text = File.read('data/g-HDJ2Bhvt1.json')
20
+ gpt = Gptinfo.parse(text)
17
21
  puts gpt.id
18
22
  puts gpt.name
19
23
  puts gpt.description
24
+ puts gpt.capabilities
25
+ puts gpt.file_types
26
+ puts gpt.files_total_size
27
+ puts gpt.files_total_size_tokens
20
28
  ```
21
29
 
22
30
  ## Development
@@ -27,7 +35,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
27
35
 
28
36
  ## Contributing
29
37
 
30
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/gptinfo. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/gptinfo/blob/main/CODE_OF_CONDUCT.md).
38
+ Bug reports and pull requests are welcome on GitHub at https://github.com/seadfeng/gptinfo. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/seadfeng/gptinfo/blob/main/CODE_OF_CONDUCT.md).
31
39
 
32
40
  ## License
33
41
 
@@ -35,4 +43,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
35
43
 
36
44
  ## Code of Conduct
37
45
 
38
- Everyone interacting in the Gptinfo project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/gptinfo/blob/main/CODE_OF_CONDUCT.md).
46
+ Everyone interacting in the Gptinfo project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/seadfeng/gptinfo/blob/main/CODE_OF_CONDUCT.md).
@@ -33,19 +33,23 @@ module Gptinfo
33
33
  end
34
34
 
35
35
  def tool_types
36
- tools.map{|f| f.type }.uniq
36
+ @tool_types ||= tools.map{|t| { t.type => t.capabiliy } }.uniq
37
+ end
38
+
39
+ def capabilities
40
+ @capabilities ||= tool_types.map{|type| type.values[0] }
37
41
  end
38
42
 
39
43
  def file_types
40
- files.map{|f| f.type }.uniq
44
+ @file_types ||= files.map{|f| f.type }.uniq
41
45
  end
42
46
 
43
47
  def files_total_size
44
- files.map{|f| f.size }.sum
48
+ @files_total_size ||= files.map{|f| f.size }.sum
45
49
  end
46
50
 
47
51
  def files_total_size_tokens
48
- files.map{|f| f.file_size_tokens }.compact.sum
52
+ @files_total_size_tokens ||= files.map{|f| f.file_size_tokens }.compact.sum
49
53
  end
50
54
  end
51
55
  end
data/lib/gptinfo/tool.rb CHANGED
@@ -4,7 +4,7 @@ module Gptinfo
4
4
  class Tool
5
5
  FIELDS = %w( id type settings metadata ).freeze
6
6
  extend Forwardable
7
- attr_reader :hash, *FIELDS
7
+ attr_reader :hash, :capabiliy, *FIELDS
8
8
 
9
9
  FIELDS.each do |field|
10
10
  define_method(field) do
@@ -18,6 +18,17 @@ module Gptinfo
18
18
  @hash = hash
19
19
  end
20
20
 
21
+ def capabiliy
22
+ case type
23
+ when 'python'
24
+ 'Code Interpreter'
25
+ when 'dalle'
26
+ 'DALL·E Image Generation'
27
+ when 'browser'
28
+ 'Web Browsing'
29
+ end
30
+ end
31
+
21
32
  private
22
33
 
23
34
  def get(keys)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Gptinfo
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.2"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gptinfo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sead Feng
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-12-03 00:00:00.000000000 Z
11
+ date: 2023-12-05 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: GPT Info Parser
14
14
  email:
@@ -42,7 +42,7 @@ metadata:
42
42
  homepage_uri: https://github.com/seadfeng/gptinfo
43
43
  source_code_uri: https://github.com/seadfeng/gptinfo
44
44
  changelog_uri: https://github.com/seadfeng/gptinfo/CHANGELOG.MD
45
- post_install_message:
45
+ post_install_message:
46
46
  rdoc_options: []
47
47
  require_paths:
48
48
  - lib
@@ -57,8 +57,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
57
57
  - !ruby/object:Gem::Version
58
58
  version: '0'
59
59
  requirements: []
60
- rubygems_version: 3.4.18
61
- signing_key:
60
+ rubygems_version: 3.1.6
61
+ signing_key:
62
62
  specification_version: 4
63
63
  summary: GPT Info Parser
64
64
  test_files: []