geekdict 0.1.0 → 0.1.1

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: 90e371d728887d96bd825b2e512e8a3ba093c49c6cdb788474f899bba185f1ae
4
- data.tar.gz: 79362e55a2fb8d5012f2801c7bc7efd96d8cdcbda5a780eff92329a6f33deeb3
3
+ metadata.gz: f9a7876ba4eddfb0497523ab7f318588fc1ef1abf754b5f75771b0f2bbc29092
4
+ data.tar.gz: 460d3c363a9622fec12bb463854239355293827327d7d7639338c306a36f99a3
5
5
  SHA512:
6
- metadata.gz: a1eb6eb1992e3f962d600c44230af5c91bd4ed84f8df4c426a3ce4a2851d3972a4636d030bc5535d71203a123516538583fc5fe97f2157dc03128d5641c45716
7
- data.tar.gz: 0fbb842f9fe9db24768bcd861779c70a540c7344d4d02610f6d9ec2c41e8114e92cec7dffa3f28aec07217249125268518680de11985cb8f0bd4f8a02c319567
6
+ metadata.gz: a66b0934455eebc3bc5c511510abc261d7c8ddb59cc91f4ea66b4b30ee6b8d709f39451e62d4674731db803ec88f105c064c8722b56b9e073abd0c38597b8c1a
7
+ data.tar.gz: 64d730010c52a0e5c7a98b169ff7fef55ed34eab4863b32781aefd18889ffa946cab96dbc5d33516668488d87ddb3be830a111a7b75092e552c3fc29f2d106f2
data/README.md CHANGED
@@ -10,6 +10,10 @@ You can install via rubygems:
10
10
 
11
11
  gem install geekdict
12
12
 
13
+ Configure
14
+ --------
15
+ This translate uses OpenAI's GPT-3.5. Ensure you have `OPENAI_API_KEY` configured as environment variable.
16
+
13
17
 
14
18
  Commands
15
19
  --------
data/geekdict.gemspec CHANGED
@@ -29,5 +29,4 @@ Gem::Specification.new do |s|
29
29
  s.add_runtime_dependency "thor", "~> 1.2.1"
30
30
  s.add_runtime_dependency "httpclient", "~> 2.7.1"
31
31
  s.add_runtime_dependency "ruby-openai"
32
-
33
32
  end
@@ -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.7,
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. If the word is incorrect spelled, try your best to translate and give a correct word. Besides translate, give more detailed explanation of the word, and one or two examples. Do NOT add Pinyin in the example sentense for 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
@@ -1,3 +1,3 @@
1
1
  module GeekDict
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
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.0
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-04-26 00:00:00.000000000 Z
11
+ date: 2023-05-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake