מחשבון שברים
חברו, חסרו, הכפילו או חלקו שני שברים.
כתובת 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
}
}יש להחליף את כתובת המקור של ה־API ואת ערכי הקלט בערכים המתאימים ליישום שלך.
{
"tool": "fractions",
"result": {
"text": null,
"files": []
}
}דוגמה למבנה התגובה. הטקסט, שם הקובץ, סוג ה־MIME ומספר הבתים בפועל תלויים בתוצאה. עיינו בסכמת הפלט המלאה.
{
"error": {
"code": "INVALID_INPUT",
"message": "Unknown request property. See the tool input schema."
}
}