File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
app/src/main/java/com/coolkie/noteultra/utils Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff 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" )
You can’t perform that action at this time.
0 commit comments