geekdict 0.1.0 → 0.1.1
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/README.md +4 -0
- data/geekdict.gemspec +0 -1
- data/lib/geekdict/openai/gpt.rb +2 -2
- data/lib/geekdict/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f9a7876ba4eddfb0497523ab7f318588fc1ef1abf754b5f75771b0f2bbc29092
|
4
|
+
data.tar.gz: 460d3c363a9622fec12bb463854239355293827327d7d7639338c306a36f99a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a66b0934455eebc3bc5c511510abc261d7c8ddb59cc91f4ea66b4b30ee6b8d709f39451e62d4674731db803ec88f105c064c8722b56b9e073abd0c38597b8c1a
|
7
|
+
data.tar.gz: 64d730010c52a0e5c7a98b169ff7fef55ed34eab4863b32781aefd18889ffa946cab96dbc5d33516668488d87ddb3be830a111a7b75092e552c3fc29f2d106f2
|
data/README.md
CHANGED
data/geekdict.gemspec
CHANGED
data/lib/geekdict/openai/gpt.rb
CHANGED
@@ -18,14 +18,14 @@ module GeekDict
|
|
18
18
|
{ role: "system", content: system_prompt(word)},
|
19
19
|
{ role: "user", content: word}
|
20
20
|
],
|
21
|
-
temperature: 0.
|
21
|
+
temperature: 0.2,
|
22
22
|
})
|
23
23
|
return response.dig("choices", 0, "message", "content")
|
24
24
|
end
|
25
25
|
|
26
26
|
def system_prompt(word)
|
27
27
|
<<-EOS
|
28
|
-
You are helpful and enthusiastic language translator. If the word or sentense is Chinese, translate it into English. If it is English, translate into Chinese.
|
28
|
+
You are helpful and enthusiastic language translator. If the word or sentense is Chinese, translate it into English. If it is English, translate into Chinese. If the word is incorrectly spelled or it's not a correct word in English or Chinese, try your best to find the closest word. In addition to the translation, offer a comprehensive explanation of the word along with one or two examples to illustrate its usage. Do NOT add Pinyin in the example sentences for Chinese.
|
29
29
|
EOS
|
30
30
|
end
|
31
31
|
end
|
data/lib/geekdict/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: geekdict
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Wenbing Li
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-05-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|