Repository navigation
feat: add agent scorer run support @W-23997055 - #367
Open
nabilnaffar-sf wants to merge 2 commits into
Open
nabilnaffar-sf wants to merge 2 commits into
nabilnaffar-sf wants to merge 2 commits into
Conversation
Client-side API for authoring Agent Scorers and generating their
deployable metadata from a typed ScorerSpec:
- createScorerDefinition(spec, { outputDir, write }) generates
aiAgentScorerDefinition and (when needed) genAiPromptTemplate metadata.
- Default prompt content derived from the scorer's output JSON Schema.
- Versioning/parse helpers: parseScorerXml, parseScorerVersions, loadScorerSpec.
- Validation + API-name helpers (validateScorerSpec, isValidScorerApiName,
labelToApiName) and the exported SCORER_SPEC_JSON_SCHEMA generated from
the ScorerSpec type (scripts/gen-scorer-schema.mjs).
- Public scorer authoring vocabulary re-exported from the package root.
Scorer run support follows in a separate PR.
Run an authored Agent Scorer against a normalized STDM session: - runScorer(spec, session, connection) dispatches through a pluggable engine registry (registerEngine / getEngine); PromptTemplate engine provided, backed by the prompt-templates generations API with bounded, jittered retry for transient LLM-gateway throttling/unavailability. - normalizeSession reshapes STDM timestamps to the format the platform's Input:Session validation accepts, so real Data Cloud data scores verbatim. - Typed STDM SessionView model + exported SESSION_VIEW_JSON_SCHEMA (generated from the SessionView type). - Run-time surface (runScorer, engines, session view types/schema) re-exported from the package root. Stacked on the scorer authoring PR; merge that first.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Adds Agent Scorer run support — run an authored scorer against a normalized STDM session and get a typed score back. This is the second of two PRs that split #317.
What issues does this PR fix or reference?
@W-23997055
What's included (run-only delta)
runScorer(spec, session, connection)runs a scorer against a normalized STDMSessionViewand returns aScorerResult, dispatched through a pluggable engine registry (registerEngine/getEngine). APromptTemplateengine is provided, backed by the prompt-templates generations API with bounded, jittered retry for transient LLM-gateway throttling/unavailability and disambiguated failure messages.normalizeSessionreshapes STDM/Data Cloud timestamps to the exact format the platform'sInput:Sessionvalidation accepts, so real captured data scores without hand-editing.SessionView(+ sub-views) and the exportedSESSION_VIEW_JSON_SCHEMA, generated from theSessionViewtype.runScorer, engine registry, session view types, and the session-view schema re-exported from the package root.Verification
yarn build(compile + lint) ✅yarn mocha "test/**/*.test.ts"— full suite green (588 passing, 1 pending);test/agentScorerRun.test.tscovers this PR's surface.