gpt-function 0.1.2 → 0.2.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: 8048ade9bee9c6ba03f8eb97810a0ecee19b49f5cded5b0b157d556c20b570ec
4
- data.tar.gz: 38952aeef662639339175aeaab6661010f0a168121c217b003d9aba6abb27450
3
+ metadata.gz: f08f33db34e0ff129539ed7a41b244d2866be076f5fc562ed327ff880a852014
4
+ data.tar.gz: 2a9913da1af1d6ab5ea10602aa5c073c113b6d45d6cdd761eedb4399b32615fc
5
5
  SHA512:
6
- metadata.gz: 31cdb81fcce80026a3b2bc351f4c65a118f9377bb39c05d5c2b14b2ee8590ad95870fbe910d46bb9e04f0f2e4559e22e60e6d9afa1540d1443f3f67cfa40350d
7
- data.tar.gz: 732de393247c3271a7fb9c51b1a6ef01685c1001e40c9604c8fcbcdb2e2ffb01746ec4d86e6f744aad3adf1f39d63ccecf71090d8a845269176a800e4a300cb8
6
+ metadata.gz: 79b7276238753eb6613c7896a796b1501dd6b3059af1e9d1b8d4c0f01cc42a4fe64210833f5f088846aa2b098d1f516c906b62056e0ff739d6cea2f87874e7a3
7
+ data.tar.gz: 6590b337edb6edc2215ad3a6192363dfe852c0735c3af75c4fd0662c7ab2219221a7e49be88037968d858c2d55ba5f72a37b259e63b00a703df7498320c77f91
data/.rubocop.yml CHANGED
@@ -14,3 +14,12 @@ Layout/LineLength:
14
14
 
15
15
  Metrics/MethodLength:
16
16
  Max: 30
17
+
18
+ Naming/AsciiIdentifiers:
19
+ Enabled: false
20
+
21
+ Naming/MethodName:
22
+ Enabled: false
23
+
24
+ Naming/FileName:
25
+ Enabled: false
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gpt-function (0.1.0)
4
+ gpt-function (0.1.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Gpt
4
4
  class Function
5
- VERSION = "0.1.2"
5
+ VERSION = "0.2.0"
6
6
  end
7
7
  end
@@ -0,0 +1,57 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Gpt
4
+ # 這是一個簡單的 GPT 函數類別
5
+ module Functions
6
+ class << self
7
+ def 翻譯成中文(input)
8
+ Gpt::Function.new("Translate into Taiwanese traditional Chinese", [%w[apple 蘋果]]).call(input)
9
+ end
10
+
11
+ def 擷取關鍵字(input)
12
+ Gpt::Function.new("Extract all keywords",
13
+ [
14
+ [
15
+ "臺灣最新5G網路覆蓋率達95%,推動智慧城市發展,領先亞洲多國",
16
+ %w[臺灣 5G網路 覆蓋率 智慧城市 亞洲]
17
+ ]
18
+ ]).call(input)
19
+ end
20
+
21
+ def 擷取文章標題(input)
22
+ document = <<~DOCUMENT
23
+ 今日頭條
24
+ 科技日報|臺灣科技業最新突破,AI技術大躍進
25
+ 科技日報
26
+ 科技日報
27
+ 2023-11-17
28
+ 102
29
+ 生活新聞|臺北市最新公共交通計畫公開
30
+ 生活日報
31
+ 生活日報
32
+ 2023-11-16
33
+ 89
34
+ 健康專欄|最新研究:日常運動對心臟健康的重要性
35
+ 健康雜誌
36
+ 健康雜誌
37
+ 2023-11-15
38
+ 76
39
+ 旅遊特輯|探索臺灣東部的隱藏美食與景點
40
+ 旅遊週刊
41
+ 旅遊週刊
42
+ 2023-11-14
43
+ 65
44
+ DOCUMENT
45
+
46
+ keywords = [
47
+ "科技日報|臺灣科技業最新突破,AI技術大躍進",
48
+ "生活新聞|臺北市最新公共交通計畫公開",
49
+ "健康專欄|最新研究:日常運動對心臟健康的重要性",
50
+ "旅遊特輯|探索臺灣東部的隱藏美食與景點"
51
+ ]
52
+
53
+ Gpt::Function.new("Extract all titles", [[document, keywords]]).call(input)
54
+ end
55
+ end
56
+ end
57
+ end
data/lib/gpt-function.rb CHANGED
@@ -1 +1,4 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative "gpt/function"
4
+ require_relative "gpt/functions"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gpt-function
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - etrex kuo
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-11-18 00:00:00.000000000 Z
11
+ date: 2023-11-19 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: This gem allows users to create simple and complex GPT functions for
14
14
  various applications such as translation and keyword extraction.
@@ -29,6 +29,7 @@ files:
29
29
  - lib/gpt-function.rb
30
30
  - lib/gpt/function.rb
31
31
  - lib/gpt/function/version.rb
32
+ - lib/gpt/functions.rb
32
33
  - workflows/main.yml
33
34
  homepage: https://github.com/etrex/gpt-function
34
35
  licenses: