- Newest
- Most votes
- Most comments
For item 1, See here: https://repost.aws/questions/QUMkzXuTzeQ42sBjmqNUDhjw/can-we-send-system-prompt-in-retrieve-and-generate
What type of follow-up question are you sending with the session id? Including an example could help us help you.
hello, for question2, there is a param named sessionId, the unique identifier of the session. When you first make a RetrieveAndGenerate request, Amazon Bedrock automatically generates this value. You must reuse this value for all subsequent requests in the same conversational session. This value allows Amazon Bedrock to maintain context and knowledge from previous interactions. You can't explicitly set the sessionId yourself. Request syntax:
POST /retrieveAndGenerate HTTP/1.1
Content-type: application/json
{
"input": {
"text": "string"
},
"retrieveAndGenerateConfiguration": {
"externalSourcesConfiguration": {
"generationConfiguration": {
"additionalModelRequestFields": {
"string" : JSON value
},
"guardrailConfiguration": {
"guardrailId": "string",
"guardrailVersion": "string"
},
"inferenceConfig": {
"textInferenceConfig": {
"maxTokens": number,
"stopSequences": [ "string" ],
"temperature": number,
"topP": number
}
},
"promptTemplate": {
"textPromptTemplate": "string"
}
},
"modelArn": "string",
"sources": [
{
"byteContent": {
"contentType": "string",
"data": blob,
"identifier": "string"
},
"s3Location": {
"uri": "string"
},
"sourceType": "string"
}
]
},
"knowledgeBaseConfiguration": {
"generationConfiguration": {
"additionalModelRequestFields": {
"string" : JSON value
},
"guardrailConfiguration": {
"guardrailId": "string",
"guardrailVersion": "string"
},
"inferenceConfig": {
"textInferenceConfig": {
"maxTokens": number,
"stopSequences": [ "string" ],
"temperature": number,
"topP": number
}
},
"promptTemplate": {
"textPromptTemplate": "string"
}
},
"knowledgeBaseId": "string",
"modelArn": "string",
"orchestrationConfiguration": {
"queryTransformationConfiguration": {
"type": "string"
}
},
"retrievalConfiguration": {
"vectorSearchConfiguration": {
"filter": { ... },
"numberOfResults": number,
"overrideSearchType": "string"
}
}
},
"type": "string"
},
"sessionConfiguration": {
"kmsKeyArn": "string"
},
"sessionId": "string"
}
Also this link is helpful: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html
