Skip to content

Commit

Permalink
fix: use post method at mozhi engine for long texts
Browse files Browse the repository at this point in the history
  • Loading branch information
Bnyro committed Feb 4, 2025
1 parent 15455a0 commit 9d035b3
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions app/src/main/java/com/bnyro/translate/api/mh/Mozhi.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,19 @@ import com.bnyro.translate.api.mh.obj.MhTranslationResponse
import okhttp3.ResponseBody
import retrofit2.Response
import retrofit2.http.GET
import retrofit2.http.Multipart
import retrofit2.http.POST
import retrofit2.http.Part
import retrofit2.http.Query

interface Mozhi {
@GET("api/translate/")
@POST("api/translate/")
@Multipart
suspend fun translate(
@Query("engine") engine: String? = null,
@Query("from") source: String,
@Query("to") target: String,
@Query("text") query: String
@Part("engine") engine: String? = null,
@Part("from") source: String,
@Part("to") target: String,
@Part("text") query: String
): MhTranslationResponse

@GET("api/target_languages/")
Expand Down

0 comments on commit 9d035b3

Please sign in to comment.