Allow users to calculate RAG metrics
Project description
CustomGPT Metrics SDK
CustomGPT Metrics is a Python SDK designed to analyze and evaluate chatbot interactions using various metrics. This SDK seamlessly integrates with the CustomGPT platform, offering a straightforward way to assess chatbot performance.
Installation
To install the CustomGPT Metrics SDK, use the following pip
command:
pip install customgpt_metrics
Usage
from customgpt_metrics import CustomGPTMetrics
# Initialize the CustomGPTMetrics object
metrics = CustomGPTMetrics(api_key="your_api_key_here")
# Define a sample chat interaction
input_chat = {
'user_query': 'Can I upload my PDF files to build the ChatGPT chatbot?',
'ai_query': """Using only the following context, answer the questions.
If context has no information about the question say sorry you can't answer as you don't have enough knowledge about that subject.
You are a custom chatbot assistant called CustomGPT that answers questions based on the given context.
Be as helpful as possible.
...
--END OF CONTEXT--""",
'ai_response': 'Yes, you can upload your PDF files to build the ChatGPT chatbot. The platform supports uploading documents in 1400+ formats, including PDFs, Microsoft Office docs, Google docs, and audio files. You can simply go to your CustomGPT dashboard and upload the documents to build your custom chatbots in minutes.'
}
# Analyze the chat interaction
output = metrics.analyze_log(input_chat)
# Access individual metric values
print(f"Context Check: {output.context_check}")
print(f"Emotion Check: {output.emotion_check}")
print(f"Intent Check: {output.intent_check}")
print(f"Language Check: {output.language_check}")
Make sure to replace "your_api_key_here"
with your actual CustomGPT API key.
The SDK allows for easy analysis of various metrics and provides flexibility to customize metrics based on your requirements. The output is a parsed Metric
object containing the evaluated metric values.
Explore the additional features and metrics provided by the CustomGPT Metrics SDK to tailor the analysis to your specific use case.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file customgpt_metrics-0.1.0.tar.gz
.
File metadata
- Download URL: customgpt_metrics-0.1.0.tar.gz
- Upload date:
- Size: 8.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.8.10 Linux/5.15.0-89-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 40a70e2c31a3d6146b65a0336dedc8481263ef5eba608a2c70898463d7d2780b |
|
MD5 | 7e23e9841e61eb3d45e3a2856cc0b1bc |
|
BLAKE2b-256 | ec9c13237ac6c9d607f0706b28a2a86bc6d383281b3b8f2b8f38b6e659ce03a3 |
File details
Details for the file customgpt_metrics-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: customgpt_metrics-0.1.0-py3-none-any.whl
- Upload date:
- Size: 12.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.8.10 Linux/5.15.0-89-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b2915bb12a682986877ca5ef9b8fb383150c7ff7b877d0c7d8dc11d431e3fed0 |
|
MD5 | ed16e79b234a957fc0b9685db484af78 |
|
BLAKE2b-256 | 5b4a7d59e0a63d9f7a617e56356c50ad078e07fc4b8921a2b22dcf93562e4572 |