Skip to content

Commit

Permalink
Updated OpenAPI specs
Browse files Browse the repository at this point in the history
  • Loading branch information
CI committed Aug 13, 2024
1 parent 1955eb1 commit 11e547c
Show file tree
Hide file tree
Showing 2 changed files with 181 additions and 0 deletions.
110 changes: 110 additions & 0 deletions json/answersapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,46 @@
}
}
}
},
"/accounts/{accountId}/search/generateAnswer": {
"get": {
"operationId": "generateAnswer",
"summary": "Answer: Generate\n",
"description": "Leverages large language models (LLMs) to deliver generated summaries based on search results.\n\nThis endpoint works with the Universal/Vertical Search endpoint, which provides the search results for the LLM to analyze and generate direct answers.\n",
"parameters": [
{
"$ref": "#/components/parameters/accountId"
},
{
"$ref": "#/components/parameters/v"
},
{
"$ref": "#/components/parameters/experienceKey"
},
{
"$ref": "#/components/parameters/queryLocale"
}
],
"requestBody": {
"description": "JSON object containing the search results and user query to generate an answer.",
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/GenerateAnswerRequest"
}
}
}
},
"responses": {
"200": {
"$ref": "#/components/responses/GenerateAnswerResponse"
},
"400": {
"$ref": "#/components/responses/ErrorResponse"
}
}
}
}
},
"components": {
Expand Down Expand Up @@ -949,6 +989,43 @@
}
}
}
},
"GenerateAnswerResponse": {
"description": "Generate Answer Response",
"content": {
"application/json": {
"schema": {
"title": "GenerateAnswerResponse",
"type": "object",
"properties": {
"meta": {
"$ref": "#/components/schemas/ResponseMeta"
},
"response": {
"type": "object",
"properties": {
"directAnswer": {
"type": "string",
"description": "The direct answer for the query."
},
"resultStatus": {
"type": "string",
"description": "The status of the result."
},
"citations": {
"type": "array",
"description": "The list of entity IDs that were used to generate the answer.",
"items": {
"type": "string",
"description": "An ID of an entity that was used to generate the answer."
}
}
}
}
}
}
}
}
}
},
"schemas": {
Expand Down Expand Up @@ -1303,6 +1380,39 @@
"items": {
"type": "string"
}
},
"GenerateAnswerRequest": {
"type": "object",
"required": [
"searchId",
"searchTerm",
"results"
],
"properties": {
"searchId": {
"type": "string",
"description": "ID of the search associated to the results."
},
"searchTerm": {
"type": "string",
"description": "The search term that was used to generate results."
},
"results": {
"oneOf": [
{
"$ref": "#/components/schemas/Module"
},
{
"type": "object",
"properties": {
"verticals": {
"$ref": "#/components/schemas/Modules"
}
}
}
]
}
}
}
}
},
Expand Down
71 changes: 71 additions & 0 deletions yaml/answersapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,32 @@ paths:
$ref: '#/components/responses/FilterSearchResponse'
'400':
$ref: '#/components/responses/ErrorResponse'
/accounts/{accountId}/search/generateAnswer:
get:
operationId: generateAnswer
summary: |
Answer: Generate
description: |
Leverages large language models (LLMs) to deliver generated summaries based on search results.
This endpoint works with the Universal/Vertical Search endpoint, which provides the search results for the LLM to analyze and generate direct answers.
parameters:
- $ref: '#/components/parameters/accountId'
- $ref: '#/components/parameters/v'
- $ref: '#/components/parameters/experienceKey'
- $ref: '#/components/parameters/queryLocale'
requestBody:
description: JSON object containing the search results and user query to generate an answer.
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/GenerateAnswerRequest'
responses:
'200':
$ref: '#/components/responses/GenerateAnswerResponse'
'400':
$ref: '#/components/responses/ErrorResponse'
components:
securitySchemes:
api_key:
Expand Down Expand Up @@ -1030,6 +1056,31 @@ components:
$ref: '#/components/schemas/FailedVerticals'
queryId:
$ref: '#/components/schemas/queryId'
GenerateAnswerResponse:
description: Generate Answer Response
content:
application/json:
schema:
title: GenerateAnswerResponse
type: object
properties:
meta:
$ref: '#/components/schemas/ResponseMeta'
response:
type: object
properties:
directAnswer:
type: string
description: The direct answer for the query.
resultStatus:
type: string
description: The status of the result.
citations:
type: array
description: The list of entity IDs that were used to generate the answer.
items:
type: string
description: An ID of an entity that was used to generate the answer.
schemas:
ResponseMeta:
type: object
Expand Down Expand Up @@ -1322,6 +1373,26 @@ components:
Items in array each represent a particular intent expressed in the user's query. Example: `NEAR_ME`
items:
type: string
GenerateAnswerRequest:
type: object
required:
- searchId
- searchTerm
- results
properties:
searchId:
type: string
description: ID of the search associated to the results.
searchTerm:
type: string
description: The search term that was used to generate results.
results:
oneOf:
- $ref: '#/components/schemas/Module'
- type: object
properties:
verticals:
$ref: '#/components/schemas/Modules'
security:
- api_key: []
- api-key: []
Expand Down

0 comments on commit 11e547c

Please sign in to comment.