@sentry/junior-plugin-api 0.272.0 → 0.274.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +20 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -616,6 +616,18 @@ export interface PluginEmbedder {
|
|
|
616
616
|
vectors: number[][];
|
|
617
617
|
}>;
|
|
618
618
|
}
|
|
619
|
+
export interface PluginReranker {
|
|
620
|
+
/** Score plugin-owned documents against one query without exposing provider credentials. */
|
|
621
|
+
rerank(input: {
|
|
622
|
+
documents: string[];
|
|
623
|
+
query: string;
|
|
624
|
+
}): Promise<{
|
|
625
|
+
/** Best-effort provider cost for this reranking call. */
|
|
626
|
+
costUsd?: number;
|
|
627
|
+
/** One relevance score per document, in input order. Higher is more relevant. */
|
|
628
|
+
scores: number[];
|
|
629
|
+
}>;
|
|
630
|
+
}
|
|
619
631
|
export interface PluginContext {
|
|
620
632
|
/** Short-lived cache scoped to this plugin. */
|
|
621
633
|
cache: PluginCache;
|
|
@@ -1031,6 +1043,14 @@ type UserPromptContext = Pick<PluginContext, "db" | "log" | "plugin"> & {
|
|
|
1031
1043
|
/** Conversation-bound event writer when the prompt belongs to a durable turn. */
|
|
1032
1044
|
events?: PluginConversationEvents;
|
|
1033
1045
|
model: PluginModel;
|
|
1046
|
+
/** Host reranker bound to the configured reranking model. */
|
|
1047
|
+
reranker: PluginReranker;
|
|
1048
|
+
/**
|
|
1049
|
+
* Record numeric diagnostics on the host span for this hook. Keys must
|
|
1050
|
+
* start with `app.<plugin name>.`; the host drops other keys and
|
|
1051
|
+
* non-finite values.
|
|
1052
|
+
*/
|
|
1053
|
+
setSpanAttributes(attributes: Record<string, number>): void;
|
|
1034
1054
|
/** Location associated with this Conversation. */
|
|
1035
1055
|
locationId?: string;
|
|
1036
1056
|
actor?: Actor;
|