التفاف النص
وزّع النص على أسطر جديدة عند حدود الكلمات.
عنوان URL الأساسي: https://happytails.ai · واجهة API العامة غير متصلة
المعالجة
تُعالَج بياناتك على الخادم عند إرسال طلب عبر واجهة API.
معلمات الطلب
أرسل كائن JSON. تُرفض الخصائص غير المعروفة. تُستخدم القيم الافتراضية أدناه للخيارات التي لم تُحدَّد. أدخل الأرقام والقيم المنطقية بصيغة JSON من دون علامات اقتباس.
الحقل input سلسلة نصية فارغة افتراضيًا تقبل حتى 1,000,000 محرف. غيّر الإدخال أو الإعدادات لتحديث النتيجة، وهي تتحدث أيضًا أثناء الكتابة.
لا تقبل نقطة النهاية هذه مصفوفة files.
الخيارات
options.nnumberالحد الأقصى لطول السطر
استجابة النجاح
تتضمن استجابة 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": {
"n": {
"type": "number",
"description": "Maximum line width",
"default": 80.0
}
}
}
}
}لأتمتة المتصفح، استخدم المرجع المركزي إرشادات WebMCP لمعرفة الأدوات التي يتيحها المتصفح فعليًا.
curl https://happytails.ai/api/v1/tools/wrap-text/run \
-H "Content-Type: application/json" \
--data '{"input": "One two three", "options": {}}'const payload = {
"input": "One two three",
"options": {}
};
const response = await fetch(
"https://happytails.ai/api/v1/tools/wrap-text/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('{"input": "One two three", "options": {}}')
request = Request(
"https://happytails.ai/api/v1/tools/wrap-text/run",
data=json.dumps(payload).encode(),
headers={"Content-Type": "application/json"},
)
with urlopen(request, timeout=200) as response:
result = json.load(response)
print(result){
"input": "One two three",
"options": {}
}استبدل أصل عنوان API وقيم الإدخال بما يناسب تطبيقك.
{
"tool": "wrap-text",
"result": {
"text": "One two three",
"files": [],
"name": "result.txt",
"mime": "text/plain;charset=utf-8"
}
}{
"error": {
"code": "INVALID_INPUT",
"message": "Unknown request property. See the tool input schema."
}
}