Skip to content

Commit 5d4208f

Browse files
kempgrantw99
andauthored
Add public API to Readme (#13)
Taken from #frontend discord. Thanks Grant Co-authored-by: grantw99 <grantw99@gmail.com>
1 parent 2090612 commit 5d4208f

1 file changed

Lines changed: 64 additions & 1 deletion

File tree

readme.md

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,67 @@ Open the integrated terminal to run commands in the container.
3838
`$ flask run` will start the flask development server and send requests to the flask application.
3939

4040
## Running Unit Tests
41-
Run pytest in the top-level project directory to start unit tests.
41+
Run pytest in the top-level project directory to start unit tests.
42+
43+
## Public API
44+
45+
### Solve Image
46+
47+
**URI**: `/solve-image`
48+
49+
**Method**: POST
50+
51+
**Request Body**:
52+
53+
{
54+
"b64_img": (str) "BASE64ENCODEDIMAGE"
55+
}
56+
57+
**Response Body**:
58+
59+
{
60+
"confidence": (number) CONFIDENCE_VALUE_FROM_MATHPIX,
61+
"input_detected": (str) "LATEX_STRING_OF_INPUT_DETECTED_FROM_MATHPIX",
62+
"solved": (str) "LATEX_STRING_OF_CAS_SOLUTION_TO_PROBLEM"
63+
}
64+
65+
### Solve Latex
66+
67+
**URI**: `/solve-latex`
68+
69+
**Method**: POST
70+
71+
**Request Body**:
72+
73+
{
74+
"latex": (str) "LATEX_TO_BE_SOLVED"
75+
}
76+
77+
**Response Body**:
78+
79+
{
80+
"solved": (str) "LATEX_STRING_OF_CAS_SOLUTION_TO_PROBLEM"
81+
}
82+
83+
### Mathpix OCR
84+
85+
**URI**: `/mathpix-ocr`
86+
87+
**Method**: POST
88+
89+
**Request Body**:
90+
91+
{
92+
"b64_img":(str)"BASEBASE64ENCODEDIMAGE"
93+
}
94+
95+
**Response Body**:
96+
97+
{
98+
"confidence":(number) CONFIDENCE_VALUE_FROM_MATPHIX,
99+
"confidence_rate":(number) CONFIDENCE_RATE_FROM_MATHPIX,
100+
"latex_styled":(str) "LATEX_STRING_OF_INPUT_DETECTED_FROM_MATHPIX",
101+
"request_id":(str) Doesn't mean anything to us,
102+
"text":(str) Doesnt mean much as we are using latex
103+
}
104+

0 commit comments

Comments
 (0)