เครื่องคิดเลขเศษส่วน
บวก ลบ คูณ หรือหารเศษส่วนสองจำนวน
URL ฐาน: https://happytails.ai · ยังไม่ได้เชื่อมต่อ API สาธารณะ
การประมวลผล
เศษส่วนที่ย่อแล้วให้ค่าที่แน่นอน จำนวนคละแสดงค่าเดียวกัน ส่วนค่าทศนิยมเป็นค่าโดยประมาณ
เมื่อส่งคำขอผ่าน API ข้อมูลที่ป้อนจะได้รับการประมวลผลบนเซิร์ฟเวอร์
พารามิเตอร์ของคำขอ
ส่งออบเจ็กต์ JSON ระบบจะปฏิเสธพร็อพเพอร์ตีที่ไม่รู้จัก ตัวเลือกที่ไม่ได้ระบุจะใช้ค่าเริ่มต้นด้านล่าง ป้อนตัวเลขและค่าบูลีนเป็นค่า JSON โดยไม่ใส่เครื่องหมายคำพูด
ไม่ต้องป้อนข้อความ ให้ใช้การตั้งค่าด้านล่าง
เอนด์พอยต์นี้ไม่รองรับอาร์เรย์ files
ตัวเลือก
options.anumberตัวเศษ A
options.bnumberตัวส่วน A
options.opstringการดำเนินการ
options.cnumberตัวเศษ B
options.dnumberตัวส่วน B
การตอบกลับเมื่อสำเร็จ
การตอบกลับ HTTP 200 มี tool และ result ข้อความอยู่ใน result.text และอาจมี JSON ที่แยกวิเคราะห์แล้วใน result.data ไฟล์ที่สร้างขึ้นอยู่ใน result.files พร้อม name, mime, bytes และ base64 ให้ถอดรหัสไบต์ก่อนบันทึก หากการดำเนินการส่งผลลัพธ์ชนิดอื่นกลับมา อาร์เรย์ไฟล์ว่างและข้อความที่มีค่า null ถือว่าถูกต้อง
สคีมาผลลัพธ์ฉบับเต็ม
{
"type": "object",
"required": [
"tool",
"result"
],
"properties": {
"tool": {
"type": "string"
},
"result": {
"type": "object",
"required": [
"text",
"files"
],
"properties": {
"text": {
"type": [
"string",
"null"
]
},
"data": {
"description": "Parsed JSON when the textual result is JSON."
},
"name": {
"type": "string"
},
"mime": {
"type": "string"
},
"files": {
"type": "array",
"items": {
"type": "object",
"required": [
"name",
"mime",
"bytes",
"base64"
],
"properties": {
"name": {
"type": "string"
},
"mime": {
"type": "string"
},
"bytes": {
"type": "integer"
},
"base64": {
"type": "string",
"contentEncoding": "base64"
}
}
}
}
}
}
}
}ข้อจำกัดและข้อผิดพลาด
เอนด์พอยต์นี้บังคับใช้ข้อจำกัดด้านล่าง รวมถึงข้อจำกัดเพิ่มเติมเรื่องรูปแบบ จำนวนหน้า ระยะเวลา และโมเดลที่ระบุในหมายเหตุการทำงาน ข้อจำกัดในหน้าเว็บอาจต่างจากข้อจำกัดของ API
request_bytes- 8388608
input_characters- 1000000
files_bytes- 5242880
max_files- 0
timeout_seconds- 12
คำขอที่ไม่ถูกต้องจะส่งคืนออบเจ็กต์ error ที่มีฟิลด์ code และ message ดู รหัสสถานะ HTTP การลองใหม่ การหมดเวลา และคำขอพร้อมกัน ระบบประมวลผลแบบซิงโครนัสและส่งผลลัพธ์กลับมาในการตอบกลับเดียวกัน
สคีมาคำขอฉบับเต็ม
ขยายสคีมา JSON
{
"type": "object",
"additionalProperties": false,
"properties": {
"input": {
"type": "string",
"maxLength": 1000000,
"default": "",
"description": "Plain text input. File tools use files instead unless otherwise documented."
},
"options": {
"type": "object",
"additionalProperties": false,
"properties": {
"a": {
"type": "number",
"description": "Numerator A",
"default": 1.0,
"minimum": -1000000,
"maximum": 1000000,
"multipleOf": 1
},
"b": {
"type": "number",
"description": "Denominator A",
"default": 2.0,
"minimum": -1000000,
"maximum": 1000000,
"multipleOf": 1
},
"op": {
"type": "string",
"description": "Operation",
"default": "+",
"enum": [
"+",
"-",
"×",
"÷"
]
},
"c": {
"type": "number",
"description": "Numerator B",
"default": 1.0,
"minimum": -1000000,
"maximum": 1000000,
"multipleOf": 1
},
"d": {
"type": "number",
"description": "Denominator B",
"default": 3.0,
"minimum": -1000000,
"maximum": 1000000,
"multipleOf": 1
}
}
}
}
}หากต้องการทำงานอัตโนมัติในเบราว์เซอร์ ให้ใช้ คำแนะนำสำหรับ WebMCP ส่วนกลางเพื่อตรวจสอบว่าเบราว์เซอร์เปิดให้ใช้เครื่องมือใดบ้าง
curl https://happytails.ai/api/v1/tools/fractions/run \
-H "Content-Type: application/json" \
--data '{"options": {"a": 1.0, "b": 2.0, "op": "+", "c": 1.0, "d": 3.0}}'const payload = {
"options": {
"a": 1.0,
"b": 2.0,
"op": "+",
"c": 1.0,
"d": 3.0
}
};
const response = await fetch(
"https://happytails.ai/api/v1/tools/fractions/run",
{
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(payload)
}
);
const data = await response.json();
if (!response.ok) throw new Error(data.error.message);
console.log(data.result);import json
from urllib.request import Request, urlopen
payload = json.loads('{"options": {"a": 1.0, "b": 2.0, "op": "+", "c": 1.0, "d": 3.0}}')
request = Request(
"https://happytails.ai/api/v1/tools/fractions/run",
data=json.dumps(payload).encode(),
headers={"Content-Type": "application/json"},
)
with urlopen(request, timeout=200) as response:
result = json.load(response)
print(result){
"options": {
"a": 1.0,
"b": 2.0,
"op": "+",
"c": 1.0,
"d": 3.0
}
}เปลี่ยน origin ของ API และค่าข้อมูลเข้าให้ตรงกับแอปพลิเคชันของคุณ
{
"tool": "fractions",
"result": {
"text": null,
"files": []
}
}ตัวอย่างโครงสร้างการตอบกลับ ข้อความ ชื่อไฟล์ ชนิด MIME และจำนวนไบต์จริงขึ้นอยู่กับผลลัพธ์ ดูสคีมาผลลัพธ์ฉบับเต็ม
{
"error": {
"code": "INVALID_INPUT",
"message": "Unknown request property. See the tool input schema."
}
}