Generate text from session context
Generate transient text from the current session context without mutating session history.
POST
/api/session/{sessionID}/generatePath parameters
sessionIDobjectrequiredRequest body
requiredapplication/jsonpromptstringrequiredResponses
200SessionGenerateResponse
dataobjectrequiredShow propertiesHide properties
textstringrequired400InvalidRequestError
_tagstringrequiredAllowed:
InvalidRequestErrormessagestringrequiredkindstring | anyShow propertiesHide properties
Any of:
string
stringany
anyfieldstring | anyShow propertiesHide properties
Any of:
string
stringany
any401UnauthorizedError
_tagstringrequiredAllowed:
UnauthorizedErrormessagestringrequired404SessionNotFoundError
Any of:
SessionNotFoundError
_tagstringrequiredAllowed:
SessionNotFoundErrorsessionIDstringrequiredmessagestringrequiredSessionNotFoundError
_tagstringrequiredAllowed:
SessionNotFoundErrorsessionIDstringrequiredmessagestringrequired503ServiceUnavailableError
_tagstringrequiredAllowed:
ServiceUnavailableErrormessagestringrequiredservicestring | anyShow propertiesHide properties
Any of:
string
stringany
anyRequest
curl -X POST "/api/session/%5Bobject%20Object%5D/generate" \
-H "Content-Type: application/json" \
-d '{
"prompt": "string"
}'const response = await fetch("/api/session/%5Bobject%20Object%5D/generate", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
"prompt": "string"
})
});import requests
response = requests.post(
"/api/session/%5Bobject%20Object%5D/generate",
headers={
"Content-Type": "application/json"
},
json={
"prompt": "string"
},
)Response
{
"data": {
"text": "string"
}
}{
"_tag": "InvalidRequestError",
"message": "string",
"kind": "string",
"field": "string"
}{
"_tag": "UnauthorizedError",
"message": "string"
}{
"_tag": "SessionNotFoundError",
"sessionID": "string",
"message": "string"
}{
"_tag": "ServiceUnavailableError",
"message": "string",
"service": "string"
}