mirror of
https://codeberg.org/aryak/mozhi
synced 2025-06-04 00:41:07 +05:30
IMAGE TRANSLATIONS
This commit is contained in:
76
docs/docs.go
76
docs/docs.go
@@ -1,5 +1,4 @@
|
||||
// Code generated by swaggo/swag. DO NOT EDIT.
|
||||
|
||||
// Package docs Code generated by swaggo/swag. DO NOT EDIT
|
||||
package docs
|
||||
|
||||
import "github.com/swaggo/swag"
|
||||
@@ -33,6 +32,50 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/image": {
|
||||
"post": {
|
||||
"description": "When engine is set to all, it will return an array of libmozhi.LangOut.",
|
||||
"summary": "Translate an image",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Engine name",
|
||||
"name": "engine",
|
||||
"in": "query",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Source language",
|
||||
"name": "from",
|
||||
"in": "query",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Target language",
|
||||
"name": "to",
|
||||
"in": "query",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "PNG image in base64 format",
|
||||
"name": "image",
|
||||
"in": "query",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/libmozhi.ImgOut"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/source_languages": {
|
||||
"get": {
|
||||
"summary": "Show list of available source languages for engine",
|
||||
@@ -152,6 +195,29 @@ const docTemplate = `{
|
||||
}
|
||||
},
|
||||
"definitions": {
|
||||
"libmozhi.ImgOut": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"sourceB64": {
|
||||
"type": "string"
|
||||
},
|
||||
"sourceLang": {
|
||||
"type": "string"
|
||||
},
|
||||
"sourceTextParsed": {
|
||||
"type": "string"
|
||||
},
|
||||
"targetLang": {
|
||||
"type": "string"
|
||||
},
|
||||
"translatedImgB64": {
|
||||
"type": "string"
|
||||
},
|
||||
"translatedTextParsed": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"libmozhi.LangOut": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -164,9 +230,15 @@ const docTemplate = `{
|
||||
"source_language": {
|
||||
"type": "string"
|
||||
},
|
||||
"source_transliteration": {
|
||||
"type": "string"
|
||||
},
|
||||
"target_language": {
|
||||
"type": "string"
|
||||
},
|
||||
"target_transliteration": {
|
||||
"type": "string"
|
||||
},
|
||||
"translated-text": {
|
||||
"type": "string"
|
||||
},
|
||||
|
@@ -21,6 +21,50 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/image": {
|
||||
"post": {
|
||||
"description": "When engine is set to all, it will return an array of libmozhi.LangOut.",
|
||||
"summary": "Translate an image",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Engine name",
|
||||
"name": "engine",
|
||||
"in": "query",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Source language",
|
||||
"name": "from",
|
||||
"in": "query",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Target language",
|
||||
"name": "to",
|
||||
"in": "query",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "PNG image in base64 format",
|
||||
"name": "image",
|
||||
"in": "query",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/libmozhi.ImgOut"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/source_languages": {
|
||||
"get": {
|
||||
"summary": "Show list of available source languages for engine",
|
||||
@@ -140,6 +184,29 @@
|
||||
}
|
||||
},
|
||||
"definitions": {
|
||||
"libmozhi.ImgOut": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"sourceB64": {
|
||||
"type": "string"
|
||||
},
|
||||
"sourceLang": {
|
||||
"type": "string"
|
||||
},
|
||||
"sourceTextParsed": {
|
||||
"type": "string"
|
||||
},
|
||||
"targetLang": {
|
||||
"type": "string"
|
||||
},
|
||||
"translatedImgB64": {
|
||||
"type": "string"
|
||||
},
|
||||
"translatedTextParsed": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"libmozhi.LangOut": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -152,9 +219,15 @@
|
||||
"source_language": {
|
||||
"type": "string"
|
||||
},
|
||||
"source_transliteration": {
|
||||
"type": "string"
|
||||
},
|
||||
"target_language": {
|
||||
"type": "string"
|
||||
},
|
||||
"target_transliteration": {
|
||||
"type": "string"
|
||||
},
|
||||
"translated-text": {
|
||||
"type": "string"
|
||||
},
|
||||
|
@@ -1,4 +1,19 @@
|
||||
definitions:
|
||||
libmozhi.ImgOut:
|
||||
properties:
|
||||
sourceB64:
|
||||
type: string
|
||||
sourceLang:
|
||||
type: string
|
||||
sourceTextParsed:
|
||||
type: string
|
||||
targetLang:
|
||||
type: string
|
||||
translatedImgB64:
|
||||
type: string
|
||||
translatedTextParsed:
|
||||
type: string
|
||||
type: object
|
||||
libmozhi.LangOut:
|
||||
properties:
|
||||
detected:
|
||||
@@ -7,8 +22,12 @@ definitions:
|
||||
type: string
|
||||
source_language:
|
||||
type: string
|
||||
source_transliteration:
|
||||
type: string
|
||||
target_language:
|
||||
type: string
|
||||
target_transliteration:
|
||||
type: string
|
||||
translated-text:
|
||||
type: string
|
||||
word_choices:
|
||||
@@ -50,6 +69,36 @@ paths:
|
||||
type: string
|
||||
type: object
|
||||
summary: List engines
|
||||
/api/image:
|
||||
post:
|
||||
description: When engine is set to all, it will return an array of libmozhi.LangOut.
|
||||
parameters:
|
||||
- description: Engine name
|
||||
in: query
|
||||
name: engine
|
||||
required: true
|
||||
type: string
|
||||
- description: Source language
|
||||
in: query
|
||||
name: from
|
||||
required: true
|
||||
type: string
|
||||
- description: Target language
|
||||
in: query
|
||||
name: to
|
||||
required: true
|
||||
type: string
|
||||
- description: PNG image in base64 format
|
||||
in: query
|
||||
name: image
|
||||
required: true
|
||||
type: string
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
$ref: '#/definitions/libmozhi.ImgOut'
|
||||
summary: Translate an image
|
||||
/api/source_languages:
|
||||
get:
|
||||
parameters:
|
||||
|
Reference in New Issue
Block a user