Генератор на Lorem ipsum
Създайте примерни абзаци, за да изпробвате оформлението на страницата.
Базов URL адрес: https://happytails.ai · Публичният API не е свързан
Обработка
При заявка към API входните данни се обработват на сървъра.
Параметри на заявката
Изпратете JSON обект. Непознатите свойства се отхвърлят. За пропуснатите опции се използват стойностите по подразбиране по-долу. Въведете числата и булевите стойности като JSON стойности без кавички.
Не е необходим входен текст. Използвайте настройките по-долу.
Тази крайна точка не приема масив 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": "Paragraphs",
"default": 3.0,
"minimum": 1,
"maximum": 100,
"multipleOf": 1
}
}
}
}
}За автоматизация в браузъра използвайте централния ресурс Насоки за WebMCP, за да видите кои инструменти действително предоставя браузърът.
curl https://happytails.ai/api/v1/tools/lorem-ipsum/run \
-H "Content-Type: application/json" \
--data '{"input": "", "options": {}}'const payload = {
"input": "",
"options": {}
};
const response = await fetch(
"https://happytails.ai/api/v1/tools/lorem-ipsum/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": "", "options": {}}')
request = Request(
"https://happytails.ai/api/v1/tools/lorem-ipsum/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": "",
"options": {}
}Заменете източника на API и входните стойности с подходящите за вашето приложение.
{
"tool": "lorem-ipsum",
"result": {
"text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",
"files": [],
"name": "result.txt",
"mime": "text/plain;charset=utf-8"
}
}{
"error": {
"code": "INVALID_INPUT",
"message": "Unknown request property. See the tool input schema."
}
}