cURL
curl --request POST \ --url https://api.olostep.com/v1/answers \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data ' { "task": "<string>", "json_format": {} } '
{ "id": "<string>", "object": "<string>", "created": 123, "metadata": {}, "task": "<string>", "result": { "json_content": "<string>", "json_hosted_url": "<string>" } }
AI 将执行搜索和浏览网页等操作,以找到所提供任务的答案。执行时间为 3-30 秒,具体取决于复杂性。 对于较长的任务,请使用代理端点。参见 Agent 功能。参见 Answers 功能。
POST /v1/answers
question
context
import { useState } from 'react'; function CreateAnswerExample() { const [question, setQuestion] = useState(''); const [context, setContext] = useState(''); const [answer, setAnswer] = useState(null); const createAnswer = async () => { const response = await fetch('/v1/answers', { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ question, context }), }); const data = await response.json(); setAnswer(data.answer); }; return ( <div> <input type="text" placeholder="输入你的问题" value={question} onChange={(e) => setQuestion(e.target.value)} /> <textarea placeholder="输入上下文" value={context} onChange={(e) => setContext(e.target.value)} /> <button onClick={createAnswer}>创建答案</button> {answer && <div>答案: {answer}</div>} </div> ); }
Bearer 认证头格式为 Bearer ,其中 是你的认证令牌。
要执行的任务。
期望的输出 JSON 对象,带有空值作为模式,或者简单地描述你想要的数据作为字符串。
成功响应并返回答案。
Show child attributes
此页面对您有帮助吗?