Overview
JevClassifier answers classifier questions through Jev, TypeSafe’s hosted classification model. All the questions about one state go to Jev in one request, and an answer typically comes back in about a tenth of a second. Jev’s probabilities are calibrated, so a threshold such as “act when the probability is above 0.8” means the same thing from one question to the next.
A JevClassifier asks through a JevClient, which holds the HTTP/2 connection, adds the auth header, retries when Jev is busy, and counts tokens. Build the classifier with an API key to give it a client of its own, or pass a JevClient to share one connection between several classifiers.
Classifier Questions
Ask yes/no, choice, and score questions about a call transcript. Runs by
default.
Questions About an Image
Ask about an image, such as a frame from a camera. Runs by default.
Installation
jev extra and the pipecat.classifiers.jev modules are deprecated in v1.13.0 and will be removed in 2.0.0. Use the typesafe extra and pipecat.classifiers.typesafe.jev instead.
Prerequisites
A Jev API key from TypeSafe, usually set as an environment variable:Configuration
JevClassifier
Jev API key, when the classifier should have a client of its own. One of
api_key and client is required.A client to share with other classifiers. One of
api_key and client is
required.JevClient
The Jev model to ask. It is pinned so thresholds you tune against it keep
holding.
jev-latest follows TypeSafe’s newest release.How many times to retry a request Jev refused because it was busy (HTTP 429 or
529), with exponential backoff.
Usage
Basic Usage
VoicemailDetector or UIWorker.
Sharing a Client
Several classifiers can share oneJevClient, and with it one connection pool and one token count:
cleanup(). A shared client is left open, so close it yourself with await client.close() when every classifier using it is done.
Opening the Connection Early
setup() opens the connection to Jev ahead of the first question, so the first answer does not pay for the TLS handshake. Components that own a classifier, such as VoicemailDetector, call it for you. If the connection cannot be opened at setup, a warning is logged and the first question opens it instead.
JevClassifier Properties
JevClient Reference
Properties
Methods
connect
ClassifierError if Jev could not be reached or refused the request.
close
Metrics
After every call, aJevClassifier reports the time it took as ProcessingMetricsData and the tokens Jev used as LLMUsageMetricsData through its on_metrics event.
Notes
- Limits: a choice question takes at most 255 options, available as
JEV_MAX_CHOICE_OPTIONSinpipecat.classifiers.typesafe.jev.classifier. A question with more raisesClassifierErrorbefore anything is sent. - Images: Jev can see images, so
supports_imagesisTrueandask(),yes_no(),choice()andscore()take images ininputs=. Jev takes PNG and JPEG images, 256 to 1568 pixels on each side, and rejects images outside those limits rather than resizing them. A WebP image raisesClassifierErrorbefore any request. TypeSafe offers images as a preview, so the limits may change between Jev releases. - Errors: a rejected request (the error includes the reason Jev gave, such as
Jev rejected the request: HTTP 400: Invalid image request.), a busy Jev after every retry, an unreachable server, or a reply missing an answer all raiseClassifierError. - Idle connections are kept open for 240 seconds, so a gap between questions does not cost a new TLS handshake.