gpt-function 0.1.2 → 0.2.0
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 +4 -4
- data/.rubocop.yml +9 -0
- data/Gemfile.lock +1 -1
- data/lib/gpt/function/version.rb +1 -1
- data/lib/gpt/functions.rb +57 -0
- data/lib/gpt-function.rb +3 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f08f33db34e0ff129539ed7a41b244d2866be076f5fc562ed327ff880a852014
|
4
|
+
data.tar.gz: 2a9913da1af1d6ab5ea10602aa5c073c113b6d45d6cdd761eedb4399b32615fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 79b7276238753eb6613c7896a796b1501dd6b3059af1e9d1b8d4c0f01cc42a4fe64210833f5f088846aa2b098d1f516c906b62056e0ff739d6cea2f87874e7a3
|
7
|
+
data.tar.gz: 6590b337edb6edc2215ad3a6192363dfe852c0735c3af75c4fd0662c7ab2219221a7e49be88037968d858c2d55ba5f72a37b259e63b00a703df7498320c77f91
|
data/.rubocop.yml
CHANGED
data/Gemfile.lock
CHANGED
data/lib/gpt/function/version.rb
CHANGED
@@ -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
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.
|
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-
|
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:
|