import requests
import json
url = “https://api.vectara.io/v1/query”
payload = json.dumps({
“query”: [
{
“query”: “what is artificial intelligence?”,
“start”: 0,
“numResults”: 10,
“contextConfig”: {
“charsBefore”: 30,
“charsAfter”: 30,
“sentencesBefore”: 3,
“sentencesAfter”: 3,
“startTag”: “”,
“endTag”: “”
},
“corpusKey”: [
{
“customerId”: Customer_id,
“corpusId”: 1,
“semantics”: “DEFAULT”,
“dim”: [
{
“name”: “string”,
“weight”: 0
}
],
“metadataFilter”: “part.lang = ‘eng’”,
“lexicalInterpolationConfig”: {
“lambda”: 0
}
}
],
“rerankingConfig”: {
“rerankerId”: 272725717
},
“summary”: [
{
“summarizerPromptName”: “vectara-summary-ext-v1.2.0”,
“maxSummarizedResults”: 10,
“responseLang”: “string”
}
]
}
]
})
headers = {
‘Content-Type’: ‘application/json’,
‘Accept’: ‘application/json’,
‘customer-id’: ‘CUSTOMER_ID’,
‘x-api-key’: ‘API_KEY’
}
response = requests.request(“POST”, url, headers=headers, data=payload)
print(response.text)
i got this code from the website of vectara.
the problem is i am getting the response from vectara in the run prompt of python but it is not giving me the summary of the query which is coming in the corpus.
If anyone can know the issue with this code please solve this
thank you.