Cleanup
This commit is contained in:
parent
cef750497b
commit
6a3caa84ce
2 changed files with 4 additions and 6 deletions
|
@ -77,7 +77,6 @@ class ChatGpt : ThreadedModule() {
|
||||||
*/
|
*/
|
||||||
const val CHATGPT_API_KEY = "chatgpt-api-key"
|
const val CHATGPT_API_KEY = "chatgpt-api-key"
|
||||||
|
|
||||||
|
|
||||||
// ChatGPT command
|
// ChatGPT command
|
||||||
private const val CHATGPT_CMD = "chatgpt"
|
private const val CHATGPT_CMD = "chatgpt"
|
||||||
|
|
||||||
|
@ -113,8 +112,7 @@ class ChatGpt : ThreadedModule() {
|
||||||
if (response.statusCode() == 200) {
|
if (response.statusCode() == 200) {
|
||||||
try {
|
try {
|
||||||
val jsonResponse = JSONObject(response.body())
|
val jsonResponse = JSONObject(response.body())
|
||||||
println(response.body());
|
val choices = jsonResponse.getJSONArray("choices")
|
||||||
var choices = jsonResponse.getJSONArray("choices")
|
|
||||||
return choices.getJSONObject(0).getString("text").trim()
|
return choices.getJSONObject(0).getString("text").trim()
|
||||||
} catch (e: JSONException) {
|
} catch (e: JSONException) {
|
||||||
throw ModuleException(
|
throw ModuleException(
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
#Generated by the Semver Plugin for Gradle
|
#Generated by the Semver Plugin for Gradle
|
||||||
#Sun Dec 04 16:10:05 PST 2022
|
#Sun Dec 04 17:34:43 PST 2022
|
||||||
version.buildmeta=798
|
version.buildmeta=799
|
||||||
version.major=0
|
version.major=0
|
||||||
version.minor=8
|
version.minor=8
|
||||||
version.patch=0
|
version.patch=0
|
||||||
version.prerelease=rc
|
version.prerelease=rc
|
||||||
version.project=mobibot
|
version.project=mobibot
|
||||||
version.semver=0.8.0-rc+798
|
version.semver=0.8.0-rc+799
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue