Automatic Goggles
A Python package for extracting structured fields from call transcripts with confidence scores using DSPy and OpenAI's language models.
Features
- Extract structured fields from conversation transcripts
- Get confidence scores for extracted data using log probabilities
- Optional reasoning explanations - Control performance and costs with the
include_reasoningflag - Support for multiple field types (currently supports string fields)
- Easy integration with OpenAI API
- Similar functionality to RetellAI post-call processing
Installation
pip install automatic-goggles
Quick Start
from transtype import TranscriptProcessor
# Initialize the processor with your OpenAI API key
processor = TranscriptProcessor(api_key="your-openai-api-key")
# Define your input data
data = {
"messages": [
{
"role": "assistant",
"content": "Hi, this is Marcus, I'm a customer service representative with TechFlow Solutions in Downtown Seattle."
},
{
"role": "user",
"content": "I need to discuss my account billing issues."
}
],
"fields": [
{
"field_name": "representative_name",
"field_type": "string",
"format_example": "Sarah Chen"
}
]
}
# Process the transcript
result = processor.process(data)
print(result)
Reasoning Flag
You can control whether to include reasoning explanations in the output using the include_reasoning parameter. This affects both performance and API costs:
With Reasoning (Default)
# Default behavior - includes detailed reasoning
processor = TranscriptProcessor(api_key="your-openai-api-key", include_reasoning=True)
# OR simply:
processor = TranscriptProcessor(api_key="your-openai-api-key")
result = processor.process(data)
# Output includes field_reason with explanation
Without Reasoning (Faster & Cost-Effective)
# Faster processing, lower API costs
processor = TranscriptProcessor(api_key="your-openai-api-key", include_reasoning=False)
result = processor.process(data)
# Output has field_reason set to null
Benefits of disabling reasoning:
- ⚡ Faster processing - Fewer tokens generated
- 💰 Lower costs - Reduced OpenAI API token usage
- 🎯 Focused output - Just the extracted values and confidence scores
When to use each mode:
- With reasoning: When you need explanations for debugging, quality assurance, or transparency
- Without reasoning: For production systems where you only need the extracted values
Output Format
With Reasoning (Default)
{
"fields": [
{
"field_name": "representative_name",
"field_value": "Marcus",
"field_confidence": 0.95,
"field_reason": "Representative introduced himself as 'Marcus' at the beginning of the conversation"
}
]
}
Without Reasoning
{
"fields": [
{
"field_name": "representative_name",
"field_value": "Marcus",
"field_confidence": 0.95,
"field_reason": null
}
]
}
Requirements
- Python 3.8+
- OpenAI API key
License
MIT License
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file automatic_goggles-0.2.0.tar.gz.
File metadata
- Download URL: automatic_goggles-0.2.0.tar.gz
- Upload date:
- Size: 7.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f91a210e597e1e17e05376327f643024a51e96463dcfed6c026943fe942ac629
|
|
| MD5 |
9c41976f660acaed6c85b8db8cda3a6c
|
|
| BLAKE2b-256 |
5506697ad531696af3aad620b168ee38705e9df3a5a0a73aa6272f35ed8bbd18
|
File details
Details for the file automatic_goggles-0.2.0-py3-none-any.whl.
File metadata
- Download URL: automatic_goggles-0.2.0-py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3ab3ee9dd36724e04c61e2247d2b06da270dc0f3ed2d8f13a5c3f2d79a685ebd
|
|
| MD5 |
eb7d56be233fa53d97aba842d1bf5a0a
|
|
| BLAKE2b-256 |
86650c41bf013d2e6fabb53cb56dea1afd1c3fa0846805770e17c39436afca7f
|