Query Integrity Guide
Discover the power of our Integrity feature, specifically designed to enhance AI accuracy and reliability by minimizing hallucinations— a prevalent concern for businesses using AI technology. Integrity is ideal for applications where accuracy and dependability are paramount.
Why Use Integrity?
Integrity significantly reduces the likelihood of AI-generated errors, known as hallucinations, by implementing a robust validation process. This feature leverages the AI's ability to cross-verify answers to ensure you receive the most accurate response possible, making it invaluable for businesses requiring consistent and reliable AI responses.
Understanding Integrity Settings
Integrity Levels
- Integrity 11: Default query with no additional checks.
- Integrity 12: Queries the specified model twice, allowing AI to vote 5 times on the best answer.
- Integrity 13: Queries the model thrice, selecting the best answer from three options.
In both Integrity 12 and 13, the gpt-4o
model is used by default for integrity checks, taking advantage of OpenAI's capability to provide n
factor benefits for rapid cross-verification.
How to Use Integrity
Integrating Integrity into your AI projects is straightforward. Below is a typical API call focusing on the essential parameters for Integrity configuration:
NOTE: Other than adding the integrity setting and the optional integrity model, there is no perceivable difference in the API call or its response, except for the response time. All the processes outlined in this document happen in the background.
Example: Query Cohere Command on Openrouter using Open AI gpt-3.5 for Integrity
curl -L -X POST 'https://apipie.ai/v1/chat/completions' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"messages": [
{
"role": "system",
"content": "Why is the sky blue?"
}
],
"model": "command",
"provider": "openrouter",
"max_tokens": 300,
"integrity": 12,
"integrity_model": "gpt-3.5-turbo",
}'
This code snippet demonstrates an API call utilizing Integrity to ensure the most reliable answer. Note that the integrity_model
setting is optional and defaults to gpt-4o
, but users may set it to any supported OpenAI model. The Response returned is an Open AI styled standard response.
Benefits of Integrity for Businesses
By mitigating potential hallucinations, the Integrity feature ensures that AI integrations remain dependable and accurate. This is particularly beneficial for business processes where data accuracy is crucial, such as report generation, customer query handling, and automated decision-making systems.
Note: Integrity settings incur additional API costs due to repeated queries and voting mechanisms, but remain affordable and worthwhile, especially for high-stakes applications.