Skip to content

Commit 439193b

Browse files
committed
Fix RemoteInferenceUtils summary
1 parent 13bf8a6 commit 439193b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

app/src/main/java/com/coolkie/noteultra/utils/RemoteInferenceUtils.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,13 @@ class RemoteInferenceUtils {
2424
val summary: String
2525
)
2626

27+
@Serializable
28+
data class Context(
29+
val context: String
30+
)
2731
/* For question */
2832
fun generateResponse(prompt: PromptUser, url: String): String {
2933
val body = Json.encodeToString(prompt)
30-
3134
val request = Request.Builder()
3235
.url("${url}/question")
3336
.post(body.toRequestBody("application/json".toMediaType()))
@@ -46,7 +49,8 @@ class RemoteInferenceUtils {
4649

4750
/* For summary */
4851
fun generateResponse(context: String, url: String): Array<String> {
49-
val body = Json.encodeToString(context)
52+
val to_json_context = Context(context)
53+
val body = Json.encodeToString(to_json_context)
5054

5155
val request = Request.Builder()
5256
.url("${url}/summary")

0 commit comments

Comments
 (0)