Include retrievals
Include the retrieval results when invoking your deployment.
When querying a Deployment using a Knowledge Base, it is possible to fetch the details of the knowledge base retrievals during generation.
Invoking with retrieval
When using Invoke a Deployment, use the optional field include_retrievals
to embed the retrieval chunks within the response payload.
Here are examples on how to use the include_retrievals
field in the invoke_options
object in your queries payload.
curl --location 'https://my.orq.ai/v2/deployments/invoke' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer xxxxx' \
--data '{
"key": "deployment_key",
"messages": [
{
"role": "user",
"content": ""
}
],
"invoke_options": {
"include_retrievals": true
}
}'
generation = client.deployments.invoke(
key="deployment_key",
messages=[
{
"role": "user",
"content": ""
}
],
invoke_options={"include_retrievals": true}
)
print(generation.choices[0].message.content)
const deployment = await client.deployments.invoke({
key: "deployment_key",
messages: [
{
"role": "user",
"content": ""
}
],
invoke_options: { include_retrievals: true },
});
Your invokation will then embed the response chunks from the response field retrievals
as follow
Updated about 1 month ago