{"openapi":"3.1.0","info":{"title":"ARKL API","version":"0.1.0"},"paths":{"/ask":{"get":{"tags":["agent"],"summary":"Ask the knowledge base (query string)","description":"Search the business's published knowledge base (NLWeb `/ask`) and return matching articles as schema.org objects. Pass `streaming=false` for a single JSON body; by default the reply is a text/event-stream. `mode` is `list` (default), `summarize` or `generate`.","operationId":"askGet","parameters":[{"name":"query","in":"query","required":true,"schema":{"type":"string","description":"The natural-language question to answer. Truncated to 500 characters.","title":"Query"},"description":"The natural-language question to answer. Truncated to 500 characters."},{"name":"site","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Restrict results to this site; omit to search the whole knowledge base.","title":"Site"},"description":"Restrict results to this site; omit to search the whole knowledge base."},{"name":"prev","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Comma-separated earlier queries in this conversation, for context.","title":"Prev"},"description":"Comma-separated earlier queries in this conversation, for context."},{"name":"decontextualized_query","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The query rewritten to stand alone, if the caller has done so.","title":"Decontextualized Query"},"description":"The query rewritten to stand alone, if the caller has done so."},{"name":"streaming","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"`false` or `0` returns one JSON body; otherwise events stream (default).","title":"Streaming"},"description":"`false` or `0` returns one JSON body; otherwise events stream (default)."},{"name":"query_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Caller-supplied id echoed back in the response; generated if omitted.","title":"Query Id"},"description":"Caller-supplied id echoed back in the response; generated if omitted."},{"name":"mode","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"`list` (default), `summarize` or `generate`; unknown values mean `list`.","title":"Mode"},"description":"`list` (default), `summarize` or `generate`; unknown values mean `list`."}],"responses":{"200":{"description":"Matching articles (JSON) or the same payload as a server-sent event stream when streaming is on.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AskResponse"}},"text/event-stream":{"schema":{"type":"string"}}}},"422":{"description":"A parameter is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"tags":["agent"],"summary":"Ask the knowledge base (JSON body)","description":"Search the business's published knowledge base (NLWeb `/ask`) and return matching articles as schema.org objects. Pass `streaming=false` for a single JSON body; by default the reply is a text/event-stream. `mode` is `list` (default), `summarize` or `generate`. Same parameters as the GET form, sent as a JSON body.","operationId":"askPost","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AskRequest"}}}},"responses":{"200":{"description":"Matching articles (JSON) or the same payload as a server-sent event stream when streaming is on.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AskResponse"}},"text/event-stream":{"schema":{"type":"string"}}}},"422":{"description":"A parameter is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"servers":[{"url":"https://arklayer-api.bamboo-orchard.dev"}],"components":{"schemas":{"AskResponse":{"properties":{"query_id":{"type":"string","title":"Query Id"},"results":{"items":{"$ref":"#/components/schemas/AskResult"},"type":"array","title":"Results"},"answer":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Answer"},"degraded_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Degraded Reason"},"data_freshness_timestamp":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Data Freshness Timestamp"}},"type":"object","required":["query_id","results"],"title":"AskResponse"},"AskResult":{"properties":{"url":{"type":"string","title":"Url"},"name":{"type":"string","title":"Name"},"site":{"type":"string","title":"Site"},"description":{"type":"string","title":"Description"},"schema_object":{"additionalProperties":true,"type":"object","title":"Schema Object"}},"type":"object","required":["url","name","site","description","schema_object"],"title":"AskResult","description":"One NLWeb result. Field names are the protocol's and are not ours to rename."},"ErrorResponse":{"properties":{"status":{"type":"string","title":"Status","description":"Always `error`."},"message":{"type":"string","title":"Message","description":"Human-readable explanation of what went wrong."}},"type":"object","required":["status","message"],"title":"ErrorResponse","description":"The JSON body of every error response."},"AskRequest":{"properties":{"query":{"type":"string","title":"Query","description":"The natural-language question to answer. Truncated to 500 characters."},"site":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Site","description":"Restrict results to this site; omit to search the whole knowledge base."},"prev":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prev","description":"Comma-separated earlier queries in this conversation, for context."},"decontextualized_query":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Decontextualized Query","description":"The query rewritten to stand alone, if the caller has done so."},"streaming":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Streaming","description":"`false` or `0` returns one JSON body; otherwise events stream (default)."},"query_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Query Id","description":"Caller-supplied id echoed back in the response; generated if omitted."},"mode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mode","description":"`list` (default), `summarize` or `generate`; unknown values mean `list`."}},"type":"object","required":["query"],"title":"AskRequest","description":"The POST body form of `/ask`. Same parameters as the query string, per NLWeb."}}}}