kiyoka / sumibi Goto Github PK
View Code? Open in Web Editor NEWJapanese input method powered by ChatGPT API
License: GNU General Public License v3.0
Japanese input method powered by ChatGPT API
License: GNU General Public License v3.0
ChatGPT APIだけでは、十分な数の同音異義語をリストアップすることは難しい。
クライアント側(EmacsLisp側)に同音異義語辞書を保持し、同音異義語の解決をするなど、機能強化する。
例えば、以下をSumibi 1.9.0で変換した場合、単語が短すぎて、有効な同音異義語がリストアップできない。
変換対象の入力文字列
kansei
変換結果(同音異義語の列挙結果は一つのみ)
完成
一方、SKK-JISYO.Lに入っている同音異義語は以下のように豊富なため、これくらいのリストは出してほしい。
完成/感性/歓声/閑静/管制/慣性/寛政/官製/乾性/陥穽/官制/間性/喚声/甘精/甘井/喊声/監製/感声/乾生/関西
sumibi-current-model
のデフォルトをgpt-4-turboにするEnglish: Responding to OpenAI API status code errors. If the status code is not 200, please display the error message returned by the API in the mini-buffer.
ステータスコードが200以外の場合は、APIが返すエラーメッセージをミニバッファに表示してほしい。
次の例は、ステータスコード429 Too Many Requestsのエラーケースです。
HTTP/1.1 429 Too Many Requests
Date: Wed, 24 May 2023 11:19:00 GMT
Content-Type: application/json
Content-Length: 349
Connection: keep-alive
access-control-allow-origin: *
openai-model: gpt-3.5-turbo-0301
openai-organization: xxxxxxxxxxxxxxxxxxxxxxxxx
openai-processing-ms: 30014
openai-version: 2020-10-01
strict-transport-security: max-age=15724800; includeSubDomains
x-ratelimit-limit-requests: 3500
x-ratelimit-limit-tokens: 90000
x-ratelimit-remaining-requests: 3499
x-ratelimit-remaining-tokens: 88989
x-ratelimit-reset-requests: 17ms
x-ratelimit-reset-tokens: 674ms
x-request-id: 24eaad501de52f18620f2fd21e5e52e9
CF-Cache-Status: DYNAMIC
Server: cloudflare
CF-RAY: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
alt-svc: h3=":443"; ma=86400, h3-29=":443"; ma=86400
{
"error": {
"message": "That model is currently overloaded with other requests. You can retry your request, or contact us through our help center at help.openai.com if the error persists. (Please include the request ID 24eaad501de52f18620f2fd21e5e52e9 in your message.)",
"type": "server_error",
"param": null,
"code": null
}
}
カスタマイズ変数 sumibi-current-model に設定したモデルを、途中で切り替えれるようにしたい。
別のカスタマイズ変数に、複数のモデル名を定義しておいて、いつでも選択できるようにしたい。
モデルgpt-4は変換精度は非常に高いが、API課金が高いので、長文の翻訳などの作業ではgpt-3.5-turboに切り替えたい。
(defun sumibi-drop-guide-sentence (utf8-str)
"引数UTF8-STRで指定した文字列中のgpt-3.5-turboが出力する不要な定型文を削除する."
(let ((lines (split-string utf8-str "\n")))
(if
(or (string-match "以下の通りです。[ ]*" (car lines))
(string-match "以下のようになります。[ ]*" (car lines))
(string-match "以下になります。[ ]*" (car lines)))
(string-trim-left (string-join (cdr lines) "\n"))
utf8-str)))
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.